/* ippun — Light Matcha (Zen Minimalist)
   Exact theme tokens mirrored from src/theme/palettes/light.ts
   Fonts & aesthetic match stitch-style-ref/light_theme/code.html */

:root {
  /* Core palette — from lightPalette */
  --background: #F8F9FA;
  --surface: #FFFFFF;
  --primary: #5A8A6A;              /* Matcha green, muted, earthy */
  --accent-secondary: #D4A017;     /* Warm gold */
  --primary-contrast: #FFFFFF;

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;

  /* Borders & subtle surfaces */
  --card-border: rgba(0, 0, 0, 0.05);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --accent-bg: rgba(90, 138, 106, 0.08);
  --badge-bg: rgba(90, 138, 106, 0.10);
  --badge-border: rgba(90, 138, 106, 0.25);

  /* Soft shadows — the "soft" shadow style of the light theme */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 8px 30px rgba(90, 138, 106, 0.10);

  /* Typography — matches tailwind.config.fontFamily */
  --font-headline: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-kanji: "Noto Sans JP", sans-serif;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Radial dot pattern — the signature background of the light theme reference */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: radial-gradient(circle at 2px 2px, #cbd5e1 1px, transparent 0);
  background-size: 40px 40px;
}

/* Soft matcha glow bloom, echoes the reference's primary/5 blurred circles */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(500px circle at 85% 35%, rgba(90, 138, 106, 0.06), transparent 60%),
    radial-gradient(400px circle at 10% 75%, rgba(212, 160, 23, 0.04), transparent 60%);
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ─── Layout ─────────────────────────────────────────── */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap-wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ─── Header ─────────────────────────────────────────── */

.site-header {
  padding: 1.5rem 0;
  background: rgba(248, 249, 250, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

nav.primary {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav.primary a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.2s ease;
  border-bottom: none;
}

nav.primary a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

nav.primary a:hover,
nav.primary a[aria-current="page"] {
  color: var(--text-primary);
}

nav.primary a[aria-current="page"]::after,
nav.primary a:hover::after {
  transform: scaleX(1);
}

/* ─── Hero / Landing ─────────────────────────────────── */

.hero {
  padding: 6rem 0 5rem;
  text-align: center;
  position: relative;
}

.hero .eyebrow {
  display: inline-block;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
}

.hero .eyebrow .jp {
  font-family: var(--font-kanji);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-right: 0.35rem;
}

.hero h1 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
  color: var(--text-primary);
}

.hero h1 .accent {
  color: var(--primary);
  font-weight: 700;
}

.hero .lede {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 44ch;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.75rem;
  background: var(--primary);
  color: var(--primary-contrast);
  text-decoration: none;
  border-radius: 999px;
  font-family: var(--font-headline);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-bottom: none;
}

.hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(90, 138, 106, 0.18);
  color: var(--primary-contrast);
}

.hero-cta-note {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* Giant ghost kanji behind the hero — "一" (one) for "ippun / 一分" */
.hero-kanji-ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  font-family: var(--font-kanji);
  font-weight: 900;
  font-size: clamp(18rem, 45vw, 32rem);
  color: var(--primary);
  opacity: 0.04;
  line-height: 1;
  letter-spacing: -0.05em;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}

/* ─── Sections ───────────────────────────────────────── */

section {
  padding: 4rem 0;
}

section + section {
  border-top: 1px solid var(--border-subtle);
}

.section-label {
  display: inline-block;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 2.25rem 0 0.75rem;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1.1rem;
  max-width: var(--measure);
  color: var(--text-secondary);
  font-weight: 400;
}

p strong { color: var(--text-primary); font-weight: 600; }

a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(90, 138, 106, 0.3);
  transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* Features grid on landing */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(90, 138, 106, 0.20);
}

.feature .feature-num {
  display: inline-block;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  color: var(--primary);
  margin-bottom: 1rem;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-headline);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.feature p {
  font-size: 0.925rem;
  margin: 0;
  line-height: 1.55;
}

/* ─── Document pages (support, privacy) ──────────────── */

.doc-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-header .kicker {
  display: inline-block;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
}

.doc-header h1 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}

.doc-header .updated {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 400;
}

.doc-body {
  padding: 2.5rem 0 4rem;
}

.doc-body ul {
  padding-left: 1.25rem;
  margin: 0 0 1.25rem;
  max-width: var(--measure);
  color: var(--text-secondary);
}

.doc-body li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.doc-body li::marker {
  color: var(--primary);
}

/* Contact card */
.contact-card {
  margin-top: 2rem;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--primary);
  border-radius: 16px;
  max-width: var(--measure);
  box-shadow: var(--shadow-sm);
}

.contact-card .label {
  font-family: var(--font-headline);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.contact-card .value {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  letter-spacing: -0.01em;
}

.contact-card .value a {
  color: var(--text-primary);
  border-bottom: 1.5px solid var(--primary);
}

.contact-card .value a:hover {
  color: var(--primary);
}

/* FAQ */
.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  max-width: var(--measure);
}

.faq-item:last-of-type { border-bottom: none; }

.faq-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-family: var(--font-headline);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.faq-item p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--accent-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ─── Footer ─────────────────────────────────────────── */

.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.825rem;
  color: var(--text-tertiary);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer .colophon {
  font-family: var(--font-headline);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.site-footer nav {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--text-secondary);
  border-bottom: none;
  font-family: var(--font-body);
  font-weight: 500;
}

.site-footer a:hover { color: var(--primary); }

/* ─── Animations ─────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero .eyebrow   { animation: rise 0.7s ease 0.05s both; }
.hero h1         { animation: rise 0.7s ease 0.15s both; }
.hero .lede      { animation: rise 0.7s ease 0.30s both; }
.hero-cta        { animation: rise 0.7s ease 0.45s both; }
.hero-cta-note   { animation: rise 0.7s ease 0.55s both; }

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

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 640px) {
  .site-header { padding: 1rem 0; }
  nav.primary { gap: 1.25rem; }
  nav.primary a { font-size: 0.825rem; }
  .hero { padding: 4rem 0 3rem; }
  .hero-kanji-ghost { font-size: 18rem; }
  section { padding: 3rem 0; }
  .feature { padding: 1.5rem; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
  .site-footer nav { gap: 1.25rem; }
}
