:root {
  --ink: #17324d;
  --muted: #5d7185;
  --blue: #1769aa;
  --blue-dark: #0e4d80;
  --teal: #0d9188;
  --mint: #e8f7f4;
  --sky: #eef7ff;
  --paper: #ffffff;
  --line: #dce7ef;
  --shadow: 0 18px 45px rgba(23, 50, 77, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f8fbfd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
body.aquagrammar-help--ja {
  font-family: "Yu Gothic UI", "Meiryo UI", "BIZ UDPGothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
}
a { color: var(--blue); text-decoration-thickness: .08em; text-underline-offset: .14em; }
a:hover { color: var(--blue-dark); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #f0a529; outline-offset: 3px; }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: .6rem 1rem; background: var(--ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.site-header { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.site-header__inner { min-height: 78px; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; line-height: 1.15; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: .22rem; }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .03em; }
.primary-nav { margin-left: auto; }
.primary-nav .menu { display: flex; align-items: center; gap: 1.1rem; margin: 0; padding: 0; list-style: none; }
/* nowrap: a nav label is a single signpost and must not break across lines.
   The mobile block below turns these into full-width rows, where the rule is
   harmless because each has the width to itself. */
.primary-nav a { color: var(--ink); font-size: .94rem; text-decoration: none; white-space: nowrap; }
.primary-nav a:hover { color: var(--blue); }
.site-header__search { flex: 0 0 auto; }
.primary-nav__search { display: none; }
.primary-nav .language-switcher { display: none; }
.language-switcher { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.language-switcher a { padding: .24rem .55rem; border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 700; line-height: 1.2; text-decoration: none; }
.language-switcher a[aria-current="true"] { color: #fff; background: var(--blue); }
.site-header__language { flex: 0 0 auto; }
.search-form { display: flex; align-items: center; gap: .35rem; }
.search-field { width: 138px; min-height: 36px; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: #fff; }
.search-field::placeholder { color: #7890a4; }
.search-submit { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #b9d4e7; border-radius: 50%; color: var(--blue-dark); background: var(--sky); cursor: pointer; }
.search-submit:hover { color: #fff; background: var(--blue); }
.menu-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: .45rem .65rem; font-size: 1.25rem; }
.site-main { min-height: 60vh; }
.hero { padding: 5.5rem 0 4.5rem; background: radial-gradient(circle at 90% 10%, #d9f2f1 0, transparent 36%), linear-gradient(135deg, var(--sky), #fff 58%); }
/* front-page.php has always asked for hero--compact, but no rule defined it,
   so the home hero kept the full 4.5rem base and .section-block added 5rem on
   top of that -- about 150px of empty band under the buttons. */
.hero--compact { padding-bottom: 2rem; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 4rem; align-items: center; }
.eyebrow { color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .12em; margin: 0 0 .8rem; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.6rem); max-width: 760px; margin: 0 0 1.25rem; }
h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); margin: 0 0 .8rem; }
h3 { font-size: 1.25rem; margin: .55rem 0 .45rem; }
.hero__lead { max-width: 650px; color: var(--muted); font-size: 1.17rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .65rem 1.1rem; border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(23, 50, 77, .12); }
.button--primary { color: #fff; background: var(--blue); }
.button--primary:hover { color: #fff; background: var(--blue-dark); }
.button--secondary { color: var(--blue-dark); background: #fff; border: 1px solid #b9d4e7; }
.hero-card { padding: 1.5rem; border: 1px solid rgba(23, 105, 170, .14); border-radius: var(--radius); background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.hero-card__step { display: flex; align-items: center; gap: 1rem; }
.hero-card__step > span { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; color: #fff; background: var(--teal); font-weight: 800; }
.hero-card__step strong, .hero-card__step small { display: block; }
.hero-card__step small { color: var(--muted); font-size: .88rem; }
.hero-card__line { width: 2px; height: 28px; margin: .45rem 0 .45rem 18px; background: #b9e1de; }
.section-block { padding: 5rem 0; }
.section-block--compact { padding-top: 0; }
.section-heading { margin-bottom: 2rem; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.card-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-card { min-height: 250px; padding: 1.4rem; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 10px 28px rgba(23, 50, 77, .04); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.info-card--small { min-height: 190px; }
.info-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); }
.info-card__number { color: var(--teal); font-weight: 800; letter-spacing: .08em; }
.info-card p { color: var(--muted); margin: 0 0 1rem; }
.text-link { color: var(--blue); font-weight: 700; font-size: .9rem; }
.callout-section { padding: 0 0 5rem; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.2rem; border-radius: var(--radius); background: var(--mint); }
.callout p:not(.eyebrow) { max-width: 700px; margin-bottom: 0; color: var(--muted); }
.content-layout { padding: 4rem 0 6rem; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.25rem; color: var(--muted); font-size: .9rem; }
.breadcrumbs a { font-weight: 700; }
.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 850px); gap: 1.5rem; align-items: start; }
.docs-sidebar { padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: #f2f8fc; position: sticky; top: 98px; }
.docs-sidebar .eyebrow { font-size: .68rem; line-height: 1.4; }
.docs-links { margin: 0; padding: 0; list-style: none; }
.docs-links li + li { margin-top: .2rem; }
.docs-links a { display: block; padding: .45rem .55rem; color: var(--ink); border-radius: 8px; text-decoration: none; font-size: .92rem; }
.docs-links a:hover, .docs-links .is-current a { color: var(--blue-dark); background: #fff; }
.content-card { max-width: 850px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 36px rgba(23, 50, 77, .05); }
.content-card h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); }
.content-card__body > :first-child { margin-top: 0; }
.content-card__body h2 { margin-top: 2.5rem; font-size: 1.8rem; }
.content-card__body h3 { margin-top: 2rem; }
.content-card__body img { max-width: 100%; height: auto; border-radius: 12px; }
.content-card__body .app-figure { margin: 2rem 0 2.4rem; }
.content-card__body .app-figure img { display: block; width: 100%; border: 1px solid #b9d4e7; box-shadow: var(--shadow); }
.content-card__body .app-figure--dialog { max-width: 560px; margin-inline: auto; }
.content-card__body .app-figure figcaption { margin-top: .7rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
/* Video embeds. The 16:9 box keeps the player from jumping as it loads, and
   lets the iframe scale on a phone -- an iframe has no intrinsic ratio. */
.content-card__body .app-video { margin: 2rem 0 2.4rem; }
.content-card__body .app-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid #b9d4e7; box-shadow: var(--shadow); background: #060b14; }
.content-card__body .app-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content-card__body .app-video figcaption { margin-top: .7rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.contextual-tour { margin-top: 2.5rem; }
.contextual-tour__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.contextual-tour__grid .app-figure { margin: 0; max-width: none; }
.content-card__body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.content-card__body th, .content-card__body td { padding: .7rem; border: 1px solid var(--line); text-align: left; }
.content-card__body th { background: var(--sky); }
.content-card__body code, .content-card__body pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.content-card__body pre { overflow: auto; padding: 1rem; border-radius: 10px; background: #11283d; color: #edf7ff; }
.article-meta { color: var(--muted); font-size: .9rem; }
.article-list article + article { padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid var(--line); }
.article-list h2 { font-size: 1.4rem; }
.empty-state { text-align: center; }
.empty-state .search-form { justify-content: center; margin: 1.5rem 0; }
.empty-state .search-field { width: min(100%, 300px); }
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem 0; color: var(--muted); font-size: .9rem; }
.site-footer__inner p { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: .45rem; }
.footer-nav a { font-size: .85rem; }
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .container { width: min(100% - 28px, 1120px); }
  .site-header__inner { min-height: 68px; }
  .menu-toggle { display: block; }
  .site-header__search { display: none; }
	.site-header__language { display: none; }
  .primary-nav { display: none; position: absolute; left: 14px; right: 14px; top: 68px; padding: .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
  .primary-nav.is-open { display: block; }
  .primary-nav .menu { display: block; }
  .primary-nav__search { display: block; padding: .75rem .5rem .35rem; }
	.primary-nav .language-switcher { display: inline-flex; margin: .65rem .5rem .25rem; }
  .primary-nav__search .search-field { width: 100%; }
  .primary-nav li + li { border-top: 1px solid var(--line); }
  .primary-nav a { display: block; padding: .7rem .5rem; }
  .hero { padding: 3.5rem 0; }
  h1 { font-size: 2.65rem; }
  .card-grid { grid-template-columns: 1fr; }
  .card-grid--three { grid-template-columns: 1fr; }
  .contextual-tour__grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .callout, .site-footer__inner { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
