/* Design system v2 · base: element defaults, typography, focus, texture, utilities. */

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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: var(--pink-300);
  }

  body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-body);
    font-weight: 500;
    line-height: var(--lh-body);
    color: var(--ink);
    background: var(--pink-300);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  :lang(ja) {
    font-family: var(--font-ja);
    line-break: strict;
  }
  /* Japanese needs more leading in running text; headings and components keep their own line-height
     (a rule on every element would override the inherited value of display type such as the section titles) */
  body:lang(ja), :where(p, li, dd, dt, figcaption):lang(ja) { line-height: var(--lh-ja); }
  /* Japanese headings break at natural phrase boundaries where supported */
  :is(h1, h2, h3, h4):lang(ja) { word-break: auto-phrase; }

  h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); font-weight: 700; text-wrap: balance; }
  p { margin: 0; text-wrap: pretty; }
  ul, ol { margin: 0; padding: 0; }
  img, svg, video { display: block; max-width: 100%; }
  img { height: auto; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }

  a { color: var(--green-700); text-decoration-thickness: 2px; text-underline-offset: 3px; }
  a:hover { color: var(--green-900); }

  :focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }

  ::selection { background: var(--green-200); color: var(--green-900); }

  /* ---- utilities */
  [hidden] { display: none !important; }
  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .ink-soft { color: var(--ink-soft); }
  .doodle { font-family: var(--font-doodle); font-weight: 400; }

  /* Light paper grain: a tiny inline SVG noise (no download), laid over plain areas */
  .grain { position: relative; isolation: isolate; }
  .grain::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.35; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .35 0 0 0 0 .42 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* Faint clover pattern for plain pink areas */
  .clover-pattern {
    background-color: var(--pink-300);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23fff' fill-opacity='.16'%3E%3Ccircle cx='24' cy='20' r='6'/%3E%3Ccircle cx='32' cy='28' r='6'/%3E%3Ccircle cx='24' cy='36' r='6'/%3E%3Ccircle cx='16' cy='28' r='6'/%3E%3Ccircle cx='84' cy='80' r='5'/%3E%3Ccircle cx='91' cy='87' r='5'/%3E%3Ccircle cx='84' cy='94' r='5'/%3E%3Ccircle cx='77' cy='87' r='5'/%3E%3C/g%3E%3C/svg%3E");
  }
}
