/* ============================================================
   Koral Cohen — portfolio
   Two themes (dark default, light). Work carries the color.
   ============================================================ */
:root {
  --bg: #0c0c0c;
  --bg-2: #141414;
  --panel: #111111;
  --ink: #f3f2ee;
  --ink-2: #c9c8c2;
  --muted: #8a8984;
  --dim: #4d4c48;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --accent: #f3f2ee;
  --accent-ink: #0c0c0c;
  --grid: rgba(255, 255, 255, 0.05);
  --shadow: 0 40px 80px -28px rgba(0, 0, 0, .9);
  --lime: var(--ink);

  --sans: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 3.2vw, 44px);
  --max: 1360px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f1ec;
  --bg-2: #e9e8e2;
  --panel: #e6e5df;
  --ink: #121212;
  --ink-2: #3d3c39;
  --muted: #6f6e69;
  --dim: #a9a8a2;
  --line: rgba(0, 0, 0, 0.1);
  --line-2: rgba(0, 0, 0, 0.2);
  --accent: #121212;
  --accent-ink: #f2f1ec;
  --grid: rgba(0, 0, 0, 0.05);
  --shadow: 0 40px 80px -30px rgba(40, 30, 20, .45);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background .5s var(--ease), color .5s var(--ease); }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }
.wrap, .container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; }
.nav::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav__inner { position: relative; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.nav__logo { font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.nav__logo i, .nav__logo .dot { display: none; }
.nav__links { display: flex; gap: 28px; justify-self: center; }
.nav__links a { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); transition: color .2s; }
.nav__links a:hover, .nav__links a[aria-current] { color: var(--ink); }
.nav__right { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.nav__time { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.nav__cta { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.nav__cta:hover { text-decoration: underline; text-underline-offset: 4px; }
.theme-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-color .2s, transform .4s var(--ease); }
.theme-toggle:hover { border-color: var(--ink); transform: rotate(-20deg); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (max-width: 760px) { .nav__inner { grid-template-columns: 1fr auto; } .nav__links, .nav__time { display: none; } }

/* ---------- hero: name over a rotating band of work ---------- */
.hero { position: relative; height: min(100svh, 940px); min-height: 620px; overflow: hidden; display: grid; place-items: center; }
.band { position: absolute; inset: 0; z-index: 0; perspective: 780px; perspective-origin: 50% 50%; pointer-events: none; }
.band__ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transform: rotateX(4deg) rotateY(0deg); animation: spin 80s linear infinite; }
.band__ring > * { position: absolute; width: var(--w, 170px); aspect-ratio: var(--ar, 3/4); left: calc(var(--w, 170px) / -2); top: var(--y, -120px); transform: rotateY(var(--a)) translateZ(calc(var(--r, 560px) * -1)); border-radius: 12px; overflow: hidden; background: var(--panel); box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); backface-visibility: hidden; }
.band__ring img, .band__ring video { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@keyframes spin { to { transform: rotateX(4deg) rotateY(360deg); } }
.hero__fade { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 55% at 50% 50%, transparent 30%, var(--bg) 85%); pointer-events: none; }
.hero__content { position: relative; z-index: 3; transform: translateZ(0); text-align: center; padding: 0 var(--gutter); }
.hero h1 { margin: 0; font-weight: 500; letter-spacing: -0.055em; line-height: .9; font-size: clamp(3.4rem, 12vw, 11rem); text-shadow: 0 10px 60px color-mix(in srgb, var(--bg) 70%, transparent); }
.hero h1 span { display: inline-block; transform: translateY(40px); opacity: 0; animation: rise 1.2s var(--ease) .1s forwards; }
.hero__sub { position: absolute; z-index: 3; left: 0; right: 0; bottom: 44px; text-align: center; padding: 0 var(--gutter); opacity: 0; animation: fade 1s .6s forwards; }
.hero__sub p { margin: 0 auto; max-width: 46ch; font-size: clamp(1rem, 1.4vw, 1.12rem); color: var(--ink-2); }
.hero__sub strong { color: var(--ink); font-weight: 500; }
@keyframes rise { to { transform: none; opacity: 1; } }
@keyframes fade { to { opacity: 1; } }

/* ---------- section heads ---------- */
.head { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-top: clamp(90px, 12vw, 150px); padding-bottom: 28px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.head h2 { margin: 0; font-weight: 500; letter-spacing: -0.045em; line-height: 1; font-size: clamp(2.4rem, 5vw, 4.4rem); }
.head h2 sup { font-family: var(--mono); font-size: .28em; letter-spacing: 0; color: var(--muted); vertical-align: top; margin-left: 6px; }

/* ---------- work grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--line); }
.tile { display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px; }
.tile__meta { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 18px; align-items: baseline; padding: 18px 4px 6px; }
.tile__meta .num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tile__meta h3 { margin: 0; font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; }
.tile__meta .arrow { font-size: 1.1rem; transition: transform .4s var(--ease); }
.tile__meta p { grid-column: 2 / -1; margin: 0; color: var(--muted); font-size: .95rem; }
.tile:hover .tile__meta .arrow { transform: translate(4px, -4px); }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

/* media stage inside each tile */
.stage { position: relative; aspect-ratio: 4 / 3.1; border-radius: 14px; overflow: hidden; background: var(--panel); isolation: isolate; perspective: 1600px; }
.stage::before { content: attr(data-label); position: absolute; left: 14px; top: 12px; z-index: 3; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.stage::after { display: none; }
.stage > .glow { position: absolute; inset: -20%; z-index: -1; background: var(--glow, transparent); filter: blur(60px); opacity: .55; transition: opacity .6s; }
.tile:hover .stage > .glow { opacity: .85; }
.stage .browser { position: absolute; left: 9%; top: 15%; width: 74%; transition: transform .9s var(--ease); }
.stage .iphone { position: absolute; right: 8%; bottom: 6%; width: 21%; z-index: 2; transition: transform .9s var(--ease); }
.stage .browser.second { left: auto; right: 6%; top: 42%; width: 52%; z-index: 2; }
.tile:hover .stage .browser { transform: translateY(-6px); }
.tile:hover .stage .iphone { transform: translateY(-12px); }

/* three phones in a row */
.stage--videos, .stage--fan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5%; align-items: center; padding: 10% 13% 0; }
.stage--videos .vphone, .stage--fan .iphone { position: relative; inset: auto; width: 100%; transform: none; transition: transform .9s var(--ease); }
.stage--videos .vphone { height: auto; border-radius: 14% / 6.8%; box-shadow: var(--shadow); }
.stage--videos .mid, .stage--fan .p2 { transform: translateY(-7%); }
.tile:hover .stage--videos .vphone, .tile:hover .stage--fan .iphone { transform: translateY(-3%); }
.tile:hover .stage--videos .mid, .tile:hover .stage--fan .p2 { transform: translateY(-10%); }

/* device chrome */
.browser { background: #161616; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.08); }
:root[data-theme="light"] .browser { background: #fff; box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,.06); }
.browser__bar { display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; background: #1c1c1c; }
:root[data-theme="light"] .browser__bar { background: #f0efeb; }
.browser__bar i { width: 8px; height: 8px; border-radius: 50%; background: #3b3b3b; }
:root[data-theme="light"] .browser__bar i { background: #d3d1cb; }
.browser__bar b { margin: 0 auto; transform: translateX(-14px); font: 500 9px/1 var(--mono); letter-spacing: .04em; color: #7a7974; background: rgba(127,127,127,.15); padding: 4px 14px; border-radius: 5px; }
.iphone { position: relative; background: #070707; border-radius: 15% / 7.2%; padding: 3.2%; box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.12); }
.iphone::before { content: ""; position: absolute; top: 2.4%; left: 50%; transform: translateX(-50%); width: 30%; height: 2.6%; background: #070707; border-radius: 99px; z-index: 2; }
.iphone__screen { border-radius: 12% / 5.6%; overflow: hidden; background: #fff; aspect-ratio: 9 / 19.5; }
.iphone__screen img, .iphone__screen video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 96px); padding: 48px 0 0; }
.about__text p { margin: 0 0 18px; font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.45; letter-spacing: -0.01em; color: var(--ink-2); }
.about__text p strong { color: var(--ink); font-weight: 500; }
.about__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-content: start; }
.about__cols h4 { margin: 0 0 12px; }
.about__cols ul { list-style: none; margin: 0; padding: 0; }
.about__cols li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- experience ---------- */
.xp__row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 24px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); }
.xp__row h3 { margin: 0; font-size: 1.1rem; font-weight: 500; letter-spacing: -0.01em; }
.xp__row p { margin: 2px 0 0; color: var(--muted); }
@media (max-width: 720px) { .xp__row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- contact ---------- */
.contact { padding-top: clamp(90px, 12vw, 150px); padding-bottom: 56px; }
.contact__big { display: block; width: fit-content; font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-size: clamp(2.2rem, 7vw, 6.4rem); border-bottom: 2px solid var(--line-2); padding-bottom: 6px; transition: border-color .3s; }
.contact__big:hover { border-color: var(--ink); }
.contact__row { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.contact__row a:hover { color: var(--ink); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero h1 span, .hero__sub { opacity: 1; transform: none; animation: none; transition: none; }
  .band__ring { animation: none; }
}

/* hero legibility: dim the band a little, soft halo behind the name */
.band__ring > * { filter: brightness(.62) saturate(.9); }
:root[data-theme="light"] .band__ring > * { filter: brightness(.97) saturate(.9); }
.hero__content::before { content: ""; position: absolute; inset: -40% -10%; z-index: -1; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bg) 78%, transparent) 0%, transparent 65%); filter: blur(10px); }
.hero h1 { text-shadow: 0 4px 40px color-mix(in srgb, var(--bg) 85%, transparent); }

/* ============================================================
   v3: intro + project rows (wheel removed)
   ============================================================ */
.intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; min-height: min(92svh, 860px); padding-top: 110px; padding-bottom: 56px; }
.intro h1 { margin: 18px 0 20px; font-weight: 500; letter-spacing: -0.05em; line-height: .95; font-size: clamp(3rem, 7.2vw, 6.6rem); }
.intro p { margin: 0 0 32px; max-width: 46ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.intro p strong { color: var(--ink); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-size: 15px; font-weight: 500; transition: transform .2s var(--ease), background .2s, border-color .2s; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { border: 1px solid var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); }

.intro__thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.intro__thumbs a { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; transition: transform .6s var(--ease), border-color .3s; }
.intro__thumbs a:hover { transform: translateY(-4px); border-color: var(--line-2); }
.intro__thumbs .glow { position: absolute; inset: -20%; z-index: -1; background: var(--glow); filter: blur(40px); opacity: .6; transition: opacity .5s; }
.intro__thumbs a:hover .glow { opacity: .95; }
.intro__thumbs img { position: absolute; box-shadow: var(--shadow); transition: transform .8s var(--ease); }
.intro__thumbs img.ph { width: 44%; top: 16%; border-radius: 12px; }
.intro__thumbs img.wd { width: 82%; top: 22%; border-radius: 8px; }
.intro__thumbs a:hover img { transform: translateY(-6px); }
.intro__thumbs .mono { position: absolute; left: 12px; top: 10px; font-size: 10px; color: var(--ink-2); }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; min-height: 0; padding-top: 100px; } }

/* project rows: text left, gradient stage right */
.rows { border-top: 0; }
.project { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: clamp(28px, 4vw, 52px) 0; border-bottom: 1px solid var(--line); }
.project__meta h3 { margin: 10px 0 12px; font-size: clamp(1.7rem, 2.8vw, 2.5rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; }
.project__meta p { margin: 0 0 16px; color: var(--ink-2); max-width: 44ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.chips span { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted); }
.project__link { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.project__link i { font-style: normal; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background .3s, color .3s, transform .4s var(--ease); }
.project:hover .project__link i { background: var(--ink); color: var(--bg); transform: rotate(-45deg); }
.project .stage { aspect-ratio: 16 / 10.5; }
.project:hover .stage > .glow { opacity: .9; }
.project:hover .stage .browser { transform: translateY(-6px); }
.project:hover .stage .iphone { transform: translateY(-12px); }
.project:hover .stage--videos .vphone, .project:hover .stage--fan .iphone { transform: translateY(-3%); }
.project:hover .stage--videos .mid, .project:hover .stage--fan .p2 { transform: translateY(-10%); }
.stage--videos, .stage--fan { padding: 7% 16% 0; }
@media (max-width: 900px) { .project { grid-template-columns: 1fr; } .project .stage { order: -1; } }

/* contact: readable size */
.contact__big { font-size: clamp(1.5rem, 3.6vw, 2.8rem); letter-spacing: -0.03em; border-bottom-width: 1px; }

/* mobile nav: keep the toggle and contact visible */
@media (max-width: 760px) { .nav__right { gap: 12px; } }
.intro { min-height: min(80svh, 760px); padding-bottom: 24px; }
#work .head { padding-top: clamp(48px, 7vw, 96px); }
.nav__time { white-space: nowrap; }
@media (max-width: 1020px) { .nav__time { display: none; } }
