/* 1 to 10 — Trip to Japan · base: tokens, type, shared components */

:root {
  /* palette — washi paper, aizome indigo, hanko vermilion */
  --washi: #f0f1ec;
  --washi-2: #e5e8e1;
  --paper: #fbfbf8;
  --ai: #1c2a4e;
  --ai-deep: #111a31;
  --ai-mid: #2c3d69;
  --ai-mist: #c9d0e0;
  --sumi: #1a1b20;
  --nezumi: #545b68;
  --shu: #c63e29;
  --shu-deep: #a32f1e;
  --matsu: #3d5b48;
  --kin: #c99a45;
  --line: rgba(28, 42, 78, 0.13);
  --line-strong: rgba(28, 42, 78, 0.24);

  --f-display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-ui: cubic-bezier(0.2, 0, 0, 1);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  --topbar-h: 60px;

  --shadow-1: 0 1px 2px rgba(17, 26, 49, 0.06), 0 4px 12px rgba(17, 26, 49, 0.06);
  --shadow-2: 0 2px 4px rgba(17, 26, 49, 0.05), 0 12px 32px rgba(17, 26, 49, 0.1);
  --shadow-3: 0 4px 8px rgba(17, 26, 49, 0.06), 0 24px 60px rgba(17, 26, 49, 0.16);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 64px);
}

body {
  margin: 0;
  background-color: var(--washi);
  /* washi fibre: stitched turbulence tile, very faint */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8 .05' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .11 0 0 0 0 .16 0 0 0 0 .3 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  color: var(--sumi);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--shu); }

:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--ai);
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
  font-weight: 700;
}

p, li { text-wrap: pretty; }
p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(72px, 10vw, 136px); position: relative; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ai);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
}
.skip:focus { top: 12px; }

/* ---------- type utilities ---------- */

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nezumi);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); letter-spacing: -0.01em; }
.lede { font-size: clamp(1.08rem, 1.5vw, 1.24rem); color: var(--nezumi); max-width: 62ch; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.jp { font-family: var(--f-display); font-feature-settings: "palt"; }

/* section heading with a vertical Japanese label */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.sec-head__jp {
  writing-mode: vertical-rl;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: 0.25em;
  color: var(--shu-deep);
  line-height: 1;
  padding-top: 6px;
  border-left: 1px solid var(--line-strong);
  padding-left: clamp(10px, 1.6vw, 18px);
}
.sec-head .lede { margin-top: 18px; }

/* ---------- seal (hanko) ---------- */

.seal {
  --size: 64px;
  width: var(--size);
  height: var(--size);
  display: inline-grid;
  place-items: center;
  background: var(--shu);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: calc(var(--size) * 0.5);
  line-height: 1;
  border-radius: 14%;
  box-shadow: inset 0 0 0 calc(var(--size) * 0.06) var(--shu), inset 0 0 0 calc(var(--size) * 0.085) rgba(255, 255, 255, 0.9);
  transform: rotate(-6deg);
  /* worn-ink speckle */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 2.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 2.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 160px 160px;
  mask-size: 160px 160px;
  flex: none;
}
.seal--sm { --size: 40px; }
.seal--xs { --size: 30px; }
.seal--lg { --size: 96px; }
.seal--word { font-size: calc(var(--size) * 0.32); letter-spacing: 0.02em; writing-mode: vertical-rl; }

/* ---------- buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: 500 0.98rem/1 var(--f-body);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition-property: transform, background-color, box-shadow, color;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-ui);
}
.btn:active { transform: scale(0.96); }
.btn--shu { background: var(--shu); color: #fff; box-shadow: 0 6px 20px rgba(198, 62, 41, 0.35); }
.btn--shu:hover { background: var(--shu-deep); }
.btn--glass {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn--glass:hover { background: rgba(255, 255, 255, 0.24); }
.btn--ghost { background: transparent; color: var(--ai); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { background: rgba(28, 42, 78, 0.06); }
.btn svg { width: 18px; height: 18px; flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 0.72rem/1 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(28, 42, 78, 0.07);
  color: var(--ai);
  white-space: nowrap;
}
.chip--shu { background: rgba(198, 62, 41, 0.1); color: var(--shu-deep); }
.chip--matsu { background: rgba(61, 91, 72, 0.12); color: var(--matsu); }
.chip--kin { background: rgba(201, 154, 69, 0.16); color: #7a5a1c; }

/* ---------- media ---------- */

.ph {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--washi-2);
  isolation: isolate;
}
.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.credit-tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  font: 0.62rem/1 var(--f-mono);
  color: rgba(255, 255, 255, 0.85);
  background: rgba(17, 26, 49, 0.45);
  padding: 4px 6px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- reveal choreography (only when JS is running) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js [data-reveal="scale"] { transform: scale(0.97); }
.js [data-reveal="scale"].is-in { transform: none; }

@keyframes stamp {
  0% { opacity: 0; transform: scale(1.7) rotate(-18deg); }
  55% { opacity: 1; transform: scale(0.92) rotate(-4deg); }
  100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}
.js [data-stamp] { opacity: 0; }
.js [data-stamp].is-in { animation: stamp 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal], .js [data-stamp] { opacity: 1; transform: none; }
}
