/* ==========================================================================
   PAGE/OUT — WEB MAGAZINE NEXT (REV.01)
   Shared Design Tokens, Typography, Masthead, Doorway/Light/Kintsugi Motifs
   ========================================================================== */

@font-face {
  font-family: "IssueMin";
  src: url("../assets/fonts/home-headings.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

:root {
  /* Core Paper & Ink */
  --paper: #f5f2eb;
  --paper-bright: #faf8f5;
  --paper-warm: #ebe5d9;
  --paper-tint: #e3ded2;
  --ink: #1a1a1a;
  --ink-deep: #182320;
  --ink-soft: #4e5752;
  --ink-muted: #6c746e;

  /* Brand & Architectural Palette (from Print + 7 Reference Design Rooms) */
  --forest: #123028;
  --forest-mid: #1d4a3f;
  --terracotta: #b84a39;
  --terracotta-soft: #cf6b58;
  --brass: #b58b42;
  --brass-bright: #d4b06a;
  --brass-dim: rgba(181, 139, 66, 0.34);
  --verdigris: #2d5e56;
  --ultramarine: #1c3152;
  --lacquer: #171a19;

  /* Work-Specific Authentic Palettes */
  --work-reunier-bg: #182124;
  --work-reunier-accent: #c89b4b;
  --work-flow-bg: #0c2a35;
  --work-flow-accent: #d6af66;
  --work-book-bg: #ebe1cc;
  --work-book-accent: #b84a39;
  --work-comic-bg: #171b36;
  --work-comic-accent: #c43a5e;

  /* Hairlines & Elevation */
  --rule: rgba(26, 26, 26, 0.16);
  --rule-strong: rgba(26, 26, 26, 0.72);
  --rule-brass: linear-gradient(90deg, transparent, var(--brass), var(--brass-bright), var(--brass), transparent);
  --shadow-soft: 0 18px 42px -24px rgba(18, 30, 26, 0.24);
  --shadow-door: 0 24px 56px -22px rgba(14, 24, 21, 0.34);

  /* Typography */
  --font-serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "Shippori Mincho", "BIZ UDMincho", Georgia, serif;
  --font-display: "Arial Black", "Helvetica Neue", "Inter", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-sans: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "BIZ UDPGothic", sans-serif;
  --font-editorial-num: "Georgia", "Times New Roman", "Yu Mincho", serif;

  /* Layout & Spacing */
  --container: min(1340px, calc(100% - clamp(32px, 6vw, 112px)));
  --mast-h: 72px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--mast-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

figure,
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

/* Focus & Accessibility */
:focus-visible {
  outline: 2.5px solid var(--terracotta);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--forest);
  color: var(--paper-bright);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-xs);
}

.skip-link:focus {
  left: 12px;
}

.wrap {
  width: var(--container);
  margin-inline: auto;
}

/* ==========================================================================
   Subtle Dappled Sunlight (木漏れ日) & Plaster Grain Layer
   Inspired by the morning sunlight on plaster walls across all 7 ref images
   ========================================================================== */

.sunlight-wash {
  position: relative;
}

.sunlight-wash::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 46% 36% at 12% 18%, rgba(255, 240, 206, 0.56), transparent 72%),
    radial-gradient(ellipse 30% 28% at 24% 48%, rgba(244, 221, 178, 0.28), transparent 70%),
    radial-gradient(ellipse 38% 30% at 88% 14%, rgba(201, 164, 92, 0.12), transparent 68%),
    linear-gradient(122deg, rgba(18, 48, 40, 0.03) 0%, transparent 34%, rgba(181, 139, 66, 0.04) 68%, transparent 100%);
}

.sunlight-wash > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Kintsugi (金継ぎ) Hairline Seam Divider
   ========================================================================== */

.kintsugi-rule {
  display: block;
  width: 100%;
  height: 18px;
  overflow: visible;
  margin-block: clamp(40px, 5vw, 72px);
}

.kintsugi-rule path.seam-base {
  fill: none;
  stroke: rgba(26, 26, 26, 0.14);
  stroke-width: 1;
}

.kintsugi-rule path.seam-gold {
  fill: none;
  stroke: url(#kintsugi-grad);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ==========================================================================
   Editorial Section Eyebrow & Typography Utilities
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1.5px;
  background: currentColor;
  flex-shrink: 0;
}

.editorial-h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.2vw, 2.85rem);
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
  text-wrap: balance;
}

.editorial-h2 .dot {
  color: var(--terracotta);
}

.folio-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-brass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-xs);
  transition: background-color 0.22s var(--ease-editorial), color 0.22s var(--ease-editorial), border-color 0.22s var(--ease-editorial), transform 0.22s var(--ease-editorial);
}

.btn-primary {
  background: var(--forest);
  color: var(--paper-bright);
  border: 1px solid var(--forest);
}

.btn-primary:hover {
  background: var(--forest-mid);
  border-color: var(--forest-mid);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--ink-deep);
  border: 1px solid var(--rule-strong);
}

.btn-secondary:hover {
  background: var(--ink-deep);
  color: var(--paper-bright);
  transform: translateY(-1px);
}

.btn-brass {
  background: linear-gradient(135deg, #213731 0%, #123028 100%);
  color: var(--paper-bright);
  border: 1px solid var(--brass);
  box-shadow: inset 0 0 0 1px rgba(212, 176, 106, 0.25);
}

.btn-brass:hover {
  background: linear-gradient(135deg, #2b4a42 0%, #173d33 100%);
  border-color: var(--brass-bright);
  transform: translateY(-1px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-deep);
  position: relative;
}

.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  height: 1px;
  background: var(--brass);
  transition: background-color 0.2s, transform 0.25s var(--ease-editorial);
}

.text-link:hover {
  color: var(--terracotta);
}

.text-link:hover::after {
  background: var(--terracotta);
}

/* ==========================================================================
   Universal Masthead (全画面共通)
   PAGE/OUT / ISSUE 00 / 創刊準備号 / 物語を、ページの外へ。
   ========================================================================== */

.site-mast {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(245, 242, 235, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-strong);
}

.site-mast__inner {
  width: var(--container);
  margin-inline: auto;
  min-height: var(--mast-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 8px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  flex-shrink: 0;
}

.site-brand__wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1;
  letter-spacing: -0.07em;
  color: var(--ink-deep);
}

.site-brand__wordmark span {
  color: var(--terracotta);
  padding-inline: 1px;
}

.site-brand__meta {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  border-left: 1px solid var(--rule);
  line-height: 1.25;
}

.site-brand__issue {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink-deep);
}

.site-brand__copy {
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.8vw, 24px);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-deep);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

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

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 8px;
  height: 2px;
  background: var(--terracotta);
}

.site-nav__paper {
  padding: 0 14px !important;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: var(--paper-bright) !important;
  border-radius: var(--radius-xs);
  font-size: 13px !important;
  gap: 6px;
}

.site-nav__paper:hover {
  background: var(--forest-mid);
  border-color: var(--forest-mid);
  color: var(--paper-bright) !important;
}

.site-nav__paper[aria-current="page"] {
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.site-nav__paper[aria-current="page"]::after {
  display: none;
}

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-bright);
  color: var(--ink-deep);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-drawer {
  display: none;
  border-top: 1px solid var(--rule);
  background: var(--paper-bright);
}

.site-drawer.is-open {
  display: block;
}

.site-drawer__inner {
  width: var(--container);
  margin-inline: auto;
  padding-block: 14px 18px;
  display: grid;
  gap: 4px;
}

.site-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  font-weight: 600;
}

.site-drawer a:last-child {
  border-bottom: 0;
}

/* ==========================================================================
   Unified Editorial Footer
   ========================================================================== */

.site-footer {
  margin-top: clamp(64px, 8vw, 112px);
  background: var(--forest);
  color: var(--paper);
  border-top: 3px solid var(--brass);
}

.site-footer__inner {
  width: var(--container);
  margin-inline: auto;
  padding-block: clamp(40px, 5vw, 68px) clamp(28px, 3vw, 40px);
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
}

.site-footer__wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.07em;
  color: var(--paper-bright);
}

.site-footer__wordmark span {
  color: var(--terracotta-soft);
}

.site-footer__copy {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: rgba(250, 248, 245, 0.88);
}

.site-footer__meta {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.75;
  color: rgba(245, 242, 235, 0.72);
}

.site-footer h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 14px;
}

.site-footer__list {
  display: grid;
  gap: 2px;
}

.site-footer__list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 14px;
  color: rgba(250, 248, 245, 0.9);
  transition: color 0.2s;
}

.site-footer__list a:hover {
  color: var(--brass-bright);
}

.site-footer__bottom {
  width: var(--container);
  margin-inline: auto;
  padding-block: 18px 28px;
  border-top: 1px solid rgba(245, 242, 235, 0.18);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(245, 242, 235, 0.7);
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid rgba(212, 176, 106, 0.45);
  border-radius: var(--radius-xs);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--brass-bright);
}

/* ==========================================================================
   Responsive Breakpoints (Shared Chrome)
   ========================================================================== */

@media (max-width: 960px) {
  .site-brand__copy {
    display: none;
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --mast-h: 62px;
  }

  .site-nav {
    display: none;
  }

  .site-nav-toggle {
    display: inline-flex;
  }

  .site-brand__meta {
    padding-left: 10px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 420px) {
  .site-brand__meta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
