/* ============================================================
   SUI·AN 翠庵 — Oriental Zen Interior Studio
   Wabi-sabi restraint, ma (negative space), green + sky blue.
   Pure CSS, mobile-first, light + dark themes.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Foundation — washi paper, rice, stone, sumi ink */
  --paper:      #F5F2EA;   /* washi off-white, dominant surface */
  --rice:       #ECE7DA;   /* aged rice paper, secondary surface */
  --stone:      #D8D2C3;   /* warm grey-beige */
  --sumi:       #1C211E;   /* near-black ink with green undertone */
  --ink:        #1C211E;   /* alias, used widely */
  --ink-soft:   #4A524C;   /* secondary text */
  --warm-gray:  #807A6B;   /* tertiary labels */
  --hairline:   rgba(28, 33, 30, 0.12);
  --hairline-2: rgba(28, 33, 30, 0.06);
  --overlay:    rgba(28, 33, 30, 0.55);

  /* Primary accent — green (matcha, moss, bamboo) */
  --matcha:     #6B8E5A;   /* matcha tea, dominant accent */
  --moss-deep:  #3F5A3A;   /* depth, hover */
  --bamboo:     #8FA678;   /* mid-tone dividers */
  --tea-pale:   #C8D4B8;   /* tints, hover surfaces */

  /* Secondary accent — sky blue (asagi, sora, kasumi) */
  --asagi:      #7DA9C4;   /* asagi-iro, traditional sky blue */
  --sora:       #A8C8DA;   /* clear morning sky */
  --indigo-mist:#4C6B82;   /* deeper sky, sparingly */
  --kasumi:     #E1ECF2;   /* haze, large fills */

  /* Lacquer accents — ONE per page max each */
  --cinnabar:   #B04A3C;   /* document-seal red */
  --gold-leaf:  #B8956A;   /* kintsugi gold */

  /* Semantic state colours (functional, not motifs) */
  --error:      var(--cinnabar);

  /* Aliases used in original component code (kept for compatibility) */
  --cream:      var(--paper);
  --ivory:      var(--rice);
  --bone:       var(--stone);
  --graphite:   var(--ink-soft);
  --bronze:     var(--matcha);
  --bronze-dk:  var(--moss-deep);

  /* Typography */
  --font-display: "Shippori Mincho", "Noto Serif JP", "Cormorant Garamond", Georgia, serif;
  --font-body:    "Noto Sans JP", "Inter Tight", "Helvetica Neue", Helvetica, sans-serif;
  --font-brush:   "Klee One", "Shippori Mincho", serif;

  /* Type scale (clamp for fluid) — generous, unhurried */
  --fs-eyebrow: 0.74rem;
  --fs-body:    1.0rem;
  --fs-lede:    clamp(1.05rem, 0.95rem + 0.4vw, 1.22rem);
  --fs-h3:      clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem);
  --fs-h2:      clamp(2.2rem,  1.4rem + 3.4vw, 4.2rem);
  --fs-hero:    clamp(3rem,    1.4rem + 7.4vw, 8.4rem);

  /* Spacing (ma) */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;
  --s-6: 64px;
  --s-7: 96px;
  --s-8: 128px;
  --s-9: 192px;

  --maxw: 1280px;
  --radius: 0;

  /* Motion — "settling" curves, slow and inevitable */
  --ease:     cubic-bezier(.22, .61, .36, 1);     /* settle */
  --ease-out: cubic-bezier(.16, .84, .32, 1);     /* unfold */
  --dur-fast: .5s;
  --dur-med:  .8s;
  --dur-slow: 1.2s;

  color-scheme: light;
}

[data-theme="dark"] {
  --paper:      #161A18;
  --rice:       #1E2320;
  --stone:      #2A2F2C;
  --sumi:       #ECE7DA;
  --ink:        #ECE7DA;
  --ink-soft:   #B5BDB6;
  --warm-gray:  #828A82;
  --hairline:   rgba(236, 231, 218, 0.14);
  --hairline-2: rgba(236, 231, 218, 0.07);
  --overlay:    rgba(0, 0, 0, 0.62);

  --matcha:     #9CBE88;
  --moss-deep:  #B6CFA3;
  --bamboo:     #7E9670;
  --tea-pale:   #3A4536;

  --asagi:      #9EC3DB;
  --sora:       #B9D4E3;
  --indigo-mist:#7C9DB7;
  --kasumi:     #232E36;

  --cinnabar:   #C25A4D;
  --gold-leaf:  #C9A87E;
  --error:      var(--cinnabar);

  --cream:      var(--paper);
  --ivory:      var(--rice);
  --bone:       var(--stone);
  --graphite:   var(--ink-soft);
  --bronze:     var(--matcha);
  --bronze-dk:  var(--moss-deep);

  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.75;            /* unhurried reading */
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* Washi paper grain — atmospheric, not decorative */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 999;
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.035; }

/* Focus — matcha ring */
:focus-visible {
  outline: 2px solid var(--matcha);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; top: -100px; left: 12px;
  background: var(--sumi); color: var(--paper);
  padding: 10px 16px; z-index: 1000; font-size: .85rem;
  transition: top .35s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-3);
}
@media (min-width: 900px) {
  .container { padding: 0 var(--s-5); }
}

/* Eyebrow — small caps with kanji numeral marker */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--s-4);
}
.eyebrow .num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--matcha);
  line-height: 1;
}
.eyebrow .num::after {
  content: " —";
  color: var(--ink-soft);
  margin-left: 8px;
  font-family: var(--font-body);
  font-size: .85rem;
}
.eyebrow--light { color: rgba(255,255,255,0.86); }
.eyebrow--light .num { color: var(--tea-pale); }
.eyebrow--light .num::after { color: rgba(255,255,255,0.6); }
.eyebrow .hairline {
  display: inline-block;
  width: 44px; height: 1px;
  background: currentColor;
  opacity: .5;
}

/* Display headlines — Shippori Mincho, unhurried */
.display-2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.018em;
  max-width: 18ch;
  margin-bottom: var(--s-5);
  color: var(--ink);
}
.display-2 em {
  font-style: normal;
  font-weight: 400;
  color: var(--matcha);
  position: relative;
  padding: 0 0.04em;
}
/* Brush-underline reveal on em phrases (subtle, no hover required) */
.display-2 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.06em;
  height: 2px;
  background: var(--matcha);
  opacity: .22;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.4s var(--ease) .25s;
}
[data-animate].is-visible .display-2 em::after,
.display-2.is-visible em::after { transform: scaleX(1); }

.lede {
  font-size: var(--fs-lede);
  color: var(--ink-soft);
  max-width: 56ch;
  line-height: 1.85;
}
.lede em { font-style: italic; color: var(--ink); }

/* ---------- Section base ---------- */
section {
  padding: clamp(var(--s-7), 12vw, var(--s-9)) 0;
  position: relative;
}
.section-head { margin-bottom: var(--s-7); max-width: 60ch; }
.section-head--row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: var(--s-5); max-width: none;
}
.section-head--row > div { max-width: 40ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 30px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.btn--primary {
  background: var(--sumi);
  color: var(--paper);
  border-color: var(--sumi);
}
[data-theme="dark"] .btn--primary {
  background: var(--matcha);
  border-color: var(--matcha);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--matcha);
  border-color: var(--matcha);
}
[data-theme="dark"] .btn--primary:hover {
  background: var(--moss-deep);
  border-color: var(--moss-deep);
}
.btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: #fff;
}
.btn--full { width: 100%; }

/* ---------- HEADER / NAV ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 0;
  transition: background .5s var(--ease), padding .5s var(--ease), box-shadow .5s var(--ease);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  padding: 14px 0;
  box-shadow: 0 1px 0 var(--hairline);
}
.site-header.is-scrolled .primary-nav a,
.site-header.is-scrolled .brand,
.site-header.is-scrolled .theme-toggle,
.site-header.is-scrolled .menu-toggle span { color: var(--ink); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: #fff;
  transition: color .5s var(--ease);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--matcha);
  line-height: 1;
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-color: var(--matcha);
}
.site-header.is-scrolled .brand-mark { border-color: var(--matcha); }
.brand-word {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.primary-nav ul {
  display: flex; gap: var(--s-5);
}
.primary-nav a {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
  transition: color .5s var(--ease);
}
.primary-nav a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--matcha);
  transition: width .55s var(--ease);
}
.primary-nav a:hover::after { width: 100%; }

.nav-actions {
  display: flex; align-items: center; gap: var(--s-2);
}
.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  transition: color .5s var(--ease), border-color .5s var(--ease), background .5s var(--ease);
  position: relative;
}
.site-header.is-scrolled .theme-toggle { border-color: var(--hairline); }
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
.site-header.is-scrolled .theme-toggle:hover { background: var(--rice); }
.theme-toggle svg { position: absolute; transition: opacity .4s var(--ease), transform .4s var(--ease); }
[data-theme="light"] .theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(.6); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"]  .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"]  .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }

/* Mobile menu */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 22px; height: 1px;
  background: currentColor;
  transition: transform .35s var(--ease), opacity .35s var(--ease), background .5s var(--ease);
}
.menu-toggle { color: #fff; transition: color .5s var(--ease); }
.site-header.is-scrolled .menu-toggle,
.menu-open .menu-toggle { color: var(--ink); }
.menu-open .brand { color: var(--ink); }
.menu-open .theme-toggle { color: var(--ink); border-color: var(--hairline); }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 49;
  padding: 110px var(--s-4) var(--s-5);
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden;
  transition: opacity .55s var(--ease), visibility .55s;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu ol { display: flex; flex-direction: column; gap: var(--s-3); }
.mobile-menu li {
  display: flex; align-items: baseline; gap: 20px;
  border-bottom: 1px solid var(--hairline-2);
  padding-bottom: var(--s-3);
}
.mobile-menu .m-num {
  font-family: var(--font-display);
  color: var(--matcha);
  font-size: 1.2rem;
  font-weight: 500;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.mobile-foot {
  color: var(--ink-soft);
  font-size: 0.86rem;
  display: flex; justify-content: space-between;
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .menu-toggle { display: flex; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: var(--s-9) 0 var(--s-7);
  color: #fff;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  z-index: -1;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: kenburns 22s ease-out forwards;
  filter: saturate(0.78) contrast(1.02);
}
@keyframes kenburns {
  from { transform: scale(1.1); }
  to   { transform: scale(1.0); }
}
/* Sumi ink overlay — depth + legibility */
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(28,33,30,0.62) 0%, rgba(28,33,30,0.18) 40%, rgba(28,33,30,0.72) 100%);
}
/* Asagi mist wash — off-center sky-blue atmosphere, single soft moment */
.hero-mist {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 78% 28%, rgba(125,169,196,0.28), transparent 65%),
    radial-gradient(ellipse 50% 40% at 8% 88%, rgba(107,142,90,0.18), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 56rem; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-hero);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-4);
}
.hero-title .word {
  display: inline-block;
  overflow: hidden;
  margin-right: 0.2em;
  vertical-align: top;
}
.hero-title .word > span {
  display: inline-block;
  transform: translateY(120%);
  animation: wordRise 1.3s var(--ease-out) forwards;
}
.hero-title .word:nth-child(1) > span { animation-delay: .25s; }
.hero-title .word:nth-child(2) > span { animation-delay: .38s; }
.hero-title .word:nth-child(3) > span { animation-delay: .51s; }
.hero-title .word:nth-child(4) > span { animation-delay: .64s; }
.hero-title .word--italic > span {
  font-weight: 400;
  color: var(--tea-pale);
  font-style: italic;
  font-family: var(--font-display);
}
@keyframes wordRise {
  to { transform: translateY(0); }
}

/* Brush-stroke divider under the headline — draws in on load */
.brush-stroke {
  display: block;
  width: clamp(220px, 32vw, 460px);
  height: 22px;
  color: var(--matcha);
  margin: 0 0 var(--s-5);
  --len: 540;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: brushDraw 2.2s var(--ease-out) .9s forwards;
}
@keyframes brushDraw {
  to { stroke-dashoffset: 0; }
}

.hero-sub {
  font-size: var(--fs-lede);
  color: rgba(255,255,255,0.88);
  max-width: 48ch;
  margin-bottom: var(--s-5);
  line-height: 1.75;
}
.hero-sub em { font-style: italic; color: var(--tea-pale); }

.hero-ctas {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.hero-meta {
  display: flex; gap: var(--s-6); flex-wrap: wrap;
  padding-top: var(--s-3);
  border-top: 1px solid rgba(255,255,255,0.22);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}
.hero-meta .meta-k { display: block; opacity: .55; margin-bottom: 6px; font-weight: 500; }
.hero-meta .meta-v { color: #fff; letter-spacing: 0.1em; }

.scroll-cue {
  position: absolute;
  bottom: var(--s-3); right: var(--s-5);
  color: rgba(255,255,255,0.78);
  font-size: 0.68rem; letter-spacing: 0.32em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.scroll-cue .scroll-line {
  display: block; width: 1px; height: 60px;
  background: linear-gradient(to top, transparent, rgba(255,255,255,0.75));
  animation: cuePulse 2.6s var(--ease) infinite;
}
@keyframes cuePulse {
  0%   { transform: scaleY(0.25); transform-origin: top; opacity: .35; }
  50%  { transform: scaleY(1);    opacity: 1; }
  100% { transform: scaleY(0.25); transform-origin: bottom; opacity: .35; }
}
@media (max-width: 640px) {
  .scroll-cue { display: none; }
}

/* Vertical kanji rail — single quiet column on hero right edge */
.kanji-rail {
  position: absolute;
  top: 50%; left: var(--s-3);
  transform: translateY(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  font-family: var(--font-display);
  color: rgba(255,255,255,0.55);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  pointer-events: none;
}
.kanji-rail-line {
  display: block;
  width: 1px; height: 64px;
  background: rgba(255,255,255,0.35);
}
@media (max-width: 900px) { .kanji-rail { display: none; } }

/* Reveal helpers — hero entrance */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  animation: revealUp 1.1s var(--ease-out) forwards;
  animation-delay: var(--rd, .4s);
}
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }

/* ---------- ABOUT ---------- */
.about { position: relative; background: var(--paper); }

/* Kintsugi seam — one diagonal gold-leaf hairline, the page's single metallic gesture */
.kintsugi {
  position: absolute;
  top: 14%; left: -8%;
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-leaf) 30%, var(--gold-leaf) 70%, transparent);
  transform: rotate(-7deg);
  transform-origin: left center;
  opacity: 0.55;
  pointer-events: none;
}
.kintsugi::after {
  content: "";
  position: absolute;
  right: 14%; top: -3px;
  width: 7px; height: 7px;
  background: var(--gold-leaf);
  border-radius: 50%;
  opacity: 0.7;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  position: relative;
}
@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--s-8);
    align-items: end;
  }
}
.about-text { position: relative; }
.about-text .display-2 { margin-bottom: var(--s-4); max-width: 16ch; }

/* Enso circle — single open hand-drawn ring, anchor mark of the section */
.enso {
  width: clamp(160px, 18vw, 240px);
  height: clamp(160px, 18vw, 240px);
  color: var(--asagi);
  opacity: 0.28;
  margin: var(--s-4) 0 var(--s-5);
  --len: 620;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 2.6s var(--ease-out) .2s, opacity 1.2s var(--ease) .2s;
}
.enso.is-visible { stroke-dashoffset: 0; opacity: 0.34; }
[data-theme="dark"] .enso { opacity: 0.22; }
[data-theme="dark"] .enso.is-visible { opacity: 0.32; }

.signature {
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 4px;
}
.sig-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  font-weight: 500;
}
.sig-role {
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--warm-gray);
}

/* Stats — hairline grid, tatami proportions */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.stat {
  padding: var(--s-5) var(--s-3);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 10px;
  transition: background .55s var(--ease);
  position: relative;
}
.stat:hover { background: var(--rice); }
.stat::before {
  content: "";
  position: absolute;
  top: var(--s-3); right: var(--s-3);
  width: 6px; height: 6px;
  background: var(--matcha);
  opacity: 0;
  transition: opacity .55s var(--ease);
}
.stat:hover::before { opacity: 0.55; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.035em;
}
.stat-label {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- SERVICES ---------- */
/* Services lives on rice — secondary surface, sky-blue accent dominates here */
.services {
  background: var(--rice);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
/* Faint bamboo vertical hairlines as scaffold */
.services::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, transparent calc(38.2% - 1px), var(--hairline-2) 38.2%, transparent calc(38.2% + 1px)),
    linear-gradient(90deg, transparent calc(61.8% - 1px), var(--hairline-2) 61.8%, transparent calc(61.8% + 1px));
  pointer-events: none;
}
.services .container { position: relative; }

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
@media (min-width: 700px)  { .service-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .service-grid { grid-template-columns: repeat(4, 1fr); } }

.service-card {
  padding: var(--s-5) var(--s-4);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--rice);
  position: relative;
  transition: background .7s var(--ease), transform .7s var(--ease);
  display: flex; flex-direction: column; gap: var(--s-3);
  min-height: 360px;
}
.service-card:hover {
  background: var(--paper);
  transform: translateY(-4px);
}
.service-icon {
  width: 52px; height: 52px;
  color: var(--asagi);                /* sky-blue accent leads this section */
  margin-bottom: var(--s-1);
  transition: transform .7s var(--ease), color .7s var(--ease);
}
.service-card:hover .service-icon {
  transform: rotate(-3deg) translateY(-2px);
  color: var(--indigo-mist);
}
.service-kanji {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--matcha);
  margin: 0;
}
.service-card h3 {
  font-size: var(--fs-h3);
  letter-spacing: -0.012em;
  line-height: 1.2;
  font-weight: 500;
}
.service-card p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.75;
  flex: 1;
}
.service-card p em { font-style: italic; color: var(--matcha); }
.learn-more {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  display: inline-flex; gap: 10px; align-items: center;
  padding-bottom: 8px;
}
.learn-more em {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 1rem;
  transition: transform .55s var(--ease);
}
.learn-more::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 28px; height: 1px; background: var(--matcha);
  transition: width .6s var(--ease);
}
.service-card:hover .learn-more::after { width: 75%; }
.service-card:hover .learn-more em { transform: translateX(8px); }

/* ---------- PORTFOLIO ---------- */
.portfolio { background: var(--paper); }

.filters {
  display: flex; flex-wrap: wrap; gap: var(--s-1);
}
.filter {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 11px 18px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: color .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter.is-active {
  background: var(--sumi); color: var(--paper); border-color: var(--sumi);
}
[data-theme="dark"] .filter.is-active {
  background: var(--matcha); color: var(--paper); border-color: var(--matcha);
}

.grid {
  margin-top: var(--s-6);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 200px;            /* tatami-leaning proportions */
  gap: var(--s-2);
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; gap: var(--s-3); }
}
@media (min-width: 1100px) {
  .grid { grid-auto-rows: 280px; }
}

.tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--stone);
  grid-row: span 1;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.tile--tall { grid-row: span 2; }
@media (min-width: 700px) {
  .tile--wide { grid-column: span 2; }
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease), filter .8s var(--ease);
  filter: saturate(0.85);
}
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(28,33,30,0.72) 100%);
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.tile:hover img { transform: scale(1.05); filter: saturate(1); }
.tile:hover::after { opacity: 1; }

.tile figcaption {
  position: absolute; left: 22px; bottom: 20px; right: 22px;
  color: #fff;
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  z-index: 1;
}
.tile:hover figcaption { opacity: 1; transform: translateY(0); }
.tile figcaption .cat {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--tea-pale);
}
.tile figcaption .t {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.tile.is-hidden { display: none; }

/* ---------- TESTIMONIALS ---------- */
/* Kasumi haze — large quiet sky-blue fill, the breathing section */
.testimonials {
  background: var(--kasumi);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
[data-theme="dark"] .testimonials { background: var(--kasumi); }

.carousel { position: relative; max-width: 880px; margin: 0 auto; }
.carousel-viewport { overflow: hidden; }
.carousel-track {
  display: flex;
  transition: transform 1s var(--ease-out);
}
.quote {
  flex: 0 0 100%;
  padding: var(--s-3) var(--s-4);
  text-align: center;
  position: relative;
}
.quote-mark {
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 9rem);
  font-weight: 400;
  color: var(--asagi);
  line-height: 0.7;
  display: block;
  margin-bottom: var(--s-2);
  opacity: 0.55;
}
.quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.05rem + 1.4vw, 2.1rem);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 32ch;
  margin: 0 auto var(--s-4);
}
.quote footer {
  display: flex; flex-direction: column; gap: 6px;
}
.quote cite {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink);
}
.quote footer span {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--warm-gray);
}

.carousel-controls {
  display: flex; align-items: center; justify-content: center; gap: var(--s-3);
  margin-top: var(--s-5);
}
.c-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  color: var(--ink);
  display: grid; place-items: center;
  transition: background .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
  font-size: 1rem;
}
.c-arrow:hover {
  background: var(--sumi);
  color: var(--paper);
  border-color: var(--sumi);
}
[data-theme="dark"] .c-arrow:hover {
  background: var(--matcha); border-color: var(--matcha);
}
.carousel-dots { display: flex; gap: 10px; }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink-soft);
  background: transparent;
  transition: background .4s var(--ease), transform .4s var(--ease), border-color .4s var(--ease);
}
.dot.is-active {
  background: var(--matcha);
  border-color: var(--matcha);
  transform: scale(1.25);
}

/* ---------- ENQUIRY ---------- */
.enquiry { background: var(--paper); }
.enquiry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
}
@media (min-width: 900px) {
  .enquiry-grid {
    grid-template-columns: 1fr 1.1fr;
    gap: var(--s-8);
  }
}
.contact-list {
  margin: var(--s-6) 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
}
.contact-list dt {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--warm-gray);
  margin-bottom: 8px;
}
.contact-list dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 400;
}
.contact-list a {
  border-bottom: 1px solid var(--hairline);
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.contact-list a:hover { border-color: var(--matcha); color: var(--matcha); }

/* Form — hairline-only inputs, matcha focus */
.enquiry-form { display: flex; flex-direction: column; gap: var(--s-4); }
.field { position: relative; }
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 24px 0 14px;
  outline: 0;
  resize: vertical;
  transition: border-color .45s var(--ease);
  font-family: var(--font-body);
}
.field textarea { min-height: 130px; }
.field label {
  position: absolute;
  left: 0; top: 26px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  pointer-events: none;
  transition: transform .45s var(--ease), color .45s var(--ease), font-size .45s var(--ease), letter-spacing .45s var(--ease);
  transform-origin: left top;
}
.field input:focus,
.field textarea:focus { border-color: var(--matcha); }
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-26px);
  font-size: 0.68rem;
  color: var(--matcha);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.opt { color: var(--warm-gray); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 0.78em; }
.err {
  display: block;
  font-size: 0.76rem;
  color: var(--error);
  min-height: 18px;
  margin-top: 8px;
  letter-spacing: 0.04em;
}
.field.has-error input,
.field.has-error textarea { border-color: var(--error); }

.btn--primary.is-loading { color: transparent; pointer-events: none; }
.btn--primary.is-loading .btn-arrow { opacity: 0; }
.btn-loader {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.9s linear infinite;
}
.btn--primary.is-loading .btn-loader { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-note {
  margin-top: var(--s-2);
  font-size: 0.78rem;
  color: var(--warm-gray);
  line-height: 1.7;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--sumi);
  color: var(--paper);
  padding: var(--s-7) 0 var(--s-3);
  border-top: 1px solid var(--hairline);
  position: relative;
}
[data-theme="dark"] .site-footer { background: #0E110F; }
/* Subtle stone texture on dark footer */
.site-footer::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n2'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n2)'/></svg>");
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: screen;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid rgba(245,242,234,0.12);
  position: relative;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; gap: var(--s-6); }
}
.f-brand .brand-mark {
  font-size: 2rem;
  color: var(--matcha);
  border-color: var(--matcha);
}
.f-brand p {
  color: rgba(245,242,234,0.72);
  font-size: 0.92rem;
  max-width: 38ch;
  margin-top: var(--s-3);
  line-height: 1.8;
}
.f-nav h4, .f-contact h4 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(245,242,234,0.55);
  margin-bottom: var(--s-3);
}
.f-nav ul { display: flex; flex-direction: column; gap: 12px; }
.f-nav a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--paper);
  transition: color .35s var(--ease);
}
.f-nav a:hover { color: var(--matcha); }
.f-contact p { color: rgba(245,242,234,0.78); font-size: 0.94rem; line-height: 1.7; margin-bottom: 14px; }
.f-contact a {
  border-bottom: 1px solid rgba(245,242,234,0.2);
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.f-contact a:hover { color: var(--matcha); border-color: var(--matcha); }

.socials { display: flex; gap: 10px; margin-top: var(--s-3); }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid rgba(245,242,234,0.2);
  border-radius: 50%;
  color: var(--paper);
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.socials a:hover {
  background: var(--matcha);
  border-color: var(--matcha);
  color: #fff;
}

.f-bottom {
  padding-top: var(--s-3);
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s-2);
  font-size: 0.76rem;
  color: rgba(245,242,234,0.55);
  letter-spacing: 0.12em;
  position: relative;
}
.f-bottom .crafted {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 0.86rem;
  display: inline-flex; align-items: center; gap: 12px;
  color: rgba(245,242,234,0.78);
}

/* Cinnabar seal — the page's single document-red moment */
.seal {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--cinnabar);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1;
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  letter-spacing: 0;
}

/* ---------- WHATSAPP FLOAT ---------- */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--matcha);
  color: #fff;
  display: grid; place-items: center;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(28,33,30,0.14);
  transition: transform .4s var(--ease), background .4s var(--ease);
}
.wa-float::before {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--matcha);
  opacity: 0;
  animation: waPulse 2.6s var(--ease) 3;
}
@keyframes waPulse {
  0%   { transform: scale(0.9); opacity: 0.55; }
  100% { transform: scale(1.6); opacity: 0; }
}
.wa-float:hover { transform: translateY(-3px) scale(1.04); background: var(--moss-deep); }

/* ---------- BACK TO TOP ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 88px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--sumi);
  color: var(--paper);
  display: grid; place-items: center;
  z-index: 40;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease), background .4s var(--ease);
}
[data-theme="dark"] .to-top { background: var(--matcha); color: var(--paper); }
.to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { background: var(--matcha); }
[data-theme="dark"] .to-top:hover { background: var(--moss-deep); }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(14,17,15,0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: grid; place-items: center;
  padding: var(--s-5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lb-close, .lb-arrow {
  position: absolute;
  color: #fff;
  font-size: 1.1rem;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.lb-close { top: 22px; right: 22px; }
.lb-prev  { left: 22px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-arrow:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--matcha);
}
.lb-figure {
  margin: 0;
  max-width: 1100px;
  max-height: 86vh;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
}
.lb-figure img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
}
.lb-figure figcaption {
  color: rgba(255,255,255,0.86);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--sumi);
  color: var(--paper);
  padding: 14px 24px;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  border-radius: 2px;
  border: 1px solid rgba(245,242,234,0.1);
  opacity: 0;
  pointer-events: none;
  z-index: 110;
  max-width: 90vw;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--error); color: #fff; }

/* ---------- IO reveal (data-animate) ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 110ms);
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-title .word > span { transform: none; }
  .brush-stroke { stroke-dashoffset: 0; }
  .enso { stroke-dashoffset: 0; opacity: 0.32; }
  [data-reveal], [data-animate] { opacity: 1; transform: none; }
}
