/* ==========================================================================
   joshrencher.dev — placeholder site
   Dark "spec sheet" layout: hairline section rules, mono utility labels,
   one violet accent, and a two-rail logo marquee as the centerpiece.
   ========================================================================== */

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg:            #0A0C10;
  --bg-soft:       #0E1116;
  --line:          rgba(255, 255, 255, 0.09);
  --line-strong:   rgba(255, 255, 255, 0.18);
  --text:          #E9ECF2;
  --text-dim:      #C6CCD8;
  --muted:         #969DAB;
  --accent:        #A78BFA;
  --accent-dim:    rgba(167, 139, 250, 0.38);
  --accent-wash:   rgba(167, 139, 250, 0.10);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --container: 1080px;
  --gutter: clamp(20px, 5vw, 40px);
  --nav-h: 64px;
  --chip-gap: 14px;
  --radius: 12px;
}

/* Wide screens get roomy ~1.5in side margins and a wider measure, so the
   project rows have somewhere to go. */
@media (min-width: 900px) {
  :root {
    --container: 1560px;
    --gutter: clamp(40px, 10vw, 144px);
  }
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, figure, figcaption { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: #0A0C10; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.sep { color: var(--accent); padding-inline: 0.35em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: #0A0C10;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.wordmark__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wordmark__text {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.4vw, 1.6rem);
  font-size: 0.86rem;
  /* Safety valve on very narrow phones: scroll rather than clip. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-block: 0.35rem;
}
.nav__links::-webkit-scrollbar { display: none; }

.nav__links a {
  color: var(--muted);
  transition: color 0.2s ease;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--text); }

.nav__resume {
  color: var(--text) !important;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.nav__resume:hover {
  border-color: var(--accent-dim);
  background: var(--accent-wash);
}

@media (max-width: 620px) {
  .wordmark__text { display: none; }
  .nav__links { font-size: 0.8rem; gap: 0.7rem; }
  .nav__resume { padding: 0.35rem 0.6rem; }
}

@media (max-width: 480px) {
  .nav__inner { gap: 0.6rem; }
  .nav__links { font-size: 0.75rem; gap: 0.55rem; }
  .nav__resume { padding: 0.3rem 0.5rem; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(64px, 11vh, 116px) clamp(44px, 7vh, 76px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 40% 40% -25%;
  background: radial-gradient(closest-side, rgba(167, 139, 250, 0.16), transparent 70%);
  pointer-events: none;
}

.hero__inner { position: relative; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.5);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(167, 139, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

.hero__name {
  font-size: clamp(2.9rem, 11vw, 5.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.hero__role {
  margin-top: 1.15rem;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.9vw, 0.8rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero__lede {
  margin-top: 1.9rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.09rem);
  line-height: 1.75;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 0.18s ease, background-color 0.2s ease,
              border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--accent); color: #0A0C10; }
.btn--primary:hover { background: #BFA8FF; }

.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover {
  border-color: var(--accent-dim);
  background: var(--accent-wash);
  color: var(--accent);
}

.btn__arrow { font-size: 0.9em; opacity: 0.8; }

/* ── Section shell ───────────────────────────────────────────────────── */
/* No rules between sections — the mono eyebrow labels carry the structure. */
.section {
  padding-block: clamp(38px, 5vw, 62px);
}

/* minmax(0, 1fr) keeps the track from stretching to fit wide children —
   without it a horizontal scroller inside a card blows the page out. */
.section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.section__body { min-width: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-right: 0.7rem;
  vertical-align: middle;
  background: var(--accent);
}

.section__title {
  font-size: clamp(1.55rem, 3.2vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.9rem;
}

.section__title--lg {
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  letter-spacing: -0.035em;
}

.prose {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.75;
}
.prose--tight { font-size: 1rem; }

@media (min-width: 900px) {
  .section__grid {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 3.5rem;
  }
  .eyebrow {
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    align-self: start;
    padding-top: 0.45rem;
  }
}

/* ── Skills ──────────────────────────────────────────────────────────── */
.section--skills { padding-bottom: clamp(30px, 4vw, 48px); }

/* Inline text button that swaps the marquee for the full grid. Useless
   without JS, so it only appears once the script has run. */
.link-btn {
  display: none;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  white-space: nowrap;
}
.js .link-btn { display: inline; }
.link-btn:hover { text-decoration-thickness: 2px; }

.skills-all {
  display: flex;
  flex-wrap: wrap;
  gap: var(--chip-gap);
  margin-top: clamp(20px, 3vw, 30px);
}
.js .skills-all .chip { margin: 0; }

.marquee {
  margin-top: clamp(26px, 4vw, 42px);
  overflow: hidden;
  padding-inline: var(--gutter);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.js .marquee { padding-inline: 0; }

.marquee__row {
  display: flex;
  flex-wrap: wrap;
  --duration: 64s;
}
.marquee__row + .marquee__row { margin-top: var(--chip-gap); }
.marquee__row--reverse { --duration: 78s; }

.marquee__group { display: flex; flex-wrap: wrap; }

.js .marquee__row,
.js .marquee__group { flex-wrap: nowrap; }

.js .marquee__row {
  width: max-content;
  animation: marquee var(--duration) linear infinite;
  will-change: transform;
}
.js .marquee__row--reverse { animation-direction: reverse; }

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ── Chips ───────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 var(--chip-gap) var(--chip-gap) 0;
  padding: 0.55rem 0.95rem 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.js .chip { margin-bottom: 0; }

.chip__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: grayscale(0.35);
  opacity: 0.85;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.chip__img--mono { filter: invert(1); opacity: 0.72; }

.chip:hover .chip__img { filter: none; opacity: 1; }
.chip:hover .chip__img--mono { filter: invert(1); opacity: 1; }

.chip__label {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-dim);
}

.chip--text { padding-inline: 1rem; }
.chip--text .chip__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* ── Projects ────────────────────────────────────────────────────────── */
/* Section label pins to the top while the projects scroll past it. The page
   background rides along so content passes underneath cleanly. */
.eyebrow--band {
  position: sticky;
  top: var(--nav-h);
  z-index: 3;
  align-self: stretch;
  background: var(--bg);
  padding-block: 0.75rem 0.85rem;
  margin-bottom: clamp(10px, 1.6vw, 22px);
}

.project { display: grid; gap: clamp(26px, 3vw, 48px); }
.project + .project { margin-top: clamp(58px, 7vw, 116px); }

.project__title {
  font-size: clamp(1.7rem, 2.7vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.project__text {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 46ch;
}

.project__info .tags { margin-top: 1.6rem; }
.project__cta { margin-top: 1.6rem; }

/* Below this the 1/3 column gets too cramped to read, so the row stacks.
   Stacked, the text always leads; only the wide layout alternates sides. */
@media (min-width: 1080px) {
  .project {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
  }

  .project--flip { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .project--flip .project__media { order: 1; }
  .project--flip .project__info { order: 2; }
}

/* ── Project cards (unused by the current layout, kept for image/video slots) ── */
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}
.card + .card { margin-top: 1.25rem; }

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 9px),
    var(--bg-soft);
  overflow: hidden;
}

.card__media img,
.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 0.6rem 1rem;
}

/* Endless carousel of phone clips (media type: video-wheel) */
.project__media {
  position: relative;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.wheel {
  display: flex;
  width: max-content;
  gap: clamp(10px, 1.4vw, 18px);
  will-change: transform;
}
.js .wheel { cursor: grab; }
.js .wheel.is-dragging { cursor: grabbing; }

.clip {
  flex: 0 0 auto;
  margin: 0;
  width: var(--clip-w, clamp(140px, 15vw, 226px));
  user-select: none;
  -webkit-user-select: none;
}

/* Landscape captures need fewer, wider clips than portrait phone ones. */
.project__media--wide { --clip-w: clamp(250px, 31vw, 470px); }

.clip video {
  width: 100%;
  height: auto;
  aspect-ratio: var(--clip-aspect, 420 / 914);
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #000;
  object-fit: cover;
  pointer-events: none;
}

.clip__label {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.card__body { padding: clamp(20px, 3.5vw, 28px); }

.card__cta { margin-top: 1.4rem; }

.btn--sm {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  border-radius: 9px;
}

.card__title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.card__text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 62ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
}

.card--muted {
  background: none;
  border-style: dashed;
}
.card__title--muted {
  color: var(--text-dim);
  font-size: 1.08rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
}

/* Horizontally scrolling screenshot strip (media type: scroll-strip) */
.strip { width: 100%; height: 100%; overflow: hidden; }

.strip__track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: marquee 46s linear infinite;
}
.strip__track img {
  width: auto;
  height: 100%;
  margin-right: var(--chip-gap);
  border-radius: 6px;
  object-fit: cover;
}
.card__media:hover .strip__track { animation-play-state: paused; }

/* ── Contact + footer ────────────────────────────────────────────────── */
.section--contact .actions { margin-top: 2rem; }

.footer {
  padding-block: 2rem 2.5rem;
}
.footer__inner {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Scroll reveal ───────────────────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

.hero .reveal:nth-child(2) { transition-delay: 0.06s; }
.hero .reveal:nth-child(3) { transition-delay: 0.12s; }
.hero .reveal:nth-child(4) { transition-delay: 0.18s; }
.hero .reveal:nth-child(5) { transition-delay: 0.24s; }

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal { opacity: 1; transform: none; }

  .status__dot { animation: none; }

  /* Marquees stop and become manually scrollable instead. */
  .js .marquee__row,
  .strip__track { animation: none !important; transform: none !important; }

  .project__media {
    overflow-x: auto;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .wheel { transform: none !important; }

  .marquee,
  .js .marquee {
    overflow-x: auto;
    padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch;
    /* Nothing is sliding past the edges, so drop the fade. */
    -webkit-mask-image: none;
            mask-image: none;
  }
  .strip { overflow-x: auto; }
}
