/* =========================================================
   farkasbeni.com — style.css

   One idea: a single red thread runs through the page and is
   drawn by scrolling. The layout is built around it: a centre
   spine, names to its left, sentences to its right. Everything
   else stays quiet.
   ========================================================= */

@font-face { font-family: "Forum"; src: url("../assets/fonts/forum-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/figtree-latin-wght-italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }

:root {
  --bg: #0E0E0F;
  --ink: #F2EFEA;
  --ink-2: #A9A6A0;
  --ink-3: #6E6C67;
  --line: #29292D;
  --cherry: #8C0A1E;      /* brand red: fills, hovers */
  --thread: #C8152F;      /* the thread: same hue, lifted so a hairline reads on black */

  --serif: "Forum", "Cinzel", "Times New Roman", serif;
  --sans: "Avenir Next", "Avenir", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1440px;
  --gutter: clamp(24px, 5vw, 72px);
  --spine: clamp(56px, 7vw, 112px);      /* gap between the two columns; the thread runs in its middle */
  --section: clamp(104px, 13vw, 184px);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); scrollbar-color: #3A3A3F var(--bg); }
html.is-locked { overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-weight: 300; font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, picture, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--cherry); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 1.5px solid var(--thread); outline-offset: 4px; }

.skip { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); font-size: .875rem; transform: translateY(-200%); transition: transform 180ms var(--ease-out); }
.skip:focus-visible { transform: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.display { font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: .015em; line-height: 1; }

/* Two columns around the spine. Left: names, set flush right. Right: sentences. */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--spine); align-items: baseline; }
.pair__l { text-align: right; }
.tag { font-family: var(--sans); font-weight: 400; font-size: 1rem; line-height: 1.4; color: var(--ink-3); }

/* ---------- The thread ---------- */
#main { position: relative; }
.thread { position: absolute; top: 0; left: 0; z-index: 1; overflow: visible; pointer-events: none; max-width: none; }
.no-js .thread, .no-thread .thread { display: none; }
.thread__ghost { stroke: var(--line); stroke-width: 1; }
.thread__line { stroke: var(--thread); stroke-width: 1.5; stroke-linecap: round; }
.thread__start { fill: var(--thread); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity 400ms ease, transform 500ms var(--ease-out); }
.has-begun .thread__start { opacity: 1; transform: none; }
.thread__end, .thread__node { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; transition: fill 400ms ease, stroke 400ms ease; }
.thread__node.is-on, .is-done .thread__end { fill: var(--thread); stroke: var(--thread); }

/* What the tip has not reached yet waits in the half-dark. */
.has-thread [data-lit] { opacity: .26; transition: opacity 800ms var(--ease-out); }
.has-thread [data-lit].is-lit { opacity: 1; }
.has-thread .bw[data-lit]:not(.is-lit) { opacity: .2; }
.has-thread .bw[data-lit] { transition-duration: 500ms; }
.no-thread [data-lit] { opacity: 1 !important; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: 72px;
  display: flex; align-items: center; gap: 36px; padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 300ms ease, border-color 300ms ease;
}
.nav.is-scrolled { background: var(--bg); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__mark { width: 20px; height: auto; }
.brand__name { font-family: var(--serif); text-transform: uppercase; letter-spacing: .08em; font-size: 1.0625rem; line-height: 1; padding-top: 2px; }
.nav__links { display: flex; gap: 32px; }
.nav__links a, .nav__cta { font-size: .9375rem; font-weight: 400; color: var(--ink-2); transition: color var(--t) ease; }
.nav__links a:hover { color: var(--ink); }
.nav__cta { color: var(--ink); padding: 9px 18px; border: 1px solid rgba(242, 239, 234, .32); transition: border-color var(--t) ease, background-color var(--t) ease, color var(--t) ease; }
.nav__cta:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -1; background: #000; }
.js .hero__media { clip-path: inset(46% 0 46% 0); transition: clip-path 1500ms var(--ease-out); }
.is-ready .hero__media { clip-path: inset(0); }
.hero__plate { position: absolute; inset: -4% 0; background: url("../assets/video/reel-poster.jpg") center 40% / cover no-repeat; will-change: transform; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; opacity: 0; transition: opacity 1200ms ease; }
.hero__video.is-playing { opacity: 1; }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(14,14,15,.62) 0%, rgba(14,14,15,0) 22%, rgba(14,14,15,.12) 44%, rgba(14,14,15,.9) 80%, rgba(14,14,15,1) 100%),
    linear-gradient(90deg, rgba(14,14,15,.5) 0%, rgba(14,14,15,0) 65%);
}
.grain {
  position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.hero__inner { display: flex; flex-direction: column; justify-content: flex-end; padding-top: 120px; padding-bottom: clamp(28px, 4.5vh, 48px); }
.hero__title { font-size: clamp(2.5rem, 6.8vw, 6.5rem); line-height: .96; max-width: 12.5em; text-wrap: balance; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w__in { display: inline-block; }
.js .w__in { transform: translateY(108%); transition: transform 1200ms var(--ease-out); transition-delay: calc(380ms + var(--i) * 60ms); }
.is-ready .w__in { transform: none; }

.hero__rule { height: 1px; margin-top: clamp(36px, 6vh, 72px); background: rgba(242, 239, 234, .16); }
.hero__foot { padding-top: 28px; align-items: center; }
.js .hero__foot { opacity: 0; transition: opacity 900ms ease 1500ms; }
.is-ready .hero__foot { opacity: 1; }
.hero__meta { display: flex; flex-direction: column; gap: 2px; font-size: .9375rem; line-height: 1.5; color: var(--ink-2); }
.hero__meta span:first-child { color: var(--ink); }
.hero__actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

.play { display: inline-flex; align-items: center; gap: 14px; font-size: .9375rem; font-weight: 400; }
.play__icon {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(242,239,234,.5);
  display: grid; place-items: center; padding-left: 3px;
  transition: border-color var(--t) ease, background-color var(--t) ease, color var(--t) ease, transform 160ms var(--ease-out);
}
.play:hover .play__icon { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.play:active .play__icon { transform: scale(.96); }

.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px;
  background: var(--ink); color: var(--bg); font-size: .9375rem; font-weight: 500;
  transition: background-color var(--t) ease, color var(--t) ease, transform 160ms var(--ease-out);
}
.btn:hover { background: var(--cherry); color: var(--ink); }
.btn:active { transform: scale(.98); }

/* ---------- Items: a name on the left of the thread, a sentence on the right ---------- */
.services { padding: clamp(72px, 9vw, 128px) 0 var(--section); }
.items { margin-top: clamp(20px, 2.5vw, 32px); }
.item { padding: clamp(22px, 2.6vw, 38px) 0; }
.item__title { font-size: clamp(1.75rem, 4vw, 4rem); letter-spacing: .01em; text-wrap: balance; }
.item__body { max-width: 30em; font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.items--tight .item { padding: clamp(16px, 1.9vw, 26px) 0; }
.items--tight .item__title { font-size: clamp(1.5rem, 2.6vw, 2.375rem); }

/* ---------- Work ---------- */
.work { padding-bottom: var(--section); }
.reelwrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.reelcard { position: relative; z-index: 2; display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 88vh; overflow: hidden; background: #000; text-align: left; }
.reelcard picture, .reelcard img, .reelcard__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reelcard__video { opacity: 0; transition: opacity 900ms ease; }
.reelcard__video.is-playing { opacity: 1; }
.reelcard__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,14,15,0) 45%, rgba(14,14,15,.8) 100%); }
.reelcard__cap { position: absolute; left: clamp(20px, 3vw, 44px); bottom: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; gap: 8px; }
.reelcard__title { font-size: clamp(2.25rem, 5.4vw, 5rem); }
.reelcard__note { font-size: .9375rem; color: var(--ink-2); }
.reelcard__play {
  position: absolute; right: clamp(20px, 3vw, 44px); bottom: clamp(20px, 3vw, 40px);
  width: clamp(64px, 7vw, 92px); height: clamp(64px, 7vw, 92px); border-radius: 50%;
  border: 1px solid rgba(242,239,234,.6); display: grid; place-items: center; padding-left: 4px;
}
.has-cursor .reelcard { cursor: none; }
.has-cursor .reelcard__play { display: none; }

.cursor {
  position: fixed; top: 0; left: 0; z-index: 60; width: 104px; height: 104px; margin: -52px 0 0 -52px;
  pointer-events: none; display: none;
}
.has-cursor .cursor { display: block; }
.cursor span {
  width: 100%; height: 100%; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-size: .9375rem; font-weight: 500;
  opacity: 0; transform: scale(.6); transition: opacity 180ms ease, transform 260ms var(--ease-out);
}
.cursor.is-on span { opacity: 1; transform: none; }

.worked { padding-top: var(--section); }
.question { margin-top: clamp(28px, 3.4vw, 48px); font-size: clamp(1.5rem, 2.6vw, 2.375rem); line-height: 1.08; max-width: 15em; text-wrap: balance; }

/* ---------- About ---------- */
.about { padding-bottom: var(--section); }
.about__lead { font-size: clamp(1.5rem, 2.5vw, 2.25rem); line-height: 1.28; letter-spacing: -.01em; max-width: 21em; text-wrap: pretty; }
.about__body { margin-top: clamp(24px, 3vw, 40px); max-width: 30em; }
.about__body p { font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.belief { margin-top: clamp(72px, 9vw, 128px); }
.belief__line { font-size: clamp(2rem, 4vw, 4rem); line-height: 1.02; text-wrap: balance; }
.belief__body { max-width: 28em; font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); }
.belief__closing { margin-top: clamp(40px, 5vw, 64px); max-width: 26em; font-style: italic; font-size: clamp(1.1875rem, 1.6vw, 1.375rem); line-height: 1.5; }

/* ---------- Contact ---------- */
.contact { padding: var(--section) 0 clamp(72px, 9vw, 128px); }
.contact__title { font-size: clamp(2.75rem, 8.6vw, 9.5rem); line-height: .94; max-width: 9em; text-wrap: balance; }
.contact__line { margin-top: 32px; font-size: clamp(1.125rem, 1.5vw, 1.3125rem); color: var(--ink-2); }
.contact__list { margin-top: clamp(56px, 7vw, 96px); }
.contact__list li { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: baseline; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.contact__label { font-size: 1rem; color: var(--ink-3); }
.contact__link {
  justify-self: start; font-size: clamp(1.375rem, 3vw, 2.5rem); font-weight: 300; letter-spacing: -.01em; overflow-wrap: anywhere;
  background: linear-gradient(var(--thread), var(--thread)) 0 100% / 0 1.5px no-repeat;
  transition: background-size 420ms var(--ease-out);
}
.contact__link:hover { background-size: 100% 1.5px; }

/* ---------- Footer ---------- */
.footer { padding: 28px 0 36px; }
.footer__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: .875rem; color: var(--ink-3); }
.footer__mark { width: 16px; height: auto; opacity: .55; }
.footer__left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.footer__left a { color: var(--ink-3); text-decoration: none; transition: color var(--t) ease; }
.footer__left a:hover { color: var(--ink); }

/* ---------- Legal page ---------- */
.legal { padding: 140px 0 96px; }
.legal__wrap { max-width: 760px; }
.legal__back { display: inline-flex; gap: 8px; color: var(--ink-3); text-decoration: none; font-size: .9375rem; margin-bottom: 48px; }
.legal__back:hover { color: var(--ink); }
.legal h1 { font-family: var(--serif); font-weight: 400; text-transform: uppercase; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1; letter-spacing: .01em; margin: 0 0 12px; }
.legal h2 { font-family: var(--serif); font-weight: 400; text-transform: uppercase; font-size: clamp(1.375rem, 2.4vw, 1.875rem); letter-spacing: .02em; margin: 56px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.legal h3 { font-size: 1.0625rem; font-weight: 600; margin: 28px 0 8px; color: var(--ink); }
.legal p, .legal li, .legal dd { font-size: 1rem; line-height: 1.7; color: var(--ink-2); }
.legal ul { padding-left: 1.1em; margin: 8px 0; }
.legal a { color: var(--ink); text-decoration-color: var(--thread); text-underline-offset: 3px; }
.legal dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 24px; margin: 16px 0; }
.legal dt { color: var(--ink-3); font-size: .9375rem; }
.legal dd { margin: 0; color: var(--ink); }
.legal__meta { color: var(--ink-3); font-size: .9375rem; }
.legal__lang { display: flex; gap: 16px; margin: 20px 0 0; font-size: .9375rem; }
.legal__lang a { color: var(--ink-2); }
.legal section + section { margin-top: 96px; }
@media (max-width: 720px) {
  .legal { padding-top: 112px; }
  .legal dl { grid-template-columns: 1fr; gap: 2px; }
  .legal dd { margin-bottom: 10px; }
}
.footer__clocks { display: flex; gap: 20px; font-variant-numeric: tabular-nums; }
.footer__clocks time { color: var(--ink-2); }

/* ---------- Reel dialog ---------- */
.reel { border: 0; padding: 0; background: transparent; max-width: none; width: 100vw; height: 100vh; max-height: none; }
.reel::backdrop { background: rgba(8, 8, 9, .95); }
.reel[open] { display: grid; place-items: center; }
.reel__frame { width: min(92vw, 1400px); aspect-ratio: 16 / 9; background: #000; }
.reel__frame iframe, .reel__frame video { width: 100%; height: 100%; border: 0; display: block; }
.reel__close { position: fixed; top: 20px; right: 20px; width: 48px; height: 48px; display: grid; place-items: center; color: var(--ink); border: 1px solid rgba(242,239,234,.3); transition: border-color var(--t) ease; }
.reel__close:hover { border-color: var(--ink); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 8px); padding: 10px 16px; background: var(--ink); color: var(--bg); font-size: .875rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   Below 1025px the thread moves to the right margin and the
   two columns stack.
   ========================================================= */

/* ---------- Selected work: numbered index ---------- */
.selected { padding-top: calc(var(--section) * .6); }
.projects { margin-top: clamp(20px, 2.5vw, 32px); list-style: none; padding: 0; }
.project { border-top: 1px solid var(--line); }
.project:last-child { border-bottom: 1px solid var(--line); }
.project__link { padding: clamp(20px, 2.4vw, 34px) 0; color: inherit; text-decoration: none; align-items: center; }
.project__head { display: flex; justify-content: flex-end; align-items: baseline; gap: 18px; }
.project__no { font-family: var(--sans); font-size: .8125rem; letter-spacing: .08em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.project__client { font-size: clamp(1.625rem, 3.4vw, 3.25rem); line-height: 1.02; letter-spacing: .01em; text-wrap: balance; transition: color var(--t) ease, transform 500ms var(--ease-out); }
.project__meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 24px; align-items: baseline; }
.project__title { font-size: 1.125rem; color: var(--ink); }
.project__type { grid-row: 2; font-size: .9375rem; color: var(--ink-3); }
.project__watch { grid-row: 1 / span 2; grid-column: 2; align-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; color: var(--ink-2); padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; transition: background var(--t) ease, border-color var(--t) ease, color var(--t) ease; }
.project__link:hover .project__client, .project__link:focus-visible .project__client { color: var(--thread); }
.project__link:hover .project__watch, .project__link:focus-visible .project__watch { background: var(--cherry); border-color: var(--cherry); color: var(--ink); }
.project__link:focus-visible { outline: 1px solid var(--thread); outline-offset: 4px; }
.archive { margin-top: clamp(24px, 3vw, 40px); align-items: center; }
.archive__note { font-size: .9375rem; color: var(--ink-3); }
.archive__link { justify-self: start; display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--thread); padding-bottom: 4px; transition: color var(--t) ease; }
.archive__link:hover { color: var(--thread); }

/* ---------- Selected clients ---------- */
.clients { margin-bottom: clamp(40px, 5vw, 72px); }
.clients__list { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.875rem); line-height: 1.5; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
.client { white-space: nowrap; }
.client__sep { color: var(--thread); margin: 0 .55em; font-family: var(--sans); font-size: .7em; vertical-align: .12em; }
.worked { padding-top: calc(var(--section) * .75); }

@media (max-width: 1024px) {
  .project__head { justify-content: flex-start; margin-bottom: 10px; }
  .archive__note { margin-bottom: 14px; }
  .archive__link { justify-self: auto; }
}
@media (max-width: 720px) {
  .project__meta { column-gap: 14px; }
  .project__watch { padding: 7px 11px; font-size: .875rem; }
  .clients__list { font-size: 1.125rem; }
  .client__sep { margin: 0 .4em; }
}

@media (max-width: 1024px) {
  .pair { display: block; }
  .pair__l { text-align: left; }
  .pad { padding-right: calc(var(--gutter) + 28px); }
  .hero__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; }
  .item__title { margin-bottom: 12px; }
  .items--tight .item__title { margin-bottom: 8px; }
  .tag { margin-bottom: 8px; }
  .about .tag { margin-bottom: 20px; }
  .belief__line { margin-bottom: 28px; max-width: 11em; }
  .reelwrap { padding: 0; }
  .question { margin-top: 28px; }
  .contact .wrap { padding-right: calc(var(--gutter) + 28px); }
}
@media (max-width: 720px) {
  .nav { height: 64px; gap: 20px; }
  .nav__links { display: none; }
  .hero__inner { padding-top: 96px; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .hero__actions { gap: 20px; }
  .reelcard { aspect-ratio: 4 / 5; max-height: none; }
  .item__body, .about__body p, .belief__body { font-size: 1.0625rem; }
  .contact__list li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .footer__row { flex-wrap: wrap; }
}

/* ---------- Reduced motion: everything is simply there ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; transition-delay: 0ms !important; }
  .js .hero__media { clip-path: none; }
  .js .w__in { transform: none; }
  .js .hero__foot { opacity: 1; }
  .has-thread [data-lit] { opacity: 1; }
  .hero__video, .reelcard__video { display: none; }
}
