/* ============================================================
   JP Tokyo Travels — Design Tokens & Theme

   To change the site's color scheme, edit ONLY the :root block.
   Colors are in RGB channel format for Tailwind alpha support.
   ============================================================ */

:root {
  /* PRIMARY */
  --color-indigo: 30 42 74;         /* #1E2A4A — authority, depth */
  --color-midnight: 15 22 40;       /* #0F1628 — dark sections, footer */

  /* ACCENT */
  --color-cinnabar: 196 66 48;      /* #C44230 — energy, action */
  --color-gold: 184 150 62;         /* #B8963E — premium, trust */

  /* NEUTRAL */
  --color-warm-white: 246 243 237;  /* #F6F3ED — primary bg */
  --color-stone: 228 222 211;       /* #E4DED3 — secondary bg */
  --color-warm-gray: 95 91 86;       /* #5F5B56 — secondary text (darkened for contrast) */
  --color-charcoal: 28 28 30;       /* #1C1C1E — primary text */

  /* FUNCTIONAL */
  --color-success: 45 106 79;       /* #2D6A4F */
  --color-line: 212 207 198;        /* #D4CFC6 — borders, dividers */
}

/* ============================================================
   Paper texture overlay — subtle washi paper grain
   ============================================================ */
.paper-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.paper-texture {
  position: relative;
}

.paper-texture > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Underline-style form inputs (Japanese stationery influence)
   ============================================================ */
.input-underline {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgb(var(--color-line));
  border-radius: 0;
  padding: 0.75rem 0;
  width: 100%;
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  color: rgb(var(--color-charcoal));
  transition: border-color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  outline: none;
}

.input-underline:focus {
  border-bottom-color: rgb(var(--color-indigo));
  border-bottom-width: 2px;
}

.input-underline::placeholder {
  color: rgb(var(--color-warm-gray));
}

textarea.input-underline {
  resize: vertical;
  min-height: 120px;
}

/* ============================================================
   Nav transition (transparent → solid)
   ============================================================ */
.nav-transparent {
  background: transparent;
  box-shadow: none;
}

.nav-solid {
  background: rgb(var(--color-warm-white));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Nav text colors — default (light bg) */
.nav-brand { color: rgb(var(--color-indigo)); }
.nav-item { color: rgb(var(--color-charcoal)); }
.nav-item:hover { color: rgb(var(--color-cinnabar)); }
.nav-lang { color: rgb(var(--color-warm-gray)); }
.nav-lang:hover { color: rgb(var(--color-charcoal)); }
.nav-burger span { background: rgb(var(--color-charcoal)); }

/* Nav text colors — dark bg variant (add .nav-dark to <nav>) */
.nav-dark.nav-transparent .nav-brand { color: white; }
.nav-dark.nav-transparent .nav-item { color: rgba(255,255,255,0.8); }
.nav-dark.nav-transparent .nav-item:hover { color: white; }
.nav-dark.nav-transparent .nav-lang { color: rgba(255,255,255,0.5); }
.nav-dark.nav-transparent .nav-lang:hover { color: rgba(255,255,255,0.8); }
.nav-dark.nav-transparent .nav-burger span { background: white; }

/* ============================================================
   Scroll reveal base state
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for children */
[data-reveal-delay="1"] { transition-delay: 0.15s; }
[data-reveal-delay="2"] { transition-delay: 0.3s; }
[data-reveal-delay="3"] { transition-delay: 0.45s; }
[data-reveal-delay="4"] { transition-delay: 0.6s; }

/* ============================================================
   Nav underline slide-in
   ============================================================ */
.nav-link-underline {
  position: relative;
}

.nav-link-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: rgb(var(--color-cinnabar));
  transition: width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav-link-underline:hover::after,
.nav-link-underline.active::after {
  width: 100%;
}

.nav-link-underline:focus-visible {
  outline: 2px solid rgb(var(--color-cinnabar));
  outline-offset: 4px;
  border-radius: 2px;
}

/* Global focus-visible for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgb(var(--color-indigo));
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Gold top-border service cards
   ============================================================ */
.service-card {
  border-top: 4px solid rgb(var(--color-gold));
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   Button hover states
   ============================================================ */
.btn-cinnabar {
  background: rgb(var(--color-cinnabar));
  color: white;
  transition: background 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-cinnabar:hover {
  background: rgb(176 56 38);
  transform: scale(1.02);
}

/* ============================================================
   Decorative gold quotation mark
   ============================================================ */
.quote-mark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 8rem;
  line-height: 1;
  color: rgb(var(--color-gold) / 0.15);
  position: absolute;
  top: -1.5rem;
  left: -0.5rem;
  pointer-events: none;
  user-select: none;
}

/* ============================================================
   Timeline vertical gold line
   ============================================================ */
.timeline-line {
  position: absolute;
  left: 1.25rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgb(var(--color-gold));
}

@media (min-width: 768px) {
  .timeline-line {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ============================================================
   Thin horizontal rule (Japanese stationery influence)
   ============================================================ */
.rule-gold {
  border: none;
  height: 1px;
  background: rgb(var(--color-gold) / 0.3);
}

/* ============================================================
   Mobile menu overlay
   ============================================================ */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgb(var(--color-warm-white));
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   Hero scroll indicator
   ============================================================ */
@keyframes scroll-hint {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(8px); opacity: 1; }
}

.scroll-indicator {
  animation: scroll-hint 2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

/* ============================================================
   CJK font adjustments — when Japanese is active
   ============================================================ */
html[lang="ja"] body {
  font-family: 'Sora', 'Noto Sans JP', sans-serif;
}

html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] .font-display {
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
}

/* ============================================================
   ============================================================
   EDITORIAL LAYER (Option E — scrollytelling magazine)

   A layered set of utilities that extend the base "Measured
   Authority" system with a print-magazine vocabulary:
     - 12-col grid guides faintly visible behind hero/sections
     - Issue metadata bar ("Vol. XI · Spring 2026 · …")
     - Chapter labels / oversized chapter numerals
     - Cormorant display headline + italic + drop caps
     - Caption pill overlays on editorial images
     - Kintsugi-like dashed gold seam SVG
     - Journey ruler progress track (Arrival → Sayonara)
   ============================================================
   ============================================================ */

/* 12-col guide lines — faint vertical rules behind hero */
.editorial-grid-guides {
  position: absolute;
  inset: 0;
  display: none;
  grid-template-columns: repeat(12, 1fr);
  pointer-events: none;
  z-index: 0;
}
@media (min-width: 1024px) {
  .editorial-grid-guides { display: grid; }
}
.editorial-grid-guides > span {
  display: block;
  border-left: 1px solid rgb(var(--color-indigo) / 0.05);
}
.editorial-grid-guides > span:first-child,
.editorial-grid-guides > span:last-child { border-left: none; }

/* Hero-grade Cormorant display headline */
.display-serif-xl {
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: rgb(var(--color-indigo));
  font-size: clamp(2.75rem, 7vw, 5.5rem);
}
.display-serif-lg {
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: rgb(var(--color-indigo));
  font-size: clamp(2rem, 4.5vw, 3.5rem);
}
.display-italic { font-style: italic; }

/* Drop cap on first paragraph of an editorial column */
.drop-cap::first-letter {
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
  font-weight: 500;
  float: left;
  font-size: 3.8rem;
  line-height: 0.85;
  margin: 0.35rem 0.5rem 0 0;
  color: rgb(var(--color-indigo));
}
/* Drop caps don't translate well across CJK — skip on JA */
html[lang="ja"] .drop-cap::first-letter {
  float: none;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  color: inherit;
  font-family: inherit;
}

/* CJK line breaking for editorial display — keep words intact, allow breaks
   only at Japanese punctuation / kana boundaries, and trim the display size
   since Mincho-family glyphs are roughly 1.3× wider than Latin. */
html[lang="ja"] .display-serif-xl,
html[lang="ja"] .display-serif-lg {
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
  line-height: 1.15;
  letter-spacing: 0;
}
html[lang="ja"] .display-serif-xl {
  font-size: clamp(2rem, 5.2vw, 4rem);
}
html[lang="ja"] .display-serif-lg {
  font-size: clamp(1.6rem, 3.6vw, 2.75rem);
}

/* Kintsugi-like dashed gold seam overlay */
.kintsugi-seam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: rgb(var(--color-gold));
}
.kintsugi-seam path {
  stroke: currentColor;
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 3 4;
  opacity: 0.7;
}

/* Caption pill — bottom corner badge on editorial images */
.caption-pill {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgb(var(--color-warm-white));
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(var(--color-indigo));
  font-weight: 500;
}

/* Journey ruler — discrete stops tied to real content sections.
   Each [data-journey-stop] section on the page (Hero, Value, Services,
   Features, CTA) becomes one of the 5 labels. The dot snaps to the
   active stop with a smooth 500ms ease when a section crosses the
   viewport midline. The smoothness is intentional here (unlike
   scroll-linked motion): the dot travels discrete distances between
   stops, and the eased slide reads as "advancing through chapters"
   rather than "chasing scroll". */
.journey-ruler {
  --progress: 0;
  width: 100%;
}
.journey-ruler__track {
  position: relative;
  height: 1px;
  background: rgb(var(--color-indigo) / 0.15);
}
.journey-ruler__dot {
  position: absolute;
  top: -4px;
  left: calc(var(--progress) * 100%);
  width: 9px;
  height: 9px;
  background: rgb(var(--color-cinnabar));
  border-radius: 50%;
  transform: translate3d(-50%, 0, 0);
  transition: left 750ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: left;
  box-shadow: 0 0 0 3px rgb(var(--color-warm-white));
}
/* Labels are absolutely positioned at exact dot percentages (0, 25, 50,
   75, 100) so each icon sits directly beneath its corresponding dot
   position. An equal 5-col grid would put cell centres at 10/30/50/70/90
   instead — misaligned with the dot. First and last are pinned to the
   edges; middle three are centred on their percentage via translateX. */
.journey-ruler__labels {
  position: relative;
  min-height: 2.75rem;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(var(--color-warm-gray));
}
.journey-ruler__labels > span {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  transition: color 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
/* All 5 labels centred on their progress percentage so icon centres
   align with dot centres (not edges). First/last overflow into the
   container's surrounding padding by 10px each — the .max-w-screen-xl
   wrapper has 32px+ horizontal padding, plenty of room. */
.journey-ruler__labels > span:nth-child(1) { left: 0; }
.journey-ruler__labels > span:nth-child(2) { left: 25%; }
.journey-ruler__labels > span:nth-child(3) { left: 50%; }
.journey-ruler__labels > span:nth-child(4) { left: 75%; }
.journey-ruler__labels > span:nth-child(5) { left: 100%; }
.journey-ruler__icon {
  width: 20px;
  height: 20px;
  color: rgb(var(--color-indigo) / 0.4);
  transition: color 400ms cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
/* Highlight the currently-active label — text and icon both
   light up in cinnabar (icon) + indigo (text). */
.journey-ruler__labels > span[data-journey-active="true"] {
  color: rgb(var(--color-indigo));
  font-weight: 500;
}
.journey-ruler__labels > span[data-journey-active="true"] .journey-ruler__icon {
  color: rgb(var(--color-cinnabar));
}

/* Sticky container for the journey ruler. Pins the ruler to the bottom
   of the viewport while the user scrolls through the .journey-context
   (hero → CTA), then releases when the last tracked section scrolls
   past. Hidden below lg — too much vertical real estate on mobile. */
.journey-ruler-pin {
  display: none;
}
@media (min-width: 1024px) {
  .journey-ruler-pin {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding: 14px 0 16px;
    background: rgb(var(--color-warm-white) / 0.85);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border-top: 1px solid rgb(var(--color-line));
  }
}

/* Print-style gold hairline — opaque variant for within-section dividers */
.editorial-rule-gold {
  border: none;
  height: 1px;
  background: rgb(var(--color-gold) / 0.4);
}

/* "Read the feature →" text link used alongside hero CTA */
.link-read-feature {
  color: rgb(var(--color-indigo));
  font-family: 'Sora', 'Noto Sans JP', sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}
.link-read-feature:hover { color: rgb(var(--color-cinnabar)); }

/* Marginalia sidebar (used on contact page) */
.marginalia {
  border-left: 1px solid rgb(var(--color-gold) / 0.4);
  padding-left: 1.5rem;
}

/* Back-to-top button (fixed bottom-left, all pages). Warm-white glass
   with indigo thin-stroke arrow — same palette as the journey ruler pin
   and the editorial cards. Fades in after scrollY > 400. On desktop
   home the journey ruler pins to the bottom, so we lift this button
   above it via :has() (supported in every evergreen browser since 2023). */
.to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--color-line));
  border-radius: 9999px;
  background: rgb(var(--color-warm-white) / 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgb(var(--color-indigo));
  box-shadow: 0 4px 16px rgba(15, 22, 40, 0.08);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 200ms ease,
              background 200ms ease,
              color 200ms ease;
}
.to-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.to-top-btn:hover {
  border-color: rgb(var(--color-cinnabar));
  background: rgb(var(--color-warm-white));
  color: rgb(var(--color-cinnabar));
}
.to-top-btn svg {
  width: 18px;
  height: 18px;
}
/* Lift above the journey ruler pin on desktop home */
@media (min-width: 1024px) {
  body:has(.journey-context) .to-top-btn {
    bottom: 96px;
  }
}

/* Timeline editorial "Entry · YYYY" year chip */
.year-chip {
  display: inline-block;
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
  font-size: 1.75rem;
  line-height: 1;
  color: rgb(var(--color-indigo));
  border-bottom: 1px solid rgb(var(--color-gold));
  padding-bottom: 4px;
  letter-spacing: 0.02em;
}
