/* ============================================
   TOKENS
   ============================================ */
:root {
  --washi: #F3EFE6;
  --washi-2: #EAE3D3;
  --sumi: #211D19;
  --sumi-soft: #4A443C;
  --hanko: #B93A22;
  --hanko-soft: #E7C9BF;
  --moss: #5C6E52;
  --line: #D9D0BC;
  --paper-shadow: rgba(33, 29, 25, 0.08);

  --font-display: "Fraunces", serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --max-w: 1180px;
  --gutter: clamp(24px, 6vw, 88px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   DARK MODE TOKENS
   ============================================ */
:root[data-theme="dark"] {
  --washi: #1C1A17;
  --washi-2: #26221D;
  --sumi: #F1ECE2;
  --sumi-soft: #B7AE9F;
  --hanko: #E2543A;
  --hanko-soft: #4A2A22;
  --moss: #93A886;
  --line: #38342D;
  --paper-shadow: rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .grain {
  mix-blend-mode: overlay;
  opacity: 0.05;
}
:root {
  --header-bg: rgba(243, 239, 230, 0.85);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --header-bg: rgba(28, 26, 23, 0.85);
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
html {
  transition: background-color .25s var(--ease);
}
body, .site-header, section, .card, .btn {
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
   overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; color: var(--sumi); }
p { margin: 0 0 1em; color: var(--sumi-soft); }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* subtle paper grain */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  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");
}

/* ============================================
   HANKO SIGNATURE
   ============================================ */
.hanko rect {
  fill: none;
  stroke: var(--hanko);
  stroke-width: 3;
}
.hanko text {
  fill: var(--hanko);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}
.hanko--moss rect { stroke: var(--moss); }
.hanko--moss text { fill: var(--moss); }
.hanko--nav { transform: rotate(-4deg); }
.hanko--footer { transform: rotate(3deg); opacity: 0.8; }

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.mark { line-height: 0; }
.site-nav { display: flex; align-items: center; }
.nav-links {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 36px);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em;
}
.nav-links a { text-decoration: none; color: var(--sumi-soft); transition: color .2s var(--ease); }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--hanko); }
.nav-cta {
  border: 1px solid var(--sumi); border-radius: 999px;
  padding: 8px 16px; color: var(--sumi) !important;
}
.nav-cta:hover { background: var(--sumi); color: var(--washi) !important; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--sumi); display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--washi); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s var(--ease);
  }
  .nav-links.is-open { max-height: 320px; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 16px var(--gutter); width: 100%; border-bottom: 1px solid var(--line); }
  .nav-cta { border-radius: 0; border: none; }
}

/* ============================================
   LAYOUT HELPERS
   ============================================ */
section {
  padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(16px, 2vw, 28px);
  max-width: var(--max-w); margin: 0 auto;
}
.hero { padding-top: clamp(72px, 14vw, 160px); padding-bottom: clamp(48px, 6vw, 80px); }
.contact { padding-bottom: clamp(72px, 10vw, 120px); }
.section-head { margin-bottom: clamp(40px, 6vw, 72px); max-width: 760px; }
.section-num {
  display: inline-block; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--hanko);
  margin-bottom: 14px;
}
.section-head h2, .contact h2 {
  font-size: clamp(28px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -0.01em;
}

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 14px;
  padding: 14px 26px; border-radius: 999px; text-decoration: none;
  transition: all .25s var(--ease); border: 1px solid transparent;
}
.btn--primary { background: var(--sumi); color: var(--washi); }
.btn--primary:hover { background: var(--hanko); }
.btn--ghost { border-color: var(--sumi); color: var(--sumi); }
.btn--ghost:hover { border-color: var(--hanko); color: var(--hanko); }
.btn--plain { border-color: transparent; padding-left: 4px; padding-right: 4px; }
.btn--plain:hover { border-color: transparent; color: var(--hanko); background: transparent; }

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: none; color: var(--sumi);
  cursor: pointer; margin-right: 14px; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--hanko); color: var(--hanko); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--moon { display: block; }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding-top: clamp(72px, 14vw, 160px);
  padding-bottom: clamp(56px, 8vw, 100px);
}
.eyebrow {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--moss); text-transform: uppercase; margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(40px, 8vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero-title__en {
  display: block; font-style: italic; font-weight: 400; color: var(--hanko);
}
.hero-title__es {
  display: block; font-weight: 500;
}
.hero-sub {
  max-width: 46ch; font-size: 19px; margin-top: 28px; color: var(--sumi-soft);
}
.hero-actions { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 56px; font-family: var(--font-mono); font-size: 13px;
  color: var(--sumi-soft); display: flex; gap: 10px; flex-wrap: wrap;
}
.hero-meta .dot { color: var(--hanko); }

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(32px, 6vw, 80px);
}
.about-copy p { font-size: 17px; max-width: 62ch; }
.about-copy strong { color: var(--sumi); font-weight: 600; }

.about-side { border-left: 1px solid var(--line); padding-left: clamp(20px, 3vw, 36px); }
.side-block { margin-bottom: 32px; }
.side-label {
  display: block; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--hanko); margin-bottom: 12px;
}
.side-block ul li {
  font-size: 14.5px; color: var(--sumi-soft); padding: 7px 0;
  border-top: 1px solid var(--line);
}
.side-block ul li:first-child { border-top: none; }

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

/* ============================================
   WORK / PROJECTS
   ============================================ */
.project {
  position: relative;
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px 28px;
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project-stamp { grid-row: 1 / span 3; }
.project-meta { grid-column: 2; display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.project-tag {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.03em;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--sumi-soft);
}
.project h3 { grid-column: 2; font-size: clamp(24px, 3vw, 32px); margin-bottom: 6px; }
.project-role {
  grid-column: 2; font-family: var(--font-mono); font-size: 13px; color: var(--moss); margin-bottom: 18px;
}
.project > p { grid-column: 2; max-width: 68ch; }
.project-facts {
  grid-column: 2; display: flex; gap: 10px 24px; flex-wrap: wrap; margin-top: 12px;
}
.project-facts li {
  font-size: 13.5px; color: var(--sumi); font-family: var(--font-mono);
  padding-left: 16px; position: relative;
}
.project-facts li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; background: var(--hanko); border-radius: 50%;
}
.project--lateral .project-facts li::before { background: var(--moss); }

@media (max-width: 640px) {
  .project { grid-template-columns: 1fr; }
  .project-stamp { grid-row: auto; margin-bottom: 16px; }
  .project-meta, .project h3, .project-role, .project > p, .project-facts { grid-column: 1; }
}

/* ============================================
   WRITING
   ============================================ */
.writing-intro { max-width: 56ch; font-size: 17px; }
.writing-list { border-top: 1px solid var(--line); }
.writing-item {
  display: grid; grid-template-columns: 100px 1fr 30px; align-items: center; gap: 20px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; transition: padding-left .25s var(--ease), color .25s var(--ease);
}
.writing-item:hover { padding-left: 12px; color: var(--hanko); }
.writing-item__label {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--moss);
}
.writing-item__title { font-family: var(--font-display); font-size: 20px; }
.writing-item__arrow { font-size: 20px; justify-self: end; }
.writing-note {
  margin-top: 24px; font-family: var(--font-mono); font-size: 13px;
  color: var(--sumi-soft); font-style: italic;
}

@media (max-width: 560px) {
  .writing-item { grid-template-columns: 1fr 24px; }
  .writing-item__label { grid-column: 1 / -1; }
}

/* ============================================
   CONTACT
   ============================================ */
.contact { text-align: left; position: relative; background: var(--washi-2); padding-top: clamp(72px, 10vw, 120px); } .contact::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: var(--washi-2); z-index: -1; border-top: 1px solid var(--line); }

.contact-inner { max-width: 640px; }
.contact h2 { margin-bottom: 20px; }
.contact p { font-size: 17px; max-width: 52ch; }
.contact-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }

/* ============================================
   PROJECT TEASER CARDS (on landing)
   ============================================ */
.project-card {
  display: grid; grid-template-columns: 60px 1fr auto; align-items: center;
  gap: 20px 28px; padding: clamp(28px, 4vw, 40px) 0;
  border-top: 1px solid var(--line); text-decoration: none;
  transition: padding-left .3s var(--ease);
}
.project-card:last-child { border-bottom: 1px solid var(--line); }
.project-card:hover { padding-left: 12px; }
.project-card:hover .project-card__title { color: var(--hanko); }
.project-card__stamp { grid-row: 1 / span 2; }
.project-card__meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.project-card__title {
  font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px);
  color: var(--sumi); transition: color .25s var(--ease); grid-column: 2;
}
.project-card__sub {
  grid-column: 2; font-size: 14.5px; color: var(--sumi-soft); margin-top: 6px; max-width: 56ch;
}
.project-card__arrow {
  grid-column: 3; grid-row: 1 / span 2; font-family: var(--font-mono);
  font-size: 14px; color: var(--sumi-soft); white-space: nowrap;
}
@media (max-width: 640px) {
  .project-card { grid-template-columns: 1fr; }
  .project-card__stamp { grid-row: auto; margin-bottom: 14px; }
  .project-card__title, .project-card__sub, .project-card__arrow { grid-column: 1; }
  .project-card__arrow { margin-top: 10px; display: block; }
}

/* ============================================
   CASE STUDY PAGES
   ============================================ */
.case-header {
  padding: clamp(28px, 5vw, 48px) var(--gutter) 0; max-width: var(--max-w); margin: 0 auto;
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; color: var(--sumi-soft);
  text-decoration: none; margin-bottom: clamp(28px, 5vw, 48px);
}
.back-link:hover { color: var(--hanko); }

.case-hero {
  padding: 0 var(--gutter) clamp(48px, 7vw, 80px); max-width: var(--max-w); margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.case-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.case-hero h1 {
  font-size: clamp(34px, 5.5vw, 58px); line-height: 1.08; letter-spacing: -0.01em; max-width: 20ch;
}
.case-hero__sub {
  font-size: 18px; max-width: 56ch; margin-top: 20px; color: var(--sumi-soft);
}
.case-hero__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px; margin-top: clamp(32px, 5vw, 48px); max-width: 720px;
}
.case-fact__label {
  display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--hanko); margin-bottom: 6px;
}
.case-fact__value { font-size: 15px; color: var(--sumi); }

.case-note {
  margin-top: clamp(28px, 4vw, 40px); padding: 18px 22px; background: var(--washi-2);
  border-left: 3px solid var(--moss); border-radius: 2px; max-width: 640px;
}
.case-note p { margin: 0; font-size: 14px; color: var(--sumi-soft); }

.case-section {
  padding: clamp(48px, 7vw, 80px) var(--gutter); max-width: var(--max-w); margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.case-section:last-of-type { border-bottom: none; }
.case-section h2 {
  font-size: clamp(24px, 3vw, 34px); margin-bottom: 24px; max-width: 46ch;
}
.case-section > p { max-width: 66ch; font-size: 17px; }

.process-steps { counter-reset: step; margin-top: 32px; }
.process-step {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.process-step:first-child { border-top: none; }
.process-step__num {
  counter-increment: step; font-family: var(--font-mono); font-size: 13px; color: var(--hanko);
}
.process-step__num::before { content: "0" counter(step); }
.process-step h3 { font-size: 19px; font-weight: 600; font-family: var(--font-body); margin-bottom: 8px; }
.process-step p { font-size: 15.5px; max-width: 60ch; margin: 0; }

.decisions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; margin-top: 28px; }
.decision-card { border-top: 2px solid var(--hanko); padding-top: 16px; }
.decision-card h3 { font-size: 17px; font-family: var(--font-body); font-weight: 600; margin-bottom: 10px; }
.decision-card p { font-size: 14.5px; margin: 0; }

.reflection-box { max-width: 66ch; }
.reflection-box p { font-size: 17px; }

.img-placeholder {
  border: 1.5px dashed var(--line); border-radius: 6px;
  padding: 48px 24px; text-align: center; margin-top: 28px;
  background: var(--washi-2);
}
.img-placeholder p {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--sumi-soft);
  margin: 0; max-width: 40ch; margin: 0 auto;
}

.case-nav {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;
  padding: clamp(40px, 6vw, 64px) var(--gutter); max-width: var(--max-w); margin: 0 auto;
}
.case-nav a {
  font-family: var(--font-mono); font-size: 13px; text-decoration: none; color: var(--sumi-soft);
}
.case-nav a:hover { color: var(--hanko); }
.case-nav .next-project { text-align: right; }
.case-nav .next-project .project-name { display: block; font-family: var(--font-display); font-size: 20px; color: var(--sumi); margin-top: 6px; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  display: flex; align-items: center; gap: 14px;
  padding: 36px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--sumi-soft);
}
