/* =========================================================
   Aigarai — base.css
   Shared reset, tokens, layout, components.
   Default token values = "Paper" direction (light editorial).
   looks.css overrides per [data-direction].
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  /* palette (Paper defaults) */
  --bg:        #f6f5f1;
  --fg:        #0c0c0c;
  --muted:     #6d6a62;
  --line:      rgba(12,12,12,0.14);
  --line-soft: rgba(12,12,12,0.08);
  --card:      #ffffff;
  --inverse-bg:#0c0c0c;
  --inverse-fg:#f6f5f1;
  --accent:    var(--fg);          /* monochrome by default */
  --accent-on: var(--inverse-fg);

  /* type */
  --display: "Bricolage Grotesque", "Space Grotesk", sans-serif;
  --body:    "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  /* layout */
  --pad: clamp(20px, 5vw, 84px);
  --maxw: 1320px;
  --r: 2px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rev-dur: 1100ms;
  --rev-dist: 26px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 600ms var(--ease), color 600ms var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
::selection { background: var(--fg); color: var(--bg); }

/* ---------- grain overlay ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9990; pointer-events: none;
  opacity: 0; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  transition: opacity 600ms var(--ease);
}
[data-grain="on"] .grain { opacity: 0.05; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 20px var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background 400ms var(--ease), border-color 400ms var(--ease), padding 400ms var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line-soft); padding-top: 14px; padding-bottom: 14px; }

.brand { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.mark { width: 26px; height: 26px; color: var(--fg); display: inline-block; }
.mark svg { width: 100%; height: 100%; }
.mark-ring, .mark .mark-fill { transform-origin: 50% 50%; }
.brand-word {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.nav-links { display: flex; gap: clamp(18px, 3vw, 40px); justify-self: center; }
.nav-links a {
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
  position: relative; padding: 4px 0; color: var(--muted);
  transition: color 250ms var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--fg); transform: scaleX(0); transform-origin: right;
  transition: transform 360ms var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-meta {
  justify-self: end; display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--muted); text-transform: uppercase;
}
.meta-coords { opacity: 0.8; }
.meta-clock { color: var(--fg); font-variant-numeric: tabular-nums; min-width: 8ch; text-align: right; }

@media (max-width: 760px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .nav-meta { justify-self: end; }
  .meta-coords { display: none; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--body); font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  padding: 15px 26px; border-radius: var(--r); cursor: pointer; border: 1px solid var(--fg);
  background: transparent; color: var(--fg); position: relative; overflow: hidden;
  transition: color 320ms var(--ease), border-color 320ms var(--ease), transform 220ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .arr { transition: transform 320ms var(--ease); }
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--fg);
  transform: translateY(101%); transition: transform 420ms var(--ease); z-index: -1;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary::before { background: var(--bg); }
.btn-primary:hover { color: var(--fg); }
.btn-ghost:hover { color: var(--bg); }
.btn:hover::before { transform: translateY(0); }
.btn:hover .arr { transform: translateX(5px); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; justify-content: center; }

/* =========================================================
   SECTION HEADERS
   ========================================================= */
section { padding-left: var(--pad); padding-right: var(--pad); }

.sec-head {
  display: flex; align-items: baseline; gap: 16px;
  padding-block: 26px; border-bottom: 1px solid var(--line);
  margin-bottom: clamp(40px, 6vw, 80px);
}
.sec-index { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.06em; }
.sec-label {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--fg);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 120px; padding-bottom: 48px; overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; max-width: var(--maxw); width: 100%; }

.watermark {
  position: absolute; z-index: 0; left: 50%; top: 56%;
  transform: translate(-50%, -50%); width: 120%; text-align: center;
  pointer-events: none; user-select: none;
}
.watermark span {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(120px, 26vw, 460px); line-height: 0.8;
  letter-spacing: -0.04em; color: var(--fg); opacity: 0.035;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--mono); font-size: clamp(12px, 1.3vw, 14px);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: clamp(24px, 4vw, 40px);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.hero-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(52px, 11.5vw, 184px); line-height: 0.92;
  letter-spacing: -0.035em; margin-bottom: clamp(28px, 4vw, 44px);
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-title .l-in { display: block; }
.accent-line .l-in { color: var(--accent); font-style: italic; font-weight: 500; }

.hero-sub {
  max-width: 46ch; font-size: clamp(17px, 1.9vw, 23px); line-height: 1.45;
  color: var(--muted); margin-bottom: clamp(34px, 5vw, 52px);
}
.hero-sub em { color: var(--fg); font-style: italic; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-foot {
  position: relative; z-index: 2; max-width: var(--maxw); width: 100%;
  margin-top: clamp(48px, 8vw, 96px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.scroll-hint { display: inline-flex; align-items: center; gap: 12px; }
.scroll-line {
  width: 40px; height: 1px; background: var(--fg); display: inline-block; transform-origin: left;
  animation: scrollline 2.4s var(--ease) infinite;
}
@keyframes scrollline { 0%,100% { transform: scaleX(0.3); opacity: 0.4; } 50% { transform: scaleX(1); opacity: 1; } }
@media (max-width: 600px) { .hero-foot-note { display: none; } }

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden; white-space: nowrap;
  padding-block: 22px; margin-block: 0;
}
.marquee-track {
  display: inline-flex; align-items: center; gap: 26px;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(26px, 4.5vw, 56px); letter-spacing: -0.01em;
  animation: marquee 28s linear infinite; will-change: transform;
}
.marquee-track .sep { color: var(--muted); font-weight: 300; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =========================================================
   ABOUT
   ========================================================= */
.about { padding-top: clamp(70px, 11vw, 150px); }
.about-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 90px);
  align-items: start; margin-bottom: clamp(64px, 9vw, 130px);
}
.about-statement {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(28px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -0.02em;
  text-wrap: balance;
}
.about-statement em { font-style: italic; color: var(--accent); }
.about-body { display: flex; flex-direction: column; gap: 22px; padding-top: 10px; }
.about-body p { font-size: clamp(15px, 1.5vw, 18px); color: var(--muted); line-height: 1.6; max-width: 42ch; }

.principles {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.principles li { padding: clamp(28px, 3.5vw, 44px) clamp(20px, 2.5vw, 36px) clamp(36px, 4vw, 56px) 0; border-top: 0; position: relative; }
.principles li + li { border-left: 1px solid var(--line); padding-left: clamp(20px, 2.5vw, 36px); }
.p-num { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.principles h3 {
  font-family: var(--display); font-weight: 600; font-size: clamp(20px, 2.4vw, 27px);
  letter-spacing: -0.015em; margin-top: 18px; margin-bottom: 12px;
}
.principles p { font-size: 15.5px; color: var(--muted); line-height: 1.55; max-width: 32ch; }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; border-top: 1px solid var(--line); }
  .principles li + li { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .principles li { padding-right: 0; }
}

/* =========================================================
   STUDIO / TEAM
   ========================================================= */
.studio { padding-top: clamp(70px, 11vw, 150px); }
.studio-intro {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 20px; margin-bottom: clamp(36px, 5vw, 60px);
}
.studio-intro h2 {
  font-family: var(--display); font-weight: 600; font-size: clamp(28px, 5vw, 56px);
  letter-spacing: -0.025em; line-height: 1.02; max-width: 16ch;
}
.studio-intro p { font-size: 15px; color: var(--muted); max-width: 30ch; }

.team-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 1.6vw, 22px);
  margin-bottom: clamp(48px, 7vw, 96px);
}
.team-card { display: flex; flex-direction: column; gap: 16px; }
.team-photo {
  width: 100%; aspect-ratio: 3 / 4; display: block;
  background: var(--card); border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.02);
}
.team-card figcaption { display: flex; flex-direction: column; gap: 3px; }
.t-name { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.t-role { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }

.team-card-join { justify-content: flex-start; }
.join-slot {
  width: 100%; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); color: var(--muted); font-size: 40px; font-weight: 200;
  font-family: var(--display); transition: border-color 300ms var(--ease), color 300ms var(--ease);
}
.team-card-join:hover .join-slot { border-color: var(--fg); color: var(--fg); }

.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fact { padding: clamp(22px, 2.6vw, 34px) 0; }
.fact + .fact { border-left: 1px solid var(--line); padding-left: clamp(18px, 2vw, 30px); }
.fact dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.fact dd { font-family: var(--display); font-weight: 600; font-size: clamp(17px, 1.7vw, 21px); letter-spacing: -0.01em; }

@media (max-width: 820px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact { padding-inline: 0; }
  .fact:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fact:nth-child(3), .fact:nth-child(4) { border-top: 1px solid var(--line); }
  .fact:nth-child(even) { padding-left: clamp(18px, 2vw, 30px); }
}
@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact { padding-top: clamp(70px, 11vw, 150px); padding-bottom: clamp(80px, 10vw, 150px); }
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: start;
}
.contact-title {
  font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.4vw, 60px);
  line-height: 1.02; letter-spacing: -0.025em; margin-bottom: 24px; text-wrap: balance;
}
.contact-lead { font-size: clamp(16px, 1.7vw, 19px); color: var(--muted); max-width: 36ch; margin-bottom: clamp(36px, 5vw, 56px); line-height: 1.5; }

.contact-details { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.detail { display: flex; gap: 20px; padding-block: 20px; border-bottom: 1px solid var(--line); align-items: baseline; }
.d-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); min-width: 84px; }
.d-value { font-size: 17px; line-height: 1.45; }
a.d-value { position: relative; }
a.d-value:hover { text-decoration: underline; text-underline-offset: 4px; }

/* form */
.contact-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  font-family: var(--body); font-size: 17px; color: var(--fg);
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  padding: 12px 2px; transition: border-color 280ms var(--ease);
  border-radius: 0; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--fg); }
.field.invalid input, .field.invalid textarea { border-bottom-color: #d23b3b; }
.err { font-family: var(--mono); font-size: 11.5px; color: #d23b3b; letter-spacing: 0.03em; height: 0; overflow: hidden; opacity: 0; transition: opacity 220ms, height 220ms; }
.field.invalid .err { height: 16px; opacity: 1; }
.contact-form .btn { margin-top: 8px; }
.form-success {
  font-size: 15px; color: var(--fg); line-height: 1.5; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
}

@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { padding: clamp(48px, 6vw, 80px) var(--pad) 40px; border-top: 1px solid var(--line); }
.footer-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-bottom: clamp(40px, 6vw, 70px); }
.brand-foot .brand-word { font-size: 24px; }
.footer-tag { font-family: var(--display); font-size: clamp(18px, 2.4vw, 28px); font-weight: 400; letter-spacing: -0.015em; color: var(--muted); max-width: 24ch; text-align: right; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 28px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em; color: var(--muted); text-transform: uppercase;
}
.footer-bottom a:hover { color: var(--fg); }
@media (max-width: 640px) { .footer-tag { text-align: left; } }

/* =========================================================
   REVEAL ANIMATIONS
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(var(--rev-dist)); transition: opacity var(--rev-dur) var(--ease), transform var(--rev-dur) var(--ease); }
  [data-reveal].in { opacity: 1; transform: none; }

  .hero-title .l-in { transform: translateY(110%); transition: transform var(--rev-dur) var(--ease); }
  .hero-title .line.in .l-in { transform: translateY(0); }
  .hero-title .line { opacity: 1; transform: none; } /* line is the clip mask */
}
/* reduced motion / no-JS fallback: everything visible */
[data-reveal] { will-change: opacity, transform; }
