/* ═══════════════════════════════════════════════════════════════════════════
   Ruben Pop — portfolio
   Implementation of the "Portfolio v2" design-canvas document. Every colour,
   size and easing below is carried over 1:1 from that source.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg:          #070707;
  --card:        #0C0C0B;
  --card-hover:  #101010;
  --tile:        #131312;

  /* Ink */
  --fg:          #F2F2F0;
  --fg-soft:     #E4E4DE;
  --dim:         #A8A8A2;
  --muted:       #6E6E68;
  --faint:       #3F3F3A;
  --stack:       #8A8A84;
  --badge-ink:   #C9C9C3;

  /* Accent */
  --accent:      #00FF88;
  --accent-dim:  #3F6E56;

  /* Lines */
  --line:        #17170F;
  --line-soft:   #101010;
  --stroke:      #2E2E2A;
  --outline:     #3A3A37;

  /* Rhythm — the gutter every full-width section shares */
  --gutter:      clamp(20px, 5vw, 48px);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Archivo, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Set while a project panel is open, so the page behind it can't scroll. */
body.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: var(--bg); }

.page { width: 100%; overflow: hidden; }

/* Shared: the uppercase mono label used for every section chrome element. */
.nav,
.hero__eyebrow,
.hero__stat,
.section__head,
.number__label,
.sublabel,
.mark__label,
.path-row__org,
.study-row__org,
.stack-group__label,
.contact__where,
.contact__socials,
.panel__bar,
.panel__meta,
.panel__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@keyframes marq  { from { transform: translateX(0) }  to { transform: translateX(-50%) } }
@keyframes blink { 0%, 55% { opacity: 1 } 56%, 100% { opacity: 0.12 } }
@keyframes hOut {
  from { -webkit-mask-position: 0% 100%; mask-position: 0% 100% }
  to   { -webkit-mask-position: 0% 0%;   mask-position: 0% 0% }
}
@keyframes hIn {
  from { -webkit-mask-position: 0% 0%;   mask-position: 0% 0% }
  to   { -webkit-mask-position: 0% 100%; mask-position: 0% 100% }
}


/* ── Nav ──────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--gutter);
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 7, 7, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { color: var(--fg); }
.nav__links { display: flex; flex-wrap: wrap; gap: 14px 26px; }
.nav__cta   { color: var(--accent); }


/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero { padding: clamp(56px, 9vw, 96px) var(--gutter) 0; }

.hero__eyebrow {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2.4s infinite;
}

.hero__title {
  margin: 24px 0 0;
  font-size: clamp(64px, 13.5vw, 260px);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  /* Two lines at line-height .82 — reserved up front so the swapping first
     word never reflows the page. */
  height: 1.64em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hero__clip { display: block; overflow: hidden; }
.hero__word {
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 44%, #000 56%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, transparent 44%, #000 56%, #000 100%);
  -webkit-mask-size: 100% 240%;
          mask-size: 100% 240%;
  animation: hIn 620ms cubic-bezier(.2, 0, .1, 1) forwards;
}
.hero__word[data-phase="out"] { animation: hOut 520ms cubic-bezier(.4, 0, .2, 1) forwards; }

/* Outline treatment is the default; add .hero--solid on <h1> for the filled
   green variant (the `outlineHeadline` prop in the source document). */
.hero__line2 {
  display: block;
  color: var(--bg);
  -webkit-text-stroke: 2px var(--outline);
}
.hero--solid .hero__line2 {
  color: var(--accent);
  -webkit-text-stroke: 0;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 20px 40px;
  margin-top: 56px;
}
.hero__stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.hero__stat-num { color: var(--accent); }
.hero__stat-sep { color: var(--stroke); }
.hero__stat-txt { color: var(--muted); }

.hero__quote {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--dim);
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding-left: 18px;
  max-width: 62ch;
  text-wrap: pretty;
}


/* ── Ticker ───────────────────────────────────────────────────────────── */

.ticker {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker__track {
  display: inline-flex;
  animation: marq 96s linear infinite;
  will-change: transform;
}
.ticker__item {
  font-family: var(--mono);
  font-size: clamp(26px, 3.6vw, 54px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
  padding-right: 56px;
}


/* ── Section chrome ───────────────────────────────────────────────────── */

.section        { padding: clamp(80px, 11vw, 120px) var(--gutter) 0; }
.section--wide  { padding-top: clamp(88px, 12vw, 140px); }

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.section__head--single { display: block; }
.section__head-link { color: var(--accent); }

.sublabel { color: var(--faint); }
.sublabel--top    { padding: 34px 0 0; }
.sublabel--quotes { padding: 44px 0 18px; }
.sublabel--study  { padding: 56px 0 8px; }


/* ── Work grid ────────────────────────────────────────────────────────── */

.work {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 4px;
  padding-top: 4px;
}

.card {
  display: block;
  background: var(--card);
  padding: 14px 14px 26px;
  cursor: pointer;
}
.card:hover { background: var(--card-hover); color: inherit; }

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--tile);
  transition: filter 420ms cubic-bezier(.2, 0, .1, 1);
  filter: grayscale(1) contrast(1.06) brightness(0.82);
}
.card:hover .card__thumb { filter: grayscale(0) contrast(1) brightness(1); }

.card--archived .card__thumb        { filter: grayscale(1) contrast(1.02) brightness(0.5); }
.card--archived:hover .card__thumb  { filter: grayscale(0.45) contrast(1) brightness(0.72); }

/* Touch devices never hover, so the art rests in its lit state. Done as a
   media query rather than a JS-applied class: a class added after first paint
   would transition the whole grid from grey to colour on load. */
@media (hover: none) {
  .card__thumb                      { filter: grayscale(0) contrast(1) brightness(1); }
  .card--archived .card__thumb      { filter: grayscale(0.45) contrast(1) brightness(0.72); }
}

.card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--badge-ink);
  background: rgba(7, 7, 7, 0.78);
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  backdrop-filter: blur(6px);
}

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 22px 8px 0;
}
.card__title {
  margin: 0;
  font-size: clamp(26px, 2.7vw, 40px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.card__tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.card__cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 8px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 260ms;
}
.card__cta:hover { color: var(--accent); }


/* ── Numbers ──────────────────────────────────────────────────────────── */

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px;
  border-top: 1px solid var(--line);
  padding-top: 48px;
}
.number__value {
  font-size: clamp(52px, 6.5vw, 104px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
}
.number__label { color: var(--muted); margin-top: 18px; }
.number__note {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 8px;
}


/* ── Clients ──────────────────────────────────────────────────────────── */

.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 56px;
  padding: 18px 0 44px;
  border-bottom: 1px solid var(--line);
}
.mark { display: flex; align-items: baseline; gap: 12px; }
.mark__value {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.mark__label { color: var(--muted); }

.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 4px;
}
.quote {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  background: var(--card);
  padding: clamp(28px, 4vw, 48px);
}
.quote__text {
  margin: 0;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-wrap: pretty;
}
.quote__by {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.quote__who  { color: var(--accent); }
.quote__sep  { color: var(--stroke); }
.quote__note { color: var(--muted); }


/* ── Path ─────────────────────────────────────────────────────────────── */

.path-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 40px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.path-group__years {
  flex: none;
  width: 140px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.path-group__rows {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.path-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
}
.path-row__role {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.path-row__org {
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}

.study-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 40px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.study-row__years {
  flex: none;
  width: 140px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-dim);
}
.study-row__role {
  flex: 1 1 240px;
  margin: 0;
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--dim);
}
.study-row__org {
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}


/* ── Stack ────────────────────────────────────────────────────────────── */

.stack-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 44px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stack-group__label { flex: none; width: 140px; color: var(--faint); }
.stack-group__items {
  flex: 1 1 320px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
}
.stack-item {
  font-size: clamp(22px, 2.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--stack);
}
.stack-item:hover { color: var(--accent); }


/* ── Contact ──────────────────────────────────────────────────────────── */

.contact { padding: clamp(110px, 15vw, 180px) var(--gutter) 96px; }

.contact__id {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}
.contact__portrait { width: 56px; height: 56px; flex: none; }
.contact__where { color: var(--muted); }

.contact__email {
  display: block;
  font-size: clamp(34px, 8.5vw, 150px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.9;
  color: var(--accent);
  word-break: break-word;
}
.contact__email:hover { color: var(--fg); }

.contact__resume { display: flex; margin-top: 44px; }
.contact__resume a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--accent);
  padding: 16px 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.contact__resume a:hover { background: var(--accent); color: #0A0A08; }
.contact__arrow { font-size: 14px; }

.contact__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 40px;
  color: var(--muted);
}


/* ── Project panel ────────────────────────────────────────────────────── */

.panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 4, 4, 0.94);
  backdrop-filter: blur(14px);
  overflow-y: auto;
}
.panel[data-open] { display: block; }
/* No-JS fallback: ordinary anchors drive open/close/prev/next through :target.
   Scoped away from the JS path because :target only changes on a real fragment
   navigation — script can't clear it, so a closed panel would stay visible. */
html:not(.js) .panel:target { display: block; }

.panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 0;
  min-height: 100%;
}

.panel__info {
  padding: clamp(28px, 5vw, 56px) var(--gutter);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.panel__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}
.panel__genre { color: var(--accent); }
.panel__nav { display: flex; gap: 12px; align-items: center; }
.panel__btn {
  cursor: pointer;
  border: 1px solid var(--stroke);
  padding: 8px 12px;
}
.panel__btn:hover { color: var(--accent); border-color: var(--accent); }

.panel__title {
  margin: 0;
  font-size: clamp(38px, 4.4vw, 68px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.panel__blurb {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--dim);
  text-wrap: pretty;
}
.panel__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.panel__meta-key  { color: var(--faint); }
.panel__meta-val  { color: var(--fg); }
.panel__meta-sep  { color: var(--stroke); }
.panel__meta-note { color: var(--muted); }

.panel__label {
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel__did {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  line-height: 1.45;
  color: var(--fg-soft);
}
.panel__did-mark {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  padding-top: 3px;
}

.panel__feature {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  line-height: 1.45;
  color: var(--dim);
}

.panel__cta { margin-top: auto; padding-top: 8px; }

.panel__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--accent);
  color: var(--bg);
  padding: 22px 26px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.panel__link:hover { background: var(--fg); color: var(--bg); }

.panel__archived {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 20px;
  border: 1px solid var(--stroke);
  padding: 22px 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.panel__archived-note { color: var(--muted); }
.panel__archived a    { color: var(--accent); }

.panel__soon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 22px 26px;
}
.panel__soon-label {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.panel__soon-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Shots column. Landscape titles get one full-width 16:9 stack; portrait
   (phone) titles get a 9:19.5 row that wraps. */
.panel__shots {
  padding: clamp(24px, 5vw, 56px) var(--gutter);
  display: grid;
  gap: 20px;
  align-content: center;
  justify-items: stretch;
  min-width: 0;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
.panel--portrait .panel__shots {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.shot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: radial-gradient(120% 70% at 50% 50%, #15201A 0%, #0C0C0B 62%);
  box-shadow: inset 0 0 0 1px #17170F, inset 0 0 60px rgba(0, 255, 136, 0.05);
}
.panel--portrait .shot { aspect-ratio: 9 / 19.5; }

.panel--dash .shot {
  background: radial-gradient(120% 70% at 50% 50%, #242426 0%, #0C0C0B 62%);
  box-shadow: inset 0 0 0 1px #1C1C1B, inset 0 0 60px rgba(190, 190, 200, 0.05);
}
.panel--fox .shot {
  background: radial-gradient(120% 70% at 50% 50%, #16233A 0%, #0C0C0B 62%);
  box-shadow: inset 0 0 0 1px #16202E, inset 0 0 60px rgba(90, 150, 255, 0.07);
}
.panel--hockey .shot {
  background: radial-gradient(120% 70% at 50% 50%, #1B241F 0%, #0C0C0B 66%);
  box-shadow: inset 0 0 0 1px #18201B, inset 0 0 60px rgba(0, 255, 136, 0.028);
}


/* ── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ticker__track,
  .hero__dot { animation: none; }
  .hero__word { animation: none; -webkit-mask-image: none; mask-image: none; }
  .card__thumb, .card__cta { transition: none; }
}
