/* ============ TOKENS ============ */
/* test */
:root {
  --bg: #f6f3ee;
  --ink: #141414;
  --muted: #5d5a55;
  --line: #e2ddd4;
  --card: #ffffff;
  --blue: #2f5bff;
  --red: #ff4d3d;
  --yellow: #ffc83d;
  --green: #22b573;
  --accent: var(--blue);
  --radius: 22px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1; margin: 0; letter-spacing: -0.03em; }
em { font-style: italic; color: var(--accent); }
::selection { background: var(--yellow); color: var(--ink); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  border: 2px solid var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn:hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--ink); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: transparent; }
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--dark:hover { box-shadow: 4px 4px 0 var(--accent); }

/* ============ ANNOUNCEMENT TICKER ============ */
.ticker {
  position: relative; display: flex; align-items: center;
  background: var(--ink); color: var(--bg);
  height: 44px;
  font-family: var(--font-mono); font-size: .82rem; text-transform: uppercase; letter-spacing: .02em;
}
.ticker.hidden { display: none; }
.ticker__viewport { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker__track { display: inline-flex; gap: 22px; align-items: center; animation: marquee 30s linear infinite; padding-right: 22px; }
.ticker__track b { color: var(--red); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }
.ticker__close {
  flex: none; width: 48px; height: 44px;
  background: var(--ink); color: var(--bg); border: 0; cursor: pointer; font-size: .9rem;
  position: relative;
}
.ticker__close::before {
  content: ""; position: absolute; right: 100%; top: 0; bottom: 0; width: 28px;
  background: linear-gradient(to right, transparent, var(--ink));
  pointer-events: none;
}
.ticker__close:hover { color: var(--red); }

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 60;
  padding: 8px clamp(8px, 2vw, 24px);
  margin-bottom: -68px; /* overlay the hero so the photo shows through */
  background: transparent;
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 6px 0 clamp(16px, 2vw, 24px);
  background: transparent;
  border: 1.5px solid var(--red);
  border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color .35s, backdrop-filter .35s;
}
/* while the hero photo is on screen: fully transparent, no stroke */
.nav.on-hero .nav__inner { border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
/* while the photo sits directly behind the bar: white logo + toggle */
.nav.over-photo .nav__logo { color: #fff; }
.nav.over-photo .nav__toggle { border-color: rgba(255,255,255,.75); }
.nav.over-photo .nav__toggle span { background: #fff; }
.nav__logo {
  font-family: "Caveat", cursive; font-weight: 700;
  font-size: 2.4rem; line-height: 1; letter-spacing: 0;
  color: var(--red);
  display: inline-flex; align-items: flex-start;
  transition: transform .3s var(--ease), color .35s;
}
.nav__logo:hover { transform: rotate(-4deg); }
.nav__logo-mark { font-size: .9rem; margin-left: 2px; display: inline-block; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav__toggle {
  position: relative; z-index: 80;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1.5px solid var(--red); border-radius: 50%;
  cursor: pointer;
  transition: border-color .3s, transform .3s var(--ease);
}
.nav__toggle:hover { transform: rotate(90deg); }
.nav__toggle[aria-expanded="true"] { border-color: var(--bg); }
.nav__toggle span {
  display: block; height: 1.5px; width: 20px; border-radius: 2px;
  background: var(--red);
  transition: transform .4s var(--ease), opacity .3s, width .3s var(--ease), background .3s;
}
.nav__toggle span:nth-child(2) { width: 14px; }
.nav__toggle[aria-expanded="true"] span { background: var(--bg); width: 20px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============ FULL-SCREEN MENU ============ */
.menu {
  position: fixed; inset: 0; z-index: 70;
  background: var(--ink); color: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 140px clamp(16px, 5vw, 64px) 40px;
  clip-path: circle(0 at calc(100% - 46px) 34px);
  visibility: hidden;
  transition: clip-path .7s var(--ease), visibility 0s .7s;
}
.menu.open { clip-path: circle(150% at calc(100% - 46px) 34px); visibility: visible; transition: clip-path .7s var(--ease); }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  display: flex; align-items: baseline; gap: 18px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3rem, 11vw, 7.5rem); line-height: 1.05; letter-spacing: -0.04em;
  opacity: 0; transform: translateY(40px);
  transition: color .25s, opacity .5s var(--ease), transform .6s var(--ease);
}
.menu__links a small { font-family: var(--font-mono); font-size: .85rem; font-weight: 500; letter-spacing: 0; color: #8d887f; }
.menu__links a:hover { color: var(--red); font-style: italic; }
.menu.open .menu__links a { opacity: 1; transform: none; }
.menu.open .menu__links a:nth-child(1) { transition-delay: .15s; }
.menu.open .menu__links a:nth-child(2) { transition-delay: .22s; }
.menu.open .menu__links a:nth-child(3) { transition-delay: .29s; }
.menu.open .menu__links a:nth-child(4) { transition-delay: .36s; }
.menu__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-top: 1px solid #2e2e2e; padding-top: 24px; }
.menu__email { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.menu__email:hover, .menu__social a:hover { color: var(--yellow); }
.menu__social { display: flex; flex-wrap: wrap; gap: 20px; font-family: var(--font-mono); font-size: .9rem; }
body.menu-open { overflow: hidden; }
body.menu-open .nav { z-index: 90; }
body.menu-open .nav .nav__logo { color: var(--red); }
body.menu-open .nav__inner { border-color: rgba(246,243,238,.25); backdrop-filter: none; }

/* ============ HERO ============ */
/* --p (0 → 1) is set by script.js as the hero scrolls past */
.hero { --p: 0; position: relative; height: 200vh; height: 200svh; }
.hero__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
}
.hero__frame {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--ink);
  /* shrink + round corners as --p grows */
  clip-path: inset(calc(var(--p) * 12%) calc(var(--p) * 14%) round calc(var(--p) * 48px));
  will-change: clip-path;
}
.hero__img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 49% 45%;
  /* parallax: image drifts slower than the frame and zooms out slightly */
  transform: translateY(calc(var(--p) * 8%)) scale(calc(1.15 - var(--p) * 0.12));
  will-change: transform;
}
.hero__overlay {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding-bottom: clamp(32px, 7vh, 72px);
  color: #fff;
  background:
    linear-gradient(to bottom, rgba(10,10,10,.4) 0%, transparent 16%),
    linear-gradient(to top, rgba(10,10,10,.8) 0%, rgba(10,10,10,.45) 45%, transparent 78%);
  opacity: calc(1 - var(--p) * 2.2);
  transform: translateY(calc(var(--p) * -60px));
}
.hero__overlay em { color: var(--yellow); }
.hero__overlay .container { min-width: 0; }
@media (max-width: 600px) {
  .hero__img { object-position: 52% 40%; }
}

.hero__eyebrow {
  display: inline-block;
  font-family: "Caveat", cursive; font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1;
  color: var(--yellow);
  transform: rotate(-4deg); transform-origin: left;
  text-shadow: 0 2px 14px rgba(0,0,0,.7);
  margin: 0 0 14px;
}

/* ---- hero copy as a JSON object ---- */
.json {
  font-family: var(--font-mono);
  font-size: clamp(.9rem, 1.4vw, 1.08rem);
  line-height: 1.7;
  counter-reset: ln;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
  max-width: 780px;
  --gutter: 2.6rem;   /* line-number column (rem so it doesn't scale with the title) */
  --indent: 1.3rem;   /* one indent level */
}
.json__line {
  position: relative; margin: 0;
  padding-left: var(--gutter);
  text-indent: 0;
  font-weight: 500;
}
.json__line::before {
  counter-increment: ln; content: counter(ln);
  position: absolute; left: 0; top: 0;
  width: 1.4rem; text-align: right;
  font-size: .8rem; line-height: inherit;
  color: rgba(255,255,255,.35);
}
.json__line--in { padding-left: calc(var(--gutter) + var(--indent)); }
.j-k { color: #9ec5ff; }                  /* keys */
.j-s { color: #f3efe6; }                  /* strings */
.j-s--hl { color: var(--yellow); }        /* highlighted value */
.j-p { color: rgba(255,255,255,.55); }    /* punctuation */

.json__title {
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 4.6vw, 3.4rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.15;
  margin: .1em 0;
}
.json__title::before { font-size: .8rem; letter-spacing: 0; top: 50%; transform: translateY(-50%); }
.json__title .j-k { color: rgba(158,197,255,.85); }

.json__cta { margin-top: .5em; }
.json__btn, .json__link { transition: background .25s, color .25s; border-radius: 6px; }
.json__btn {
  display: inline-block; padding: 1px 8px; margin-left: 2px;
  background: var(--yellow); color: var(--ink); text-shadow: none;
}
.json__btn:hover { background: #fff; }
.json__link { text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 4px; }
.json__link:hover { color: var(--yellow); text-decoration-color: var(--yellow); }

.json__caret {
  display: inline-block; width: .55em; height: 1.1em; margin-left: 4px;
  vertical-align: -0.2em; background: var(--yellow);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--primary:hover, .btn--light:hover { box-shadow: 4px 4px 0 var(--yellow); }

.hero__scroll {
  position: absolute; right: 24px; bottom: 24px; z-index: 2;
  font-family: var(--font-mono); font-size: .8rem; color: #fff;
  opacity: calc(1 - var(--p) * 4);
  animation: float 2.4s ease-in-out infinite;
}
@keyframes float { 50% { translate: 0 -6px; } }
@media (max-width: 600px) { .hero__scroll { display: none; } }

/* ============ INTRO ============ */
.intro { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 96px 0; }
.intro__headline { font-size: clamp(2.4rem, 7vw, 5.6rem); font-weight: 800; max-width: 16ch; }
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58%); }
.intro__grid { display: grid; gap: 24px; margin: 48px 0 40px; color: var(--muted); font-size: 1.1rem; }
@media (min-width: 768px) { .intro__grid { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* ============ SKILLS ============ */
.skills { padding-top: 96px; padding-bottom: 96px; }
.section-label {
  font-family: var(--font-mono); font-size: .85rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 20px;
}
.section-label--light { color: #a9a49b; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 56px; }
.chips li {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 2rem);
  padding: 10px 24px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--card);
  transition: background .25s, color .25s, transform .25s var(--ease);
  cursor: default;
}
.chips li:nth-child(4n+1):hover { background: var(--blue); color: #fff; }
.chips li:nth-child(4n+2):hover { background: var(--red); color: #fff; }
.chips li:nth-child(4n+3):hover { background: var(--yellow); }
.chips li:nth-child(4n+4):hover { background: var(--green); color: #fff; }
.chips li:hover { transform: rotate(-3deg); }
.stack { display: flex; flex-wrap: wrap; gap: 10px; }
.stack li {
  font-family: var(--font-mono); font-size: .9rem;
  padding: 8px 14px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
}

/* ============ SECTION HEAD ============ */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 32px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 800; }
.section-head p { color: var(--muted); margin: 0; max-width: 32ch; }

/* ============ WORK ============ */
.work { padding: 96px 0; border-top: 1px solid var(--line); }
.work__grid { display: grid; gap: 20px; }
@media (min-width: 768px) { .work__grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
.project {
  --c: var(--blue);
  position: relative; display: flex; flex-direction: column;
  padding: 28px; min-height: 300px;
  background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius);
  overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .35s;
}
.project::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--c);
  transform: translateY(101%);
  transition: transform .45s var(--ease);
}
.project:hover { transform: translate(-4px, -4px); box-shadow: 8px 8px 0 var(--ink); }
.project:hover::before { transform: translateY(0); }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: auto; padding-bottom: 48px; }
.project__num { font-family: var(--font-mono); font-size: .9rem; }
.project__arrow {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--ink); font-size: 1.2rem;
  background: var(--card); transition: transform .35s var(--ease);
}
.project:hover .project__arrow { transform: rotate(45deg); }
.project h3 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 12px; }
.project p { margin: 0 0 20px; color: var(--muted); transition: color .35s; }
.project:hover p { color: inherit; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-family: var(--font-mono); font-size: .78rem; padding: 4px 10px; border: 1.5px solid currentColor; border-radius: 999px; }

/* ============ FAQ ============ */
.faq { padding-top: 96px; padding-bottom: 96px; }
.faq__list { border-top: 2px solid var(--ink); }
.faq__item { border-bottom: 2px solid var(--ink); }
.faq__item summary {
  display: flex; align-items: center; gap: 20px;
  padding: 26px 0; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 2rem); letter-spacing: -0.02em;
  transition: color .25s;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__num { font-family: var(--font-mono); font-size: .9rem; font-weight: 500; color: var(--muted); }
.faq__item summary i {
  margin-left: auto; flex: none; position: relative; width: 22px; height: 22px;
}
.faq__item summary i::before, .faq__item summary i::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 2.5px;
  background: currentColor; border-radius: 2px; transition: transform .3s var(--ease);
}
.faq__item summary i::after { transform: rotate(90deg); }
.faq__item[open] summary i::after { transform: rotate(0deg); }
.faq__item p { margin: 0; padding: 0 0 28px 48px; color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
@media (max-width: 600px) { .faq__item p { padding-left: 0; } }

/* ============ CONTACT ============ */
.contact { background: var(--ink); color: var(--bg); padding: 120px 0; }
.contact__title { font-size: clamp(3rem, 11vw, 8.5rem); font-weight: 800; margin-bottom: 48px; }
.contact__title em { color: var(--yellow); }
.contact__mail { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 48px; }
.contact__email {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.3rem, 4.4vw, 2.6rem);
  border-bottom: 3px solid var(--blue);
  word-break: break-all;
  transition: color .25s;
}
.contact__email:hover { color: var(--yellow); }
.copy-btn {
  font: 600 .9rem var(--font-mono);
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: var(--yellow); color: var(--ink); border: 0;
  transition: transform .2s var(--ease);
}
.copy-btn:hover { transform: scale(1.06); }
.contact__social { display: flex; flex-wrap: wrap; gap: 12px; }
.contact__social a {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid #3a3a3a; transition: all .25s var(--ease);
}
.contact__social a:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* ============ FOOTER ============ */
.footer { background: var(--ink); color: #a9a49b; border-top: 1px solid #2a2a2a; padding: 48px 0 32px; }
.footer .nav__logo { color: var(--red); }
.footer__inner { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer__inner { grid-template-columns: 1fr auto; } }
.footer__note { margin: 8px 0 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: 24px; align-items: start; }
.footer__links a:hover, .to-top:hover { color: var(--bg); }
.footer__bottom {
  grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 24px; border-top: 1px solid #2a2a2a; font-size: .9rem;
}

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 200%);
  visibility: hidden;
  background: var(--yellow); color: var(--ink);
  font-weight: 600; padding: 12px 22px; border-radius: 999px;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .4s var(--ease);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ============ REVEAL ============ */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero { height: auto; }
  .hero__sticky { position: relative; top: 0; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
