/* =====================================================================
   Black Koi Consulting — Sumi-e river layout
   Palette: warm cream paper, ink black, warm grays. Substantial whitespace.
   ===================================================================== */

:root {
  --paper:        #ede8d8;
  --paper-2:      #e6e0cf;
  --paper-shade:  #d8d1bd;
  --ink:          #141210;
  --ink-2:        #2a2621;
  --ink-soft:     #4a443b;
  --ink-mute:     #6f685d;
  --ink-ghost:    #b6ae9e;
  --accent:       #8a6a48;   /* warm sumi brown */
  --rule:         rgba(20,18,16,.14);

  --serif:  "Cormorant Garamond", "Shippori Mincho", Georgia, serif;
  --jp:     "Shippori Mincho", "Cormorant Garamond", serif;
  --sans:   "Inter", system-ui, -apple-system, sans-serif;

  --gutter:      clamp(1.25rem, 4vw, 4rem);
  --radius:      2px;
  --ease:        cubic-bezier(.2, .7, .2, 1);

  --nav-h:       72px;
  --section-pad: clamp(6rem, 12vh, 10rem);
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  position: relative;       /* containing block for .river + .decor + .dots-layer */
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: .55rem .8rem;
  border-radius: 2px;
  font-size: .82rem;
  letter-spacing: .04em;
}
.skip-link:focus-visible {
  left: .75rem;
  top: .75rem;
}

img, svg { display: block; max-width: 100%; }

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

em { font-style: italic; color: var(--ink); }

/* =====================================================================
   Rice-paper background
   ===================================================================== */
.paper {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1200px 800px at 15% 10%, #f2edde 0%, transparent 60%),
    radial-gradient(1000px 700px at 85% 90%, #e0d9c5 0%, transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}
.paper::before,
.paper::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
}
/* Subtle fiber noise via SVG turbulence (data URI) */
.paper::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='360'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.07  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: multiply;
  opacity: .35;
}
/* Coarse paper fiber streaks */
.paper::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='f'><feTurbulence type='turbulence' baseFrequency='0.012 0.6' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .55;
}

/* Soft vignetting around the edges for parchment feel */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 55%, rgba(30,22,12,.10) 100%),
    linear-gradient(180deg, rgba(30,22,12,.04), transparent 18%, transparent 82%, rgba(30,22,12,.06));
}

/* =====================================================================
   Winding river (absolutely positioned, full document height)
   ===================================================================== */
.river {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;        /* 100% of positioned body = full document height */
  z-index: -2;
  pointer-events: none;
  color: var(--ink);
  will-change: transform;
}

/* --- River layers (painted in this order, back to front) ------------- */

/* 1. Atmospheric wash: widest, softest, barely visible */
.river-wash {
  fill: none;
  stroke: #2a231b;
  stroke-width: 58;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .085;
}

/* 2. Main ink body */
.river-body {
  fill: none;
  stroke: var(--ink);
  stroke-width: 20;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .85;
}

/* 3. Pressure "swells" at each bend.
      Each <use> shows only a short dashed segment, placed via
      stroke-dashoffset in the markup.  Thicker and rougher than the
      body — suggests the brush pressing harder as it turns. */
.river-swell {
  fill: none;
  stroke: #0b0908;
  stroke-width: 30;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .45;
}

/* 4. Source flick (brush entering the paper at the top) */
.river-source {
  fill: none;
  stroke: var(--ink);
  stroke-width: 8;
  stroke-linecap: round;
  opacity: .55;
}

/* 5. Dry-brush dash texture — two static layers (mid ink + paper highlight). */
.river-flow {
  fill: none;
  stroke: #4a443b;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: .55;
  stroke-dasharray: 26 8 50 14 10 22 70 18;
  stroke-dashoffset: 0;
}
.river-flow-2 {
  fill: none;
  stroke: #f4ecdc;
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: .5;
  stroke-dasharray: 8 22 30 40 12 60 6 30;
  stroke-dashoffset: 0;
}

/* 6. Fine inner shimmer — highest-frequency paper-coloured highlights */
.river-shimmer {
  fill: none;
  stroke: #f4ecdc;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: .3;
  stroke-dasharray: 14 38 4 60 22 46;
  transform: translate(0, -1px);
}

/* 7. Pebbles + splatters */
.river-pebbles ellipse,
.river-pebbles circle {
  fill: var(--ink);
  opacity: .6;
}
.river-pebbles circle { opacity: .35; }

/* Timeline dots (HTML overlay aligned with the river path) */
.dots-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;   /* above the river, below text content */
}
.river-dot {
  position: absolute;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: .02em;
  box-shadow:
    0 0 0 8px rgba(243, 237, 224, .65),
    0 0 0 10px rgba(20, 18, 16, .16),
    0 0 0 22px rgba(20, 18, 16, .05);
  opacity: 0;
  transition: opacity .8s var(--ease) .1s;
}
.river-dot.is-in { opacity: 1; }
.river-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(20,18,16,.45);
}

/* =====================================================================
   Decorative ink motifs (scattered, pointer-events none)
   ===================================================================== */
.decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  color: var(--ink);
}
.decor > svg {
  position: absolute;
  filter: blur(.2px);
}

.decor-lotus { color: #8e9a6b; opacity: .38; }  /* muted sage green */
.decor-stone { color: var(--ink-2); opacity: .22; }
.decor-grass { color: var(--ink-soft); opacity: .28; }

.decor-stone--1   {
  top:  22%;
  right: -10%;
  width: 340px;
  transform: rotate(45deg);
  color: #b86d2c;       /* burnt sienna — warm accent, sibling to stone--4 */
  opacity: .38;
}
.decor-stone--4   {
  top:  50%;
  left:  -3%;
  width: 220px;
  transform: rotate(9deg);
  color: #b84a22;       /* persimmon / vermillion — warm orange accent */
  opacity: .38;
}
.decor-stone--5   {
  top:  65%;
  right: -4%;
  width: 230px;
  transform: rotate(6deg);
  color: #d9a01e;       /* warm mustard yellow — echoes the orange in stone--4 */
  opacity: .42;
}
.decor-lotus--1   { top:  28%; left:   4%; width: 170px; transform: rotate(-6deg); }
.decor-stone--3   { top:  40%; right: 22%; width:  70px; transform: rotate(-14deg); opacity: .18; }
.decor-stone--2   { top:  56%; left:   6%; width: 140px; transform: rotate(8deg); opacity: .20; }
.decor-stone--6   {
  top:  74%;
  left:  -12%;
  width: 290px;
  transform: rotate(-10deg);
  color: #d9a01e;       /* warm mustard yellow — matches stone--5 */
  opacity: .42;
}
.decor-lotus--2   { top:  78%; right:  4%; width: 150px; transform: rotate(10deg); }
.decor-lotus--3   { top:  58%; right: 12%; width: 140px; transform: rotate(-12deg); }
.decor-grass--1   { top:  45%; right:  6%; width:  70px; transform: rotate(-4deg); }
.decor-grass--2   { top:  72%; left:  10%; width:  65px; transform: rotate(4deg); }
.decor-grass--3   { top:  12%; left:   6%; width:  55px; transform: rotate(-6deg); }
.decor-grass--4   { top:  85%; right:  8%; width:  60px; transform: rotate(3deg); }

/* Koi silhouettes — monochrome, low opacity, swimming with the river */
.decor-koi {
  position: absolute;
  pointer-events: none;
  opacity: .12;
  filter: grayscale(1) contrast(.9);
}
.decor-koi--1 {
  top: 4%;
  right: 2%;
  width: 220px;
  transform: rotate(18deg) scaleX(-1);
}
/* Clipper lets the koi straddle the footer's top edge while clipping
   anything that would otherwise push the page taller (rotated bbox). */
.footer-koi-clip {
  position: absolute;
  left: 0;
  right: 0;
  /* Extend above the footer so the koi peeks out above the rule,
     but clip at the footer's bottom so nothing adds page height. */
  top: -180px;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.decor-koi--2 {
  position: absolute;
  top: 0;
  left: 12%;
  width: 180px;
  transform: rotate(-50deg);
  opacity: .10;
}

/* =====================================================================
   Header / Nav
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.05) blur(8px);
  -webkit-backdrop-filter: saturate(1.05) blur(8px);
  background: rgba(243, 237, 224, .72);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1rem, 3vw, 3rem);
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
}
.brand-mark {
  width: 40px; height: 40px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Keep the koi crisp on the warm paper */
  filter: drop-shadow(0 1px 0 rgba(243, 237, 224, .6));
}
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-en   { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .01em; }
.brand-jp   { font-family: var(--jp); font-size: .7rem; letter-spacing: .35em; color: var(--ink-mute); margin-top: 4px; }
.brand-tag  { font-style: italic; font-size: .78rem; color: var(--ink-mute); margin-top: 4px; letter-spacing: .02em; }

.nav { justify-self: end; display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); margin-right: clamp(1rem, 3vw, 2.5rem); }
.nav a {
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: .35rem 0;
  position: relative;
  transition: color .2s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover,
.nav a.is-active { color: var(--ink); }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }
.nav-mobile-cta { display: none; }

.nav-cta { justify-self: end; }
.nav-cta {
  position: relative;
  color: var(--ink-soft);
  /* Match vertical rhythm of .nav a so underline sits on same baseline */
  padding-top: .35rem;
  padding-bottom: .35rem;
}
.nav-cta::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease), color .2s var(--ease);
}
.nav-cta:hover,
.nav-cta.is-active { color: var(--ink); }
.nav-cta:hover::after,
.nav-cta.is-active::after { transform: scaleX(1); }
/* Override generic .btn spacing so CTA baseline matches .nav links */
.site-header .nav-cta.btn--text {
  padding: .35rem 0;
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: none; border: none;
  cursor: pointer;
  justify-self: end;
}
.nav-toggle span {
  display: block; width: 22px; height: 1px; background: var(--ink);
  margin: 5px auto; transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* Keyboard-only focus visibility (visual-safe palette match) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid rgba(80, 74, 66, .75);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.4rem;
  font-family: var(--sans);
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .3s var(--ease);
  background: none;
  color: var(--ink);
}
.btn--ink {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--ink:hover { background: transparent; color: var(--ink); }

.btn--ghost {
  border-color: var(--ink);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--text {
  padding-left: 0; padding-right: 0;
  letter-spacing: .18em;
}
.btn--text:hover span { transform: translateX(4px); }
.btn--text span { display: inline-block; transition: transform .3s var(--ease); }

/* Invite — a larger, serif-italic text CTA (hero). More presence than
   .btn--text, still no pill. Reads as an invitation, not a button. */
.btn--invite {
  padding: .25rem 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  gap: .55rem;
  border-radius: 0;
}
.btn--invite span { display: inline-block; transition: transform .3s var(--ease); }
.btn--invite:hover span { transform: translateX(6px); }

/* Brushed — same serif-italic text as .btn--invite, but with an
   organic sumi-e underline drawn as an inline SVG background. Swells
   slightly on hover, as if the brush is pressed a little harder. */
.btn--brushed {
  padding: .1rem 0 .75rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  gap: .55rem;
  border-radius: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 14' preserveAspectRatio='none'><path d='M 4 7 C 30 4, 70 10, 110 6 C 150 2, 180 9, 216 5' fill='none' stroke='%23141210' stroke-width='2.4' stroke-linecap='round' opacity='.9'/><path d='M 10 10 C 50 9, 90 11, 140 9 C 170 8, 195 10, 210 9' fill='none' stroke='%23141210' stroke-width='.7' stroke-linecap='round' opacity='.35'/></svg>");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 9px;
  transition: background-size .35s var(--ease), color .3s var(--ease);
}
.btn--brushed:hover { background-size: 100% 12px; }
.btn--brushed span { display: inline-block; transition: transform .35s var(--ease); }
.btn--brushed:hover span { transform: translateX(4px); }

/* =====================================================================
   Sections & follow-the-river alignment
   ===================================================================== */
main { position: relative; }

.section {
  position: relative;
  padding: var(--section-pad) var(--gutter);
  max-width: 1440px;
  margin: 0 auto;
  /* Offset anchor jumps for the sticky nav so section tops aren't hidden. */
  scroll-margin-top: var(--nav-h);
}

/* Core interaction: content blocks align to the river's curves.
   On desktop, narrow content tucks into the left or right valley
   of the river's meander. */
.content--narrow { max-width: 46ch; }

.section[data-align="left"]  .content { margin-right: auto; margin-left: clamp(1rem, 6vw, 7rem); }
.section[data-align="right"] .content { margin-left: auto; margin-right: clamp(1rem, 6vw, 7rem); }
.section[data-align="center"] { text-align: center; }
.section[data-align="center"] .section-head { max-width: 38rem; margin: 0 auto; }

/* Typography */
.eyebrow {
  font-family: var(--jp);
  font-size: .72rem;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1.25rem;
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.display em { font-weight: 400; color: var(--ink-2); }
.heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.005em;
  margin: 0 0 1rem;
}
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 44ch; margin: 0 0 2rem; }
.section-sub { color: var(--ink-soft); max-width: 40rem; margin: 0 auto; }
.muted { color: var(--ink-mute); }


/* Quiet section header — eyebrow + italic intro line, no h2, no cartouche.
   Used when the hero has already set the stance and the section just needs
   to deliver the goods. */
.section-head--quiet { margin-bottom: clamp(2rem, 4.5vh, 3.5rem); }
.section-head--quiet .eyebrow { margin-bottom: 1rem; }

/* When a quiet section-head wears a cartouche (Services), keep it compact so
   the cloud hugs the eyebrow + intro rather than stretching to the section-
   head's default max-width. */
.services { padding-top: calc(var(--section-pad) * .6); }
.services .section-head--quiet { margin-bottom: clamp(1.25rem, 3vh, 2.25rem); }
.services .section-head.cartouche {
  max-width: min(26rem, 80%);
  padding: clamp(.75rem, 1.5vw, 1.15rem) clamp(1rem, 2vw, 1.5rem);
}
.services .section-head.cartouche--cloud .cartouche-bg {
  inset: -18px -40px;
  width: calc(100% + 80px);
  height: calc(100% + 36px);
}
/* Optical tweak: the tracked eyebrow + numeral reads slightly right-heavy. */
.services .section-head .eyebrow {
  display: block;
  width: 100%;
  text-align: left;
  padding-left: 2.1rem;
  transform: none;
}
.section-intro {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  max-width: 36rem;
}
.section[data-align="center"] .section-intro { margin: 0 auto; }
.section-intro em { font-style: italic; }

.cta-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }

/* =====================================================================
   Cartouche variants — three organic shapes that lift copy off the ink.
   Use:
     <div class="content cartouche cartouche--cloud">
       <svg class="cartouche-bg" viewBox="0 0 400 260" preserveAspectRatio="none">
         <use href="#cartouche-cloud"/>
       </svg>
       ...content...
     </div>
   Available variants: --cloud, --kasumi, --washi
   ===================================================================== */
.cartouche {
  position: relative;
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.75rem, 3vw, 2.75rem);
}

.cartouche-bg {
  position: absolute;
  inset: -22px -38px;
  width: calc(100% + 76px);
  height: calc(100% + 44px);
  z-index: -1;
  pointer-events: none;
  /* Subtle lift so the shape feels like paper laid on top of ink */
  filter: drop-shadow(0 14px 24px rgba(20, 18, 16, .14));
}

/* Per-variant inset tuning (so each shape bleeds nicely past the text) */
.cartouche--cloud .cartouche-bg      { inset: -34px -52px; width: calc(100% + 104px); height: calc(100% + 68px); }
.cartouche--cloud-wide .cartouche-bg { inset: -50px -72px; width: calc(100% + 144px); height: calc(100% + 100px); }
.cartouche--washi .cartouche-bg      { inset: -22px -38px; width: calc(100% + 76px);  height: calc(100% + 44px); }

/* The sprite SVG itself should not take layout space */
.cartouche-sprites {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero { min-height: 92vh; display: flex; align-items: center; padding-top: calc(var(--nav-h) + var(--section-pad) * .6); }
/* Hero is the loudest moment on the page — wider container and larger type */
.hero .content   { max-width: 85vw; }
.hero .cartouche--cloud .cartouche-bg {
  inset: -34px -78px -34px -52px;
  width: calc(100% + 130px);
}
.hero .display   { font-size: clamp(3.5rem, 9vw, 7.5rem); line-height: 1.0; letter-spacing: -.015em; }
.hero .lede      { font-size: clamp(1.15rem, 1.6vw, 1.45rem); max-width: 60ch; line-height: 1.55; }
.hero .eyebrow   { font-size: .82rem; }
/* =====================================================================
   About
   ===================================================================== */
.about p + p { margin-top: 1rem; }

/* About keeps a slightly larger bottom rhythm than default sections. */
.about { padding-bottom: calc(var(--section-pad) * 1.1); }

#about .content.cartouche .cartouche-bg {
  inset: -30px -52px;
  width: calc(100% + 104px);
  height: calc(100% + 60px);
}
/* Lift the portrait and the text above the cloud */
.bio-photo { position: relative; z-index: 1; }
.about .content { position: relative; z-index: 1; }
.bio-photo {
  width: 200px;
  aspect-ratio: 4 / 5;
  margin: 0 0 1.75rem;
  padding: 0;
  overflow: hidden;
}
.bio-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
  /* Warm-grade to pull the portrait into the paper palette, plus a tall
     oval radial-gradient mask that feathers the edges into the page. */
  filter: saturate(0.88) contrast(1.02) sepia(0.06);
  -webkit-mask-image: radial-gradient(ellipse 60% 86% at 50% 50%, black 40%, transparent 96%);
          mask-image: radial-gradient(ellipse 60% 86% at 50% 50%, black 40%, transparent 96%);
}

/* On wide screens, pin the portrait to the left of the About section in the
   empty space next to the river. Below 1100px the figure falls back into the
   normal text flow (appears at the top of the section). */
@media (min-width: 1101px) {
  .about .bio-photo {
    position: absolute;
    /* Align top of photo roughly with the top of the first paragraph
       (i.e. the bottom of the "Maria Kedemo" heading). */
    top: calc(var(--section-pad) + 6rem);
    left: clamp(10rem, 24vw, 18rem);
    width: 240px;
    margin: 0;
    z-index: 1;
  }
  /* Widen the About text column so it sits closer to the portrait */
  .about .content--narrow { max-width: 58ch; }
}
.ethos {
  list-style: none; padding: 0; margin: 2.5rem 0 0;
  display: grid; gap: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}
.ethos li {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: baseline;
  padding-bottom: 1rem; border-bottom: 1px solid var(--rule);
}
.ethos strong {
  font-family: var(--serif);
  font-style: italic; font-weight: 400;
  font-size: 1.15rem; color: var(--ink-mute);
}

/* =====================================================================
   Services (cards)
   ===================================================================== */
.section-head { margin-bottom: clamp(2.5rem, 6vh, 5rem); }
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 1.75vw, 1.5rem);
  max-width: 1280px;
  margin: 0 auto;
  text-align: left;
  align-items: stretch;
}
/* Brushstroke-headed cards: a wide graphite ink band crowns each card,
   with brush-distorted upper edge. No icon — the band is the gesture. */
.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 0;
  background: linear-gradient(180deg, #fbf5e6 0%, rgba(251,245,230,.45) 100%);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px -26px rgba(20,18,16,.28);
}
.card-brush-head {
  position: relative;
  height: 92px;
}
.card-brush-head svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
  display: block;
}
.card-body {
  padding: 1rem 1.25rem 1.35rem;
  display: flex; flex-direction: column;
  flex: 1;
}
.card h3 { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; margin: 0 0 .45rem; letter-spacing: -.005em; line-height: 1.2; }
.card p { color: var(--ink-soft); margin: 0 0 .9rem; font-size: .82rem; line-height: 1.5; }
.card-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.card-tags li {
  font-family: var(--jp);
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: .25rem .5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255, 251, 240, .5);
}
.card-link {
  margin-top: auto;
  align-self: flex-start;
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink-ghost);
  padding-bottom: 3px;
  color: var(--ink);
  transition: border-color .2s var(--ease);
}
.card-link:hover { border-color: var(--ink); }

/* =====================================================================
   Process timeline (dots sit on the river curve)
   ===================================================================== */
.process { padding-bottom: calc(var(--section-pad) * 1.3); }
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 1200px;
  position: relative;
  min-height: 860px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: clamp(3rem, 8vh, 6rem);
  text-align: left;
}
.tl-item {
  display: flex; flex-direction: column;
  max-width: 360px;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 251, 240, .6);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  position: relative;
  backdrop-filter: blur(2px);
}
.tl-item[data-side="left"]  { justify-self: start; margin-left: clamp(0rem, 3vw, 4rem); }
.tl-item[data-side="right"] { justify-self: end;   margin-right: clamp(0rem, 3vw, 4rem); }
.tl-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-mute);
  letter-spacing: .12em;
  margin-bottom: .25rem;
}
.tl-item h3 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: 0 0 .5rem; }
.tl-item p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* The thin connector line from each card toward the river dot.
   --conn is set per-item by JS once dots are placed; falls back to a sensible default. */
.tl-item::before {
  content: "";
  position: absolute;
  top: 50%;
  width: var(--conn, clamp(1.25rem, 4vw, 3rem));
  height: 1px;
  background: var(--ink);
  opacity: .35;
}
.tl-item[data-side="left"]::before  { right: calc(-1 * var(--conn, clamp(1.25rem, 4vw, 3rem))); }
.tl-item[data-side="right"]::before { left:  calc(-1 * var(--conn, clamp(1.25rem, 4vw, 3rem))); }

/* =====================================================================
   Portfolio
   ===================================================================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}
.thumb { display: flex; flex-direction: column; gap: 1.25rem; }
.thumb-art {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-shade);
  transition: transform .5s var(--ease);
}
.thumb-art svg { width: 100%; height: 100%; }
.thumb:hover .thumb-art { transform: translateY(-3px); }
.thumb-meta .tag {
  font-size: .72rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--ink-mute); margin: 0 0 .5rem;
}
.thumb h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.35rem; line-height: 1.25; margin: 0 0 .5rem;
  letter-spacing: -.005em;
}
.thumb p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* =====================================================================
   Contact (closing letter) — centered cartouche to bookend the hero.
   The content block is a little wider than the default narrow cap so
   the email and LinkedIn rows don't collide with the cartouche edges,
   and the cartouche bleed is widened to match. Every inner element is
   explicitly centered so nothing can slip left.
   ===================================================================== */
.contact {
  margin-top: clamp(1.75rem, 4vh, 3rem);
  padding-top: calc(var(--section-pad) * .3);
  padding-bottom: calc(var(--section-pad) * .55);
  position: relative;
  /* Make Contact tall enough that jumping to it hides About cleanly,
     but short enough that the footer stays in the same viewport.
     The reserved ~13rem accounts for the footer's margin-top + height. */
  min-height: calc(100vh - var(--nav-h) - 13rem);
}

/* Section-wide cloud behind the contact letter, matching the About section.
   Sized to the section rather than the content, so the cloud's natural
   aspect ratio is preserved and the text never touches its edges. */
.contact .section-cloud {
  position: absolute;
  top: clamp(1rem, 3vh, 2.5rem);
  /* Centered on the page via 50% + translate, with a bounded width so it
     doesn't stretch to the section's full width on large screens. */
  left: 50%;
  transform: translateX(-50%);
  width: clamp(28rem, 72vw, 56rem);
  height: clamp(25rem, 52vh, 34rem);
  pointer-events: none;
  z-index: 0;
}

#contact .content {
  position: relative;
  z-index: 1;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
#contact .eyebrow,
#contact .heading,
#contact .contact-lede,
#contact .contact-channels { text-align: center; }

.contact-brush-rule {
  display: block;
  width: 90px; height: 10px;
  margin: -.25rem auto 1.5rem;
}
.contact-lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 auto 2rem;
  max-width: 46ch;
  text-align: center;
}
.contact-channels {
  list-style: none; padding: 0;
  margin: 0 auto 2.5rem;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.contact-channels li {
  display: inline-flex; align-items: baseline; gap: .9rem;
  justify-content: center;
  max-width: 100%;
}
.contact-channels a { word-break: break-word; }
.contact-channels .ch-label {
  font-family: var(--jp);
  font-size: .62rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--ink-mute);
  align-self: center;
  min-width: 64px;
}
.contact-channels a {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-ghost);
  padding-bottom: .2rem;
  transition: border-color .2s var(--ease);
}
.contact-channels a:hover { border-color: var(--ink); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  position: relative;
  border-top: 1px solid var(--rule);
  padding: 2rem var(--gutter) 1.25rem;
  margin-top: 3rem;
  background: linear-gradient(180deg, transparent, rgba(30,22,12,.04));
}
.foot-inner {
  position: relative;
  z-index: 1;
  max-width: 1440px; margin: 0 auto;
  display: grid; gap: 1rem;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}
.foot-brand { display: flex; flex-direction: column; gap: .2rem; }
.foot-credo {
  font-family: var(--serif);
  font-style: italic;
  font-size: .84rem;
  line-height: 1.35;
  color: var(--ink-mute);
  margin: 0;
  max-width: 48ch;
}
.foot-tag {
  color: var(--ink-mute);
  font-size: .9rem;
  justify-self: center;
  margin: 0;
  text-align: center;
}
.foot-social { display: flex; gap: 1rem; padding: 0; list-style: none; margin: 0; justify-self: end; }
.foot-social a {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--rule); border-radius: 50%;
  background: var(--paper);
  color: var(--ink-soft);
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .3s var(--ease);
}
.foot-social a:hover { color: var(--ink); border-color: var(--ink); background: var(--paper); transform: translateY(-2px); }
/* =====================================================================
   Reveal animation (added by JS on intersection)
   ===================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Responsive
   ===================================================================== */
/* Cards collapse earlier than the rest because 4-up needs more room */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 2.5vw, 2.25rem); max-width: 920px; }
}

@media (max-width: 960px) {
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .site-header.is-open .nav {
    display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 1.25rem var(--gutter); flex-direction: column; gap: 1rem;
  }
  .site-header.is-open .nav .nav-mobile-cta { display: inline-block; }
  /* On tablet, ease the left/right offsets so content doesn't crowd the river edges */
  .section[data-align="left"]  .content { margin-left:  clamp(1rem, 4vw, 3rem); }
  .section[data-align="right"] .content { margin-right: clamp(1rem, 4vw, 3rem); }
}

@media (max-width: 720px) {
  :root { --nav-h: 60px; --section-pad: 5rem; }
  body { font-size: 16px; }
  .cards, .portfolio-grid { grid-template-columns: 1fr; }
  .cards { max-width: 480px; }
  .timeline { min-height: auto; grid-template-rows: auto; gap: 2rem; }
  .tl-item { max-width: none; }
  .tl-item[data-side="left"], .tl-item[data-side="right"] {
    justify-self: stretch; margin: 0;
  }
  .tl-item::before { display: none; }
  /* On phones, center all content over the river instead of alternating */
  .section[data-align="left"] .content,
  .section[data-align="right"] .content { margin-left: 0; margin-right: 0; max-width: none; }
  /* Mobile decor tune: keep fewer motifs, larger and closer to content columns
     so they remain visible on narrow viewports without crowding the layout. */
  .decor-lotus--1 { top: 22%; left: -2%; width: 124px; opacity: .42; }
  .decor-lotus--2 { top: 74%; right: -2%; width: 118px; opacity: .4; }
  .decor-lotus--3 { top: 56%; right: 4%; width: 102px; opacity: .34; }
  .decor-stone--1 { top: 18%; right: -16%; width: 210px; opacity: .3; }
  .decor-stone--4 { top: 49%; left: -12%; width: 150px; opacity: .32; }
  .decor-stone--5 { top: 68%; right: -10%; width: 160px; opacity: .32; }
  .decor-stone--6 { top: 80%; left: -20%; width: 200px; opacity: .3; }
  .decor-stone--2,
  .decor-stone--3,
  .decor-grass--3,
  .decor-grass--4 { display: none; }
  .decor-grass--1 { top: 44%; right: 4%; width: 62px; opacity: .34; }
  .decor-grass--2 { top: 77%; left: 6%; width: 58px; opacity: .3; }
  .foot-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .foot-social a { width: 44px; height: 44px; }
  .foot-tag {
    display: block;
    order: -1;
    margin: 0 0 .35rem;
    font-size: .82rem;
    letter-spacing: .04em;
  }
  .foot-social { justify-self: center; }
  /* Soften river visual weight on small screens */
  .river-body { stroke-width: 34; }
  .river-wash { stroke-width: 80; }
  .river-core { stroke-width: 12; }
}

@media (max-width: 420px) {
  .display { font-size: 2.4rem; }
  .decor { display: none; }
}

/* =====================================================================
   Safari-only paint/compositing fallback
   - Lightens filter stack and blend work on WebKit to reduce stutter.
   ===================================================================== */
html.is-safari {
  scroll-behavior: auto;
}

html.is-safari .site-header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(243, 237, 224, .94);
}

html.is-safari [data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}

html.is-safari .paper::after {
  display: none !important;
}

/* Step 1: bring back a lightweight static river in Safari. */
html.is-safari .river {
  display: block !important;
}

html.is-safari .river-swell,
html.is-safari .river-source,
html.is-safari .river-flow,
html.is-safari .river-flow-2,
html.is-safari .river-shimmer {
  display: none;
}

html.is-safari .river-wash { opacity: .06; }
html.is-safari .river-body { opacity: .38; }
html.is-safari .river-pebbles { opacity: .55; }
html.is-safari .river-pebbles circle { opacity: .3; }

/* Step 2: restore a subtle paper grain layer. */
html.is-safari .paper::before {
  display: block !important;
  opacity: .14;
  mix-blend-mode: normal;
}

/* Step 4: bring back a subtle edge vignette. */
html.is-safari body::before {
  display: block !important;
  opacity: .35;
}

/* Step 3: reintroduce a few static decor motifs. */
html.is-safari .decor {
  display: block !important;
}

html.is-safari .decor > * {
  display: none;
}

html.is-safari .decor .decor-lotus--1,
html.is-safari .decor .decor-lotus--2,
html.is-safari .decor .decor-lotus--3,
html.is-safari .decor .decor-grass--1,
html.is-safari .decor .decor-grass--2,
html.is-safari .decor .decor-stone--1,
html.is-safari .decor .decor-stone--2,
html.is-safari .decor .decor-stone--3,
html.is-safari .decor .decor-stone--4,
html.is-safari .decor .decor-stone--5,
html.is-safari .decor .decor-stone--6 {
  display: block;
  opacity: .3;
  filter: none;
}

html.is-safari .decor .decor-stone--1 {
  right: -3%;
  opacity: .38;
}

html.is-safari .decor .decor-stone--2 {
  left: 3%;
  opacity: .34;
}

html.is-safari .decor .decor-stone--4 {
  left: 2%;
  opacity: .34;
}

html.is-safari .decor .decor-stone--5 {
  right: 2%;
  opacity: .34;
}

html.is-safari .decor .decor-stone--6 {
  left: -4%;
  opacity: .36;
}

html.is-safari .decor .decor-lotus--1,
html.is-safari .decor .decor-lotus--2,
html.is-safari .decor .decor-lotus--3 {
  opacity: .45;
}

html.is-safari .decor .decor-grass--1 {
  top: 52%;
  right: 9%;
  width: 105px;
  color: var(--ink-2);
  opacity: .5;
}

html.is-safari .decor .decor-grass--2 {
  top: 74%;
  left: 12%;
  width: 88px;
  color: var(--ink-soft);
  opacity: .3;
}

@supports (-webkit-touch-callout: none) {
  .paper::after {
    display: none;
  }

  .paper::before {
    opacity: .2;
    mix-blend-mode: normal;
  }

  .river-wash,
  .river-body,
  .river-swell,
  .river-source,
  .river-flow,
  .river-flow-2,
  .river-shimmer {
    filter: none !important;
  }

  .river-swell,
  .river-flow-2,
  .river-shimmer {
    opacity: .18;
  }

  .decor > svg {
    filter: none;
  }
}
