/* Design tokens taken from the designer's files:
   --sea / --sand: logo (miyazakian_logo.ai)
   --mist: title colour, --sky: accent block (miyazakianlife.psd)
   --maroon: accent block, --forest: gradient (yabusameculture.psd) */
:root {
  --sea: #366CB2;
  --sea-deep: #1E3F6E;
  --sand: #DCD3B2;
  --sand-light: #F1ECDC;
  --mist: #DBF3FF;
  --sky: #00BFF2;
  --maroon: #571D1C;
  --forest: #011302;
  --ink: #14243A;
  --ink-soft: #4A5A6E;
  --paper: #FBF9F3;
  --line: rgba(20, 36, 58, .12);
  --title-track: .075em;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E6EDF5;
    --ink-soft: #A7B4C4;
    --paper: #0D1824;
    --sand-light: #16243A;
    --line: rgba(230, 237, 245, .14);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Headings follow the PSD title spec: Noto Sans JP Light, tracking 75 */
h1, h2, h3, .title {
  font-weight: 300;
  letter-spacing: var(--title-track);
  line-height: 1.2;
  margin: 0;
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sea);
  margin: 0 0 14px;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--sky); } }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 52px); }
.section-head p { max-width: 460px; margin: 0; color: var(--ink-soft); }
.more {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; letter-spacing: .08em;
  text-decoration: none; color: var(--sea);
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
@media (prefers-color-scheme: dark) { .more { color: var(--sky); } }
.more::after { content: "→"; transition: transform .2s; }
.more:hover::after { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 10;
  padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.site-header--overlay { position: absolute; inset: 0 0 auto 0; padding-top: 22px; background: none; border: 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--sea-deep); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand span { font-size: 20px; font-weight: 300; letter-spacing: var(--title-track); }
.site-nav { display: flex; gap: 26px; font-size: 14px; font-weight: 500; letter-spacing: .06em; }
.site-nav a { text-decoration: none; color: var(--sea-deep); opacity: .85; white-space: nowrap; }
.site-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.site-header--overlay .site-nav {
  padding: 8px 22px; border-radius: 999px;
  background: rgba(240, 247, 252, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
@media (prefers-color-scheme: dark) {
  .site-header:not(.site-header--overlay) .brand,
  .site-header:not(.site-header--overlay) .site-nav a { color: var(--ink); }
}
@media (max-width: 760px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-nav { max-width: 100%; overflow-x: auto; gap: 20px; scrollbar-width: none; }
  .site-header--overlay .site-nav { padding: 6px 16px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--sea-deep); color: #C9D6E8; padding: 64px 0 40px; font-size: 14px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer p { margin: 0 0 12px; max-width: 420px; line-height: 1.7; }
.site-footer h4 { margin: 0 0 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--sand); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .base { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 24px; margin-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Article pages (layout.html.erb) ---------- */
.page-head {
  position: relative; background: var(--sand-light);
  padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px);
}
.page-head::after {
  /* the logo's wave as the bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 32px;
  background: var(--paper);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48 V30 C150 30 200 6 340 10 C470 14 520 40 660 36 C800 32 860 4 1000 8 C1100 11 1150 26 1200 22 V48Z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48 V30 C150 30 200 6 340 10 C470 14 520 40 660 36 C800 32 860 4 1000 8 C1100 11 1150 26 1200 22 V48Z'/%3E%3C/svg%3E") center / 100% 100%;
}
.narrow { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.crumbs { font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 18px; }
.crumbs a { color: var(--sea); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 10px; opacity: .5; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 56px); color: var(--sea-deep); }
.page-meta { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); }
@media (prefers-color-scheme: dark) {
  .crumbs a { color: var(--sky); }
  .page-head h1 { color: var(--ink); }
}

.prose { padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(64px, 9vw, 120px); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote, .prose figure, .prose picture { margin: 0 0 1.4em; }
.prose h1 { font-size: clamp(30px, 4vw, 44px); margin: 1.6em 0 .6em; }
.prose h2 { font-size: clamp(26px, 3vw, 34px); margin: 1.8em 0 .6em; color: var(--sea-deep); }
.prose h3 { font-size: 22px; margin: 1.6em 0 .5em; }
.prose h4 { font-size: 15px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; margin: 1.6em 0 .5em; }
@media (prefers-color-scheme: dark) { .prose h2 { color: var(--mist); } }
.prose h2::before {
  content: ""; display: block; width: 40px; height: 3px; background: var(--sky); margin-bottom: 18px;
}
.prose a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--sea-deep); text-decoration-thickness: 2px; }
@media (prefers-color-scheme: dark) { .prose a { color: var(--sky); } .prose a:hover { color: var(--mist); } }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--sea); }
.prose strong { font-weight: 500; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
.prose img, .prose video, .prose svg {
  display: block; max-width: 100%; width: auto; height: auto; margin: 0 auto;
}
.prose picture { display: block; }
.prose iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.prose iframe[src*="youtube"], .prose iframe[src*="vimeo"] { height: auto; aspect-ratio: 16 / 9; }
.prose .video-container { margin: 0 0 1.6em; }
.prose .instagram-media { margin: 0 auto !important; }
.prose blockquote:not([class]) {
  margin-left: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--sand);
  color: var(--ink-soft);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 500; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); border-bottom-color: var(--sand); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--sand-light); padding: 2px 6px; }
.prose input[type="text"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 4px;
}
.prose button {
  font: inherit; font-weight: 500; letter-spacing: .06em; cursor: pointer;
  padding: 10px 22px; border: 0; border-radius: 999px; background: var(--sea); color: #fff;
}
.prose button:hover { background: var(--sea-deep); }
.center { text-align: center; }

/* The sitemap and index lists are long: two columns on wide screens */
.prose > ul:last-of-type:has(> li:nth-child(20)) { columns: 2 320px; column-gap: 40px; }
.prose > ul:last-of-type:has(> li:nth-child(20)) li { break-inside: avoid; }
