/* ===================================================================
   uechi-site (URIKA)
   Design direction: scholar-editorial with Japanese typographic voice.
   Not minimalism. Not editorial-SaaS. Specific.

   Tokens first, then type, then layout. See docs/DECISIONS.md.
   =================================================================== */

:root {
  /* ---------- palette (Japanese traditional) ---------- */
  --c-washi:        #efe8d8;  /* handmade paper (page bg)              */
  --c-washi-deep:   #e4dcc8;  /* darker paper (footer, inset blocks)   */
  --c-washi-tint:   #f7f2e6;  /* highest-light paper (card bg)         */
  --c-sumi:         #1a1816;  /* ink, body text                         */
  --c-sumi-soft:    #44403a;  /* secondary text                         */
  --c-ash:          #95887d;  /* tertiary, captions                    */
  --c-rule:         #c9bea6;  /* hairline dividers                     */
  --c-aka:          #a62117;  /* vermillion (hanko, accent)            */
  --c-aka-deep:     #7c180f;  /* accent hover                          */
  --c-kincha:       #6e4e25;  /* dark gold brown, rare tertiary         */

  /* ---------- type stacks ---------- */
  --f-display: 'EB Garamond', 'Cormorant Garamond', 'Hoefler Text', 'Baskerville', Georgia, serif;
  --f-body:    'IBM Plex Sans', -apple-system, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif;
  --f-mono:    'IBM Plex Mono', 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
  --f-jp:      'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', 'MS Mincho', serif;

  /* ---------- measures ---------- */
  --measure-body:  62ch;
  --measure-lede:  34ch;
  --measure-prose: 36rem;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max-w:  74rem;
  --max-w-narrow: 42rem;

  --r-sm: 2px;
  --r-md: 3px;

  --feat-tabular: "tnum" 1, "lnum" 1;
  --feat-smallcaps: "smcp" 1, "c2sc" 1;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; }

/* Subtle washi-paper noise via SVG data URI. Dialled low; it should
   never read as a "texture" per se, just keep the page from feeling
   like a flat screen. */
body {
  margin: 0;
  background-color: var(--c-washi);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  color: var(--c-sumi);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  font-feature-settings: var(--feat-tabular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

/* All historical photography gets a measured warmth shift and a hairline
   frame. No extreme sepia .  just enough to signal "archival" over "stock". */
.photo-archival {
  filter: saturate(.84) contrast(1.04) sepia(.08);
  border: 1px solid var(--c-rule);
  box-shadow: 0 1px 0 var(--c-washi-deep), 0 2px 12px -8px rgba(26, 24, 22, .35);
}

a {
  color: var(--c-sumi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--c-rule);
  transition: color .12s ease, text-decoration-color .12s ease;
}
a:hover, a:focus-visible {
  color: var(--c-aka);
  text-decoration-color: var(--c-aka);
}
a:focus-visible { outline: 2px solid var(--c-aka); outline-offset: 2px; }

/* ---------- type scale ---------- */

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.005em;
  color: var(--c-sumi);
  margin: 0;
}

.eyebrow {
  font-family: var(--f-body);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-sumi-soft);
  margin: 0 0 .9rem;
}
.eyebrow--accent { color: var(--c-aka); }
.eyebrow--jp {
  font-family: var(--f-jp);
  text-transform: none;
  letter-spacing: .25em;
  font-weight: 500;
  font-size: .85rem;
  color: var(--c-aka);
}

/* Kanji display .  used as decorative headings and oversized background art. */
.kanji {
  font-family: var(--f-jp);
  font-weight: 500;
  color: var(--c-sumi);
  line-height: 1;
}
.kanji--accent { color: var(--c-aka); }
.kanji--massive {
  font-size: clamp(8rem, 24vw, 20rem);
  font-weight: 500;
  color: var(--c-aka);
  opacity: .06;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* Hanko-style red seal. Used sparingly as a section-break ornament. */
.hanko {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--c-aka);
  color: var(--c-washi);
  border-radius: 2px;
  font-family: var(--f-jp);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 2px var(--c-aka), inset 0 0 0 3px var(--c-washi);
  transform: rotate(-3deg);
  flex-shrink: 0;
}

/* A vertical rule motif (like the edge of a hanging scroll).
   Add to any section with `vrule` and set a left padding. */
.vrule {
  position: relative;
}
.vrule::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 0%, var(--c-rule) 10%, var(--c-rule) 90%, transparent 100%);
}

/* Tabular dates/numerals */
.tabular { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: var(--feat-tabular); }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.6rem var(--gutter) 1.4rem;
  border-bottom: 1px solid var(--c-rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  text-decoration: none;
  color: var(--c-sumi);
}
.brand:hover, .brand:focus-visible { color: var(--c-sumi); }

.brand__kanji {
  font-family: var(--f-jp);
  font-weight: 500;
  font-size: 1.95rem;
  color: var(--c-aka);
  line-height: 1;
  letter-spacing: .02em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
  border-left: 1px solid var(--c-rule);
  padding-left: 1.1rem;
}
.brand__short {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: .08em;
  color: var(--c-sumi);
}
.brand__long {
  font-family: var(--f-body);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-sumi-soft);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  font-size: .87rem;
  font-weight: 500;
  color: var(--c-sumi);
  padding: .25rem 0;
  border-bottom: 1px solid transparent;
  letter-spacing: .02em;
}
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--c-aka);
  color: var(--c-aka);
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--c-aka);
  border-bottom-color: var(--c-aka);
}

/* ---------- main wrappers ---------- */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- hero (asymmetric, with oversized kanji in background) ---------- */

.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
  overflow: hidden;
}

.hero__kanji-bg {
  position: absolute;
  top: 50%;
  right: -3vw;
  transform: translateY(-55%);
  font-family: var(--f-jp);
  font-size: clamp(14rem, 34vw, 32rem);
  font-weight: 500;
  color: var(--c-aka);
  opacity: .055;
  line-height: .8;
  pointer-events: none;
  user-select: none;
  letter-spacing: -.02em;
  z-index: 0;
}

.hero__text { position: relative; z-index: 1; }

.hero__eyebrow-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1.4rem;
}
.hero__eyebrow-row .eyebrow { margin: 0; }
.hero__eyebrow-row .divider {
  width: 2rem;
  height: 1px;
  background: var(--c-rule);
}

.hero__headline {
  font-size: clamp(2.6rem, 4.5vw + .5rem, 4.4rem);
  font-weight: 500;
  margin: 0 0 1.6rem;
  letter-spacing: -0.012em;
  max-width: 16ch;
}

.hero__lede {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.4vw + .6rem, 1.45rem);
  line-height: 1.5;
  color: var(--c-sumi-soft);
  max-width: var(--measure-lede);
  margin: 0;
}

.hero__figure {
  position: relative;
  z-index: 1;
  margin: 0;
}
.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.hero__figure figcaption,
.history__figure figcaption {
  font-family: var(--f-body);
  font-size: .78rem;
  font-style: normal;
  color: var(--c-sumi-soft);
  margin-top: .7rem;
  padding-left: .75rem;
  border-left: 2px solid var(--c-aka);
  letter-spacing: .01em;
}

/* ---------- section-grid: three cards with vertical rules between ---------- */

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: clamp(2.5rem, 4vw, 3.5rem) 0;
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
}

.section-grid > .card {
  padding: 0 clamp(1rem, 2vw, 1.75rem);
  position: relative;
}
.section-grid > .card + .card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: var(--c-rule);
}

.card__heading {
  font-size: 1.45rem;
  font-weight: 500;
  margin: 0 0 .7rem;
  letter-spacing: -0.004em;
}
.card__body {
  color: var(--c-sumi-soft);
  margin: 0 0 1.3rem;
  max-width: 34ch;
  font-size: .97rem;
}
.card__cta a {
  text-decoration: none;
  font-weight: 500;
  font-size: .86rem;
  letter-spacing: .04em;
  color: var(--c-aka);
  border-bottom: 1px solid var(--c-aka);
  padding-bottom: 2px;
  display: inline-block;
}
.card__cta a:hover,
.card__cta a:focus-visible {
  color: var(--c-aka-deep);
  border-bottom-color: var(--c-aka-deep);
}

/* ---------- history row (asymmetric, text 3/5 - image 2/5) ---------- */

.history {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}
.history__text { max-width: var(--measure-prose); }
.history__heading {
  font-size: clamp(1.7rem, 2.4vw + .5rem, 2.4rem);
  font-weight: 500;
  margin: 0 0 1.2rem;
  max-width: 20ch;
}
.history__body {
  margin: 0;
  color: var(--c-sumi);
}
.history__figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ---------- closing ---------- */

.closing {
  padding: clamp(3rem, 6vw, 5rem) 0;
  text-align: center;
  border-top: 1px solid var(--c-rule);
  position: relative;
}
.closing__hanko {
  margin: 0 auto 1.6rem;
}
.closing__heading {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 2.4vw + .5rem, 2.3rem);
  font-weight: 500;
  margin: 0 auto .9rem;
  max-width: 22ch;
}
.closing__body {
  max-width: 42ch;
  margin: 0 auto 1.5rem;
  color: var(--c-sumi-soft);
}

.btn-ghost {
  display: inline-block;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: .06em;
  color: var(--c-sumi);
  text-decoration: none;
  padding: .85rem 1.75rem;
  border: 1px solid var(--c-sumi);
  border-radius: var(--r-sm);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--c-sumi);
  color: var(--c-washi);
  border-color: var(--c-sumi);
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4rem;
  background: var(--c-washi-deep);
  border-top: 1px solid var(--c-rule);
}
.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.75rem var(--gutter) 1.75rem;
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 2rem;
  align-items: start;
}
.site-footer__col--mark {
  justify-self: end;
  text-align: right;
}
.footer-kanji {
  font-family: var(--f-jp);
  font-weight: 500;
  font-size: 2.6rem;
  color: var(--c-aka);
  opacity: .9;
  line-height: 1;
  letter-spacing: .04em;
}
.footer-kanji-caption {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-sumi-soft);
  margin: .4rem 0 0;
}
.footer-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.2rem;
  margin: 0 0 .3rem;
  letter-spacing: -0.003em;
}
.footer-meta {
  font-size: .85rem;
  color: var(--c-sumi-soft);
  margin: 0;
}
.site-footer__legal {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 1.75rem;
  font-size: .76rem;
  color: var(--c-sumi-soft);
  border-top: 1px solid var(--c-rule);
  padding-top: 1.25rem;
  letter-spacing: .02em;
}
.site-footer__legal p { margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .brand__long { display: none; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .hero__kanji-bg {
    font-size: clamp(10rem, 48vw, 18rem);
    opacity: .05;
    right: -8vw;
    top: 30%;
  }
  .section-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .section-grid > .card { padding: 2rem 0 0; }
  .section-grid > .card + .card { border-top: 1px solid var(--c-rule); }
  .section-grid > .card + .card::before { display: none; }
  .history {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
  .site-footer__col--mark {
    justify-self: start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
