/* ================================================================
   BASE — Resets, Typography, Global Defaults
   ================================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Cormorant:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---- Reset ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

body.nav-open {
  overflow: hidden;
}

/* ---- Film grain texture overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-ink);
}

::-webkit-scrollbar-thumb {
  background: var(--color-slate);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-stone);
}

/* ---- Base Elements ---- */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  letter-spacing: var(--ls-tight);
  line-height: 0.95;
}

h2 {
  font-size: var(--fs-3xl);
  letter-spacing: var(--ls-tight);
}

h3 {
  font-size: var(--fs-xl);
}

h4 {
  font-size: var(--fs-lg);
}

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

::selection {
  background: rgba(194, 149, 90, 0.25);
  color: var(--color-cream);
}

/* ---- Focus States ---- */
:focus-visible {
  outline: 2px solid var(--color-hinoki);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Reveal Animation Base ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }
.reveal-d5 { transition-delay: 0.5s; }
.reveal-d6 { transition-delay: 0.6s; }

/* ---- Japanese Decorative Elements ---- */
.jp-char {
  font-size: var(--fs-xs);
  color: var(--color-stone);
  letter-spacing: var(--ls-wider);
  font-weight: var(--fw-light);
  opacity: 0.5;
}

.divider-line {
  width: 60px;
  height: 1px;
  background: var(--border-medium);
  display: block;
}

.divider-line--accent {
  background: linear-gradient(90deg, var(--color-hinoki), transparent);
}

/* ---- Utility Classes ---- */
.text-accent  { color: var(--text-accent); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-upper   { text-transform: uppercase; letter-spacing: var(--ls-wider); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
