/* ============================================================
   ICHIYAJO Showcase — Base styles
   Modern reset + typography foundation + lang split
   spec §2.3, §2.4
   ============================================================ */

/* ─── Modern reset (Andy Bell-flavoured) ─────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[role="list"], ol[role="list"] {
  list-style: none;
  padding: 0;
}

html:focus-within { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a:not([class]) { text-decoration-skip-ink: auto; }

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

p, li, dt, dd, blockquote {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  text-wrap: balance;
}

/* Remove animations and transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Root document ──────────────────────────────────── */

html {
  background: var(--ink);
  color: var(--paper);
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-weight: var(--fw-regular);

  /* JP-friendly word breaking — never break mid-word in latin */
  word-break: keep-all;
  overflow-wrap: anywhere;

  /* Tabular figures by default for the modern "data" feel */
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ─── Language-aware line-height ─────────────────────── */
/* Spec §2.3: JP 1.75 (relaxed) / EN 1.5 (normal)        */

:lang(ja) {
  line-height: var(--leading-relaxed);
  /* palt = proportional alternate metrics for JP punctuation */
  font-feature-settings: "palt" 1, "kern" 1;
}

:lang(en) {
  line-height: var(--leading-normal);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Numbers get tabular figures (for stable pricing / counters) */
.tnum,
.font-mono {
  font-feature-settings: "tnum" 1, "kern" 1;
  font-variant-numeric: tabular-nums;
}

/* ─── Headings ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-tight);
  color: var(--paper);
}

h1 { font-size: var(--text-5xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); line-height: var(--leading-snug); }
h5 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h6 { font-size: var(--text-lg); line-height: var(--leading-snug); }

/* ─── Paragraphs ─────────────────────────────────────── */

p { color: var(--paper-soft); }
p strong { color: var(--paper); font-weight: var(--fw-semibold); }

/* ─── Links ──────────────────────────────────────────── */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--gold-a40);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--dur-fast) var(--easing-default),
              color var(--dur-fast) var(--easing-default);
}

a:hover {
  text-decoration-color: var(--gold-light);
  color: var(--paper);
}

a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ─── Inline emphasis ────────────────────────────────── */

strong { font-weight: var(--fw-semibold); color: var(--paper); }
em { font-style: italic; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--gold-a08);
  border: 1px solid var(--gold-a15);
  padding: 0.08em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--gold-light);
}

/* ─── Lists ──────────────────────────────────────────── */

ul, ol { padding-left: 1.25em; }
ul li::marker { color: var(--gold); }
ol li::marker { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ─── Quotes / horizontal rules ─────────────────────── */

blockquote {
  border-left: 1px solid var(--gold-a40);
  padding-left: var(--space-md);
  margin-block: var(--space-md);
  color: var(--paper-soft);
  font-style: italic;
}

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-a40) 0%, transparent 100%);
  margin-block: var(--space-lg);
}

/* ─── Form basics ────────────────────────────────────── */

input, textarea, select {
  background: var(--ink-soft);
  border: 1px solid var(--gold-a25);
  color: var(--paper);
  padding: 0.75em 1em;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: border-color var(--dur-fast) var(--easing-default);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px var(--gold-a15);
}

input::placeholder, textarea::placeholder {
  color: var(--paper-mute);
}

button {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
}

/* ─── Selection ──────────────────────────────────────── */

::selection {
  background: var(--gold);
  color: var(--ink);
}

/* ─── Scrollbar (webkit / firefox) ───────────────────── */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-a40) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--gold-a40);
  border-radius: var(--radius-full);
}
*::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─── Utility: hide visually but keep accessible ─────── */

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

/* ─── Utility: focus ring rule for keyboard users ────── */

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

/* ─── Utility: micro-label / eyebrow ────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold);
  font-weight: var(--fw-medium);
}

.eyebrow::before {
  content: "";
  width: 1.5em;
  height: 1px;
  background: var(--gold);
}

/* ─── Utility: hairline gold rule ────────────────────── */

.hairline {
  height: 1px;
  background: linear-gradient(90deg,
    var(--gold-a40) 0%,
    var(--gold-a25) 60%,
    transparent 100%);
  border: 0;
  margin: 0;
}

/* ─── Cursor: hide native when custom is active ──────── */
/* (Implemented in cursor.js, this is the static piece)  */

[data-pointer="fine"][data-motion="full"] body {
  cursor: none;
}
[data-pointer="fine"][data-motion="full"] a,
[data-pointer="fine"][data-motion="full"] button,
[data-pointer="fine"][data-motion="full"] input,
[data-pointer="fine"][data-motion="full"] textarea {
  cursor: none;
}
