/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #F7F7F5;
  --ink: #111111;
  --ink-soft: #6B6B6B;
  --border: rgba(0,0,0,0.08);
  --accent: #1F4B3C;
  --accent-bright: #2E6E57;
  --surface: #EFEFEA;

  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --edge: clamp(24px, 6vw, 96px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h: 84px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: default;
}

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

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus { left: 16px; top: 16px; }

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

/* ============================================================
   GRAIN / AMBIENT BACKGROUND
   ============================================================ */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   CUSTOM CURSOR (desktop only)
   ============================================================ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 999;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--ink);
  transition: opacity 0.2s var(--ease-soft);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(17,17,17,0.35);
  transition: width 0.25s var(--ease-soft), height 0.25s var(--ease-soft),
              border-color 0.25s var(--ease-soft), opacity 0.2s var(--ease-soft),
              background 0.25s var(--ease-soft);
}
.cursor-ring.is-link { width: 52px; height: 52px; border-color: var(--accent); }
.cursor-ring.is-project {
  width: 84px; height: 84px;
  border-color: transparent;
  background: var(--accent);
}
.cursor-ring.is-project::after {
  content: "VIEW";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-family: var(--font-ui);
  font-weight: 500;
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}
body.using-mouse { cursor: none; }
body.using-mouse a, body.using-mouse button { cursor: none; }

/* ============================================================
   SCROLL PROGRESS
   ============================================================ */
.progress-track {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 998;
  background: transparent;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--edge);
  z-index: 100;
  background: transparent;
  transition: background 0.4s var(--ease-soft), border-color 0.4s var(--ease-soft), backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(247,247,245,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.nav-mark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 40px;
  font-size: 14px;
}
.nav-links a {
  position: relative;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 32px; height: 20px;
  position: relative;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-soft), opacity 0.3s;
}
.nav-toggle span:first-child { top: 4px; }
.nav-toggle span:last-child { bottom: 4px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-9px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 0 var(--edge);
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 40px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--nav-h) var(--edge) 0;
  overflow: hidden;
}

.hero-field {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(56vw, 620px);
  aspect-ratio: 1;
  z-index: 0;
  opacity: 0.9;
}
.hero-field svg { width: 100%; height: 100%; }

.hero-inner { position: relative; z-index: 2; max-width: 900px; }

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 28px;
}
.line-draw {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  animation: drawLine 0.9s var(--ease) 0.15s forwards;
}
@keyframes drawLine { to { transform: scaleX(1); } }
.eyebrow-text {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.45s forwards;
}

.hero-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 10vw, 128px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
}
.split-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(60%);
  animation: revealWord 1s var(--ease) forwards;
}
.split-word:nth-child(1) { animation-delay: 0.55s; }
.split-word:nth-child(2) { animation-delay: 0.68s; }
@keyframes revealWord {
  to { opacity: 1; transform: translateY(0); }
}

.hero-statement {
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(22px, 3.4vw, 38px);
  line-height: 1.25;
  color: var(--ink-soft);
  max-width: 14ch;
}
.hero-statement em {
  font-style: italic;
  color: var(--ink);
}
.split-line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.9s var(--ease) forwards;
}
.split-line:nth-child(1) { animation-delay: 0.95s; }
.split-line:nth-child(2) { animation-delay: 1.08s; }

.hero-meta {
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 1.3s forwards;
}
.hero-meta-divider {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-soft);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: var(--edge);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 1.6s forwards;
}
.scroll-cue-line {
  width: 1px; height: 30px;
  background: var(--ink-soft);
  position: relative;
  overflow: hidden;
}
.scroll-cue-line::after {
  content: "";
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--ink);
  animation: cueDrop 1.8s ease-in-out infinite;
}
@keyframes cueDrop {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ============================================================
   INTRO
   ============================================================ */
.intro {
  padding: clamp(100px, 16vw, 200px) var(--edge);
  max-width: 1000px;
}
.intro-statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.32;
  margin: 0 0 36px;
}
.intro-statement .word {
  color: rgba(17,17,17,0.18);
  transition: color 0.4s var(--ease-soft);
}
.intro-statement .word.is-lit { color: var(--ink); }

.intro-sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
}

/* ============================================================
   WORK
   ============================================================ */
.work {
  padding: clamp(60px, 10vw, 120px) var(--edge) clamp(40px, 8vw, 80px);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 clamp(40px, 8vw, 80px);
}

.project {
  position: relative;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: clamp(40px, 7vw, 72px) 0;
  border-top: 1px solid var(--border);
}
.project:last-child { border-bottom: 1px solid var(--border); }
.project-reverse { direction: rtl; }
.project-reverse > * { direction: ltr; }

.project-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.project-link-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}
.project-link-label svg { color: var(--accent); }
.project:hover .project-link-label { opacity: 1; transform: translateX(0); }

.project-index {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  transition: color 0.3s;
}
.project:hover .project-index { color: var(--accent); }

.project-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 46px);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.project-desc {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 22px;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.project-stack li { position: relative; }
.project-stack li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -12px; top: 50%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-soft);
  transform: translateY(-50%);
}

.project-visual {
  aspect-ratio: 4/3;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.project:hover .project-visual { transform: scale(1.015); }

.mock {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10%;
}

/* Syntap mock */
.mock-syntap .mock-card {
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  width: 68%;
  padding: 22px;
  transform: rotate(-2deg);
}
.mock-nfc {
  width: 30px; height: 30px;
  border: 1.5px solid var(--accent-bright);
  border-radius: 50%;
  margin-bottom: 16px;
  position: relative;
}
.mock-nfc::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1.5px solid var(--accent-bright);
  border-radius: 50%;
  opacity: 0.6;
}
.mock-bar { height: 8px; border-radius: 2px; background: rgba(255,255,255,0.16); margin-bottom: 8px; }
.mock-bar-lg { width: 90%; }
.mock-bar-sm { width: 55%; margin-bottom: 20px; }
.mock-pill {
  display: inline-block;
  font-size: 11px;
  background: var(--accent-bright);
  padding: 7px 14px;
  border-radius: 100px;
}

/* Spur mock */
.mock-spur {
  flex-direction: column;
  gap: 16px;
}
.mock-input {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  width: 80%;
}
.mock-input strong { color: var(--accent); }
.mock-arrow { color: var(--ink-soft); font-size: 14px; }
.mock-url-full {
  width: 60%; height: 6px;
  background: var(--border);
  border-radius: 4px;
}

/* Platen mock */
.mock-qr {
  width: 44%;
  aspect-ratio: 1;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 8%, transparent 8% 16%),
    repeating-linear-gradient(0deg, var(--ink) 0 8%, transparent 8% 16%);
  background-blend-mode: multiply;
  opacity: 0.88;
}

/* Social mock */
.mock-social {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.mock-post {
  width: 82%; height: 34px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.mock-post.short { width: 56%; }
.mock-vote {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: var(--accent);
  align-self: flex-end;
  margin-right: 18%;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: clamp(80px, 12vw, 160px) var(--edge);
  max-width: 900px;
}
.about-statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.25;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}
.about-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 0 64px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.stack-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.stack-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stack-items {
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 21px);
  transform: translateX(30px);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}
.stack-row.in-view .stack-items { transform: translateX(0); opacity: 1; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: clamp(80px, 14vw, 180px) var(--edge) clamp(60px, 10vw, 120px);
  max-width: 720px;
}
.contact-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5.6vw, 58px);
  margin: 0 0 56px;
  letter-spacing: -0.01em;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.field {
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.contact.in-view .field { opacity: 1; transform: translateY(0); }
.contact.in-view .field:nth-child(1) { transition-delay: 0.05s; }
.contact.in-view .field:nth-child(2) { transition-delay: 0.15s; }
.contact.in-view .field:nth-child(3) { transition-delay: 0.25s; }
.contact.in-view .field:nth-child(4) { transition-delay: 0.35s; }

.field input, .field textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 17px;
  color: var(--ink);
  padding: 10px 0 12px;
  resize: none;
}
.field input:focus, .field textarea:focus { outline: none; }

.field label {
  position: absolute;
  left: 0; top: 10px;
  font-size: 17px;
  color: var(--ink-soft);
  pointer-events: none;
  transition: transform 0.25s var(--ease-soft), font-size 0.25s var(--ease-soft), color 0.25s;
  transform-origin: left top;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input:valid:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-22px) scale(0.78);
  color: var(--ink);
}
.field input:required:invalid:not(:placeholder-shown) + label {
  color: #B5453A;
}

.field-line {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--border);
}
.field-line::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.field input:focus ~ .field-line::after,
.field textarea:focus ~ .field-line::after { transform: scaleX(1); }

.submit-btn {
  margin-top: 12px;
  align-self: flex-start;
  position: relative;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 16px 34px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 500;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.3s var(--ease-soft), transform 0.15s var(--ease-soft);
  will-change: transform;
}
.submit-btn:hover { background: var(--accent); }
.submit-btn span { display: inline-block; }

.form-status {
  font-size: 13px;
  color: var(--ink-soft);
  min-height: 18px;
  margin: 4px 0 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: clamp(48px, 8vw, 72px) var(--edge) 40px;
  border-top: 1px solid var(--border);
}
.footer-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 20px;
}
.footer-role {
  font-size: 13px;
  color: var(--ink-soft);
}
.footer-links {
  display: flex;
  gap: 28px;
  font-size: 13.5px;
  margin-bottom: 40px;
}
.footer-links a { position: relative; padding-bottom: 2px; }
.footer-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.footer-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.footer-bottom {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   SCROLL REVEAL (generic)
   ============================================================ */
[data-reveal-up] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal-up].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   THANK YOU PAGE
   ============================================================ */
.ty-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 6vw, 96px);
}
.ty-mark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
}
.ty-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 560px;
}
.ty-check {
  color: var(--accent);
  margin-bottom: 28px;
  opacity: 0;
  transform: scale(0.85);
  animation: tyPop 0.6s var(--ease) 0.1s forwards;
}
@keyframes tyPop {
  to { opacity: 1; transform: scale(1); }
}
.ty-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5.6vw, 56px);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s var(--ease) 0.25s forwards;
}
.ty-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 36px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s var(--ease) 0.4s forwards;
}
.ty-redirect {
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.55s forwards;
}
.ty-redirect a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.ty-redirect #tyCount {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .hero-field { width: 78vw; opacity: 0.6; right: -20%; }
  .project, .project-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .project-visual { order: -1; aspect-ratio: 16/10; }
  .stack-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 480px) {
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hero-meta-divider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}
