/* =============================================
   BASE — hirasawa-official.com
   variables / reset / fonts / scroll reveal
   Palette: 深緑 (deep pine) × 真鍮 (brass) × 陶土 (terracotta)
   ============================================= */

:root {
  --font-display-jp: 'Shippori Mincho B1', 'Noto Serif JP', serif;
  --font-body-jp: 'Noto Serif JP', serif;
  --font-sans-jp: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  --font-display-en: 'Cormorant Garamond', serif;
  --font-mono: 'Space Mono', monospace;

  --maxw: 1180px;
}

/* ---- Dark theme (default) — 深緑 × 真鍮 ---- */
body.theme-dark {
  --bg:      #0C1512;
  --bg2:     #101D18;
  --bg3:     #14251E;
  --surface: #172C24;
  --surface2:#1D3529;

  --border:  #24402F;
  --border2: #1B3025;

  --text:   #F2EDE2;
  --text2:  #CBD6CB;
  --text3:  #9AAB9E;
  --text4:  #6C8074;
  --text5:  #43584B;

  --brass:      #D3A85E;
  --brass-soft: #B78F49;
  --brass-glow: #EBC784;
  --clay:       #DD8A62;
  --clay-soft:  #B96F4C;

  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body-jp);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

/* ---- Light theme (下層ページ) — 生成り × 深緑 ---- */
body.theme-light {
  --bg:      #F7F5EF;
  --bg2:     #FFFFFF;
  --bg3:     #EFEDE4;
  --surface: #FFFFFF;
  --surface2:#F2F0E7;

  --border:  #E0DDD0;
  --border2: #EAE7DC;

  --text:   #17231D;
  --text2:  #33473C;
  --text3:  #5C6F64;
  --text4:  #8A9990;
  --text5:  #B6C0B8;

  --brass:      #9A7527;
  --brass-soft: #B08B39;
  --brass-glow: #C79A45;
  --clay:       #B4623C;
  --clay-soft:  #C57E58;

  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body-jp);
  font-weight: 400;
  line-height: 1.95;
  letter-spacing: 0.02em;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}
body { width: 100%; position: relative; }

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

a { color: inherit; }

::selection { background: var(--brass); color: #0C1512; }

/* Skip link */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 2000;
  background: #14251E;
  color: #F2EDE2;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; outline: 2px solid var(--brass); }
:target { scroll-margin-top: 96px; }

/* Mobile safety net for long unbreakable strings */
@media (max-width: 720px) {
  p, li, h1, h2, h3, h4, blockquote, td, th, .lead {
    overflow-wrap: break-word;
    word-break: normal;
  }
}

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s ease, transform .9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
