/* ==========================================================================
   NewMemo Design System - The Tactile Journal (手帳クラフト＆情緒)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Kiwi+Maru:wght@400;500;700&family=Plus+Jakarta+Sans:wght@600;700&family=Yomogi&family=Zen+Maru+Gothic:wght@400;500;700;900&display=swap');

:root {
  /* =========================================
     1. Color Tokens (Day Mode - Morning Light)
     ========================================= */
  --paper-cream: #FAF6ED;
  --paper-light: #FDFBF7;
  --paper-warm: #F4EFE2;
  --paper-card: #FFFFFF;
  --paper-craft: #EFE8D8;
  --paper-divider: #E4DDD0;
  --paper-border: #DCD4C4;

  /* Sticky Notes & Washi Tape */
  --sticky-yellow: #FFF9D2;
  --sticky-yellow-border: #F3E7A6;
  --sticky-rose: #FDE8E5;
  --sticky-rose-border: #F8D0CB;
  --sticky-green: #E8F4E8;
  --sticky-green-border: #CFE6D0;
  --sticky-blue: #E8F1F6;
  --sticky-blue-border: #CCE0ED;

  --washi-tape-sage: rgba(122, 158, 126, 0.5);
  --washi-tape-amber: rgba(226, 157, 69, 0.5);
  --washi-tape-rose: rgba(200, 117, 111, 0.45);

  /* Ink & Typography */
  --ink-coal: #23221E;
  --ink-dark: #3F3C35;
  --ink-sepia: #635E52;
  --ink-taupe: #888274;
  --ink-light: #AEA89A;

  /* Emotional Highlights & AI Accent */
  --sage-main: #6E9473;
  --sage-dark: #507355;
  --sage-soft: #E9F2EA;
  --terracotta: #C8756F;
  --terracotta-soft: #FAF0EF;
  --amber-warm: #E29D45;
  --amber-soft: #FDF4E7;
  --deep-forest: #22372B;

  /* Marker Highlighter */
  --marker-yellow: rgba(255, 235, 120, 0.7);
  --marker-sage: rgba(180, 220, 185, 0.7);

  /* Shadows */
  --shadow-journal: 0 4px 12px rgba(99, 94, 82, 0.08), 0 1px 3px rgba(99, 94, 82, 0.05);
  --shadow-polaroid: 0 10px 24px -4px rgba(63, 60, 53, 0.12), 0 2px 6px rgba(63, 60, 53, 0.06);
  --shadow-sticky: 2px 4px 10px rgba(99, 94, 82, 0.1);
  --shadow-floating: 0 20px 40px -10px rgba(35, 34, 30, 0.15);

  /* =========================================
     2. Typography Tokens
     ========================================= */
  --font-heading: 'Kiwi Maru', 'Zen Maru Gothic', serif;
  --font-hand: 'Yomogi', cursive;
  --font-en-hand: 'Caveat', cursive;
  --font-body: 'Zen Maru Gothic', sans-serif;
  --font-en: 'Plus Jakarta Sans', sans-serif;

  /* Fluid Typography */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.85rem, 0.82rem + 0.18vw, 0.9375rem);
  --text-base: clamp(0.95rem, 0.92rem + 0.2vw, 1.0625rem);
  --text-md: clamp(1.1rem, 1.05rem + 0.35vw, 1.25rem);
  --text-lg: clamp(1.28rem, 1.18rem + 0.6vw, 1.6rem);
  --text-xl: clamp(1.55rem, 1.4rem + 0.9vw, 2.1rem);
  --text-2xl: clamp(1.9rem, 1.65rem + 1.5vw, 2.75rem);
  --text-hero: clamp(2.3rem, 1.95rem + 2.5vw, 3.8rem);

  /* Spacing */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 9999px;

  --container-width: 1140px;
  --container-narrow: 840px;
}


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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.85;
  color: var(--ink-dark);
  background-color: var(--paper-cream);
  background-image: url("../assets/washi_seamless_bg.jpg");
  background-repeat: repeat-y;
  background-size: 100% auto;
  background-position: top center;
  background-attachment: scroll;
  overflow-x: clip;
  position: relative;
  letter-spacing: 0.02em;
  line-break: strict;
  -webkit-line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;
  text-wrap: pretty;
  word-break: auto-phrase;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  line-break: strict;
  -webkit-line-break: strict;
  text-wrap: balance;
  word-break: auto-phrase;
  overflow-wrap: break-word;
}

p, li, dd, dt {
  text-wrap: pretty;
  word-break: auto-phrase;
}

/* Tactile Paper Grain Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='craftGrain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23craftGrain)'/%3E%3C/svg%3E");
}



/* Selection */
::selection {
  background-color: var(--marker-yellow);
  color: var(--ink-coal);
}

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

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

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: clamp(60px, 8vw, 110px) 0;
  position: relative;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Hand-drawn Underline & Highlighter */
.hand-accent {
  font-family: var(--font-hand);
  color: var(--terracotta);
  font-weight: normal;
  display: inline-block;
}

.marker-highlight {
  background: linear-gradient(transparent 55%, var(--marker-yellow) 55%);
  padding: 0 4px;
  border-radius: 2px;
}

/* Typography & Break Helpers (Safari / Chrome 文節・折り返し制御) */
.pc-only {
  display: inline;
}

.sp-only {
  display: none;
}

.ib, .inline-block, .phrase {
  display: inline-block;
}

.text-nowrap {
  white-space: nowrap;
}

.keep-all {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .pc-only {
    display: none !important;
  }
  .sp-only {
    display: inline !important;
  }
}

