/* gomi-sensei.com, the shared layer every brand page stands on.
 *
 * Tokens for both themes, the base reset, the shared type and controls (eyebrow,
 * lead, pills, buttons, text links, sections), the header with its Lights switch,
 * and the footer. The homepage adds styles.css; the features and about pages add
 * their own page styles; site.js runs the Lights switch on all of them.
 *
 * The look is the app's own "blue-hour" theme (../../src/theme.ts): navy pages,
 * blue cards with white type, one yellow for the thing you press, Nunito for Latin
 * type and Zen Maru Gothic for Japanese. Everything that changes between the two
 * themes is a token on :root; a colour written straight into a rule belongs to an
 * object and stays put when the lights go on.
 */

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --page: #0e2749;
  --page-deep: #0b1e3c;
  --band: #12294e;
  --raised: #17325c;
  --rim: #4a6fa5;
  --rim-deep: #081b36;
  --line: rgba(143, 178, 220, 0.22);
  --grid: rgba(143, 178, 220, 0.05);
  --shadow: rgba(3, 12, 29, 0.55);

  --text: #ffffff;
  --soft: #c6dcf3;
  --mute: #8fb2dc;
  --accent: #ffd766;
  --eyebrow: #ffd766;
  --miss: #ffac88;
  --good: #8fd97a;
  --hl-mark: transparent;
  --input: #0b1e3c;
  --foot: #081b36;
  --focus: #ffd766;

  /* Objects: the same in both themes. */
  --yellow: #f7be31;
  --yellow-edge: #b8861a;
  --gold: #ffd766;
  --red: #c94040;
  --card: #2f5fa7;
  --card-inner: #264e8d;
  --card-deep: #1e3e70;
  --card-stack: #4273b8;
  --on-card: #ffffff;
  --on-card-soft: #d9e7f9;
  --on-card-mute: #a9c1e6;
  --ink: #12294e;

  --sans: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ja: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;

  --page: #cbdff2;
  --page-deep: #bdd5ec;
  --band: #d8e7f5;
  --raised: #edf5fd;
  --rim: #5f86b6;
  --rim-deep: #9db8d8;
  --line: rgba(28, 61, 110, 0.18);
  --grid: rgba(28, 61, 110, 0.05);
  --shadow: rgba(28, 61, 110, 0.22);

  --text: #1c3d6e;
  --soft: #2f5384;
  --mute: #3f6494;
  --accent: #2f5fa7;
  --eyebrow: #2f5fa7;
  --miss: #a93030;
  --good: #2f6b28;
  --hl-mark: #f7be31;
  --input: #edf5fd;
  --foot: #1c3d6e;
  --focus: #2f5fa7;
}

/* ── Base ───────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  /* `clip`, not `hidden`: hidden would make the root a scroll container. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 700 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

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

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

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

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

button {
  cursor: pointer;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

[lang="ja"] {
  font-family: var(--ja);
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

.visually-hidden,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

/* ── Shared pieces ──────────────────────────────────────────────────────── */

h2 {
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
  text-wrap: balance;
}

/* The highlighted phrase: yellow type on navy, a yellow marker under navy type
 * when the lights are on. */

.hl {
  color: var(--accent);
  background: linear-gradient(transparent 60%, var(--hl-mark) 60% 90%, transparent 90%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

:root[data-theme="light"] .hl {
  color: var(--text);
}

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--eyebrow);
}

.lead {
  font-size: 17px;
  line-height: 1.7;
  font-weight: 700;
  color: var(--soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.pill--red {
  background: var(--red);
  color: #fff;
}

.pill--small {
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.1em;
  background: var(--yellow);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow:
    0 5px 0 var(--yellow-edge),
    0 12px 24px rgba(3, 12, 29, 0.18);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 var(--yellow-edge),
    0 16px 28px rgba(3, 12, 29, 0.2);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--yellow-edge);
}

.btn--small {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 4px 0 var(--yellow-edge);
}

.btn--big {
  padding: 18px 32px;
  font-size: 18px;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--rim);
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--raised);
  border-color: var(--yellow);
  box-shadow: none;
}

.apple-mark {
  width: 18px;
  height: 20px;
  flex: none;
}

.text-link {
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

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

.section {
  padding: 110px max(5%, calc((100% - 1296px) / 2));
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

.section-heading h2 {
  margin-top: 14px;
  max-width: 17ch;
}

.section-heading > .lead {
  max-width: 400px;
}

.section-heading--center {
  justify-content: center;
  text-align: center;
}

.section-heading--center h2 {
  max-width: none;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.nav {
  max-width: 1296px;
  margin: 0 auto;
  padding: 18px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 5;
}

@media (min-width: 1440px) {
  .nav {
    padding-inline: 0;
  }
}

.nav__left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.nav__brand img {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.nav__brand strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.nav__brand small {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--mute);
}

.nav__social {
  display: flex;
  gap: 8px;
  padding-left: 20px;
  border-left: 1.5px solid var(--line);
}

.nav__social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  color: var(--soft);
  transition:
    color 0.15s,
    border-color 0.15s;
}

.nav__social a:hover {
  color: var(--accent);
  border-color: var(--rim);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

.nav__text {
  padding: 8px 2px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.nav__text:hover {
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav__new {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(247, 190, 49, 0.45);
  transition: transform 0.15s;
}

.nav__new:hover {
  transform: scale(1.08) rotate(-6deg);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.foot {
  padding: 32px 5%;
  background: var(--foot);
  color: #c6dcf3;
}

.foot__inner {
  max-width: 1296px;
  margin: 0 auto;
}

.foot__social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(198, 220, 243, 0.2);
  font-size: 14px;
  font-weight: 800;
}

.foot__social-links {
  display: flex;
  gap: 16px;
}

.foot__social-links a {
  display: flex;
  padding: 8px;
}

.foot__social-links a:hover,
.foot__links a:hover {
  color: var(--gold);
}

.foot__row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
  font-weight: 700;
}

.foot__row > p {
  white-space: nowrap;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
}

@media (max-width: 1180px) {
  .nav__social {
    display: none;
  }
}

@media (max-width: 880px) {
  .nav__text {
    display: none;
  }

  .section {
    padding-block: 84px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .section-heading--center {
    align-items: center;
  }

  .foot__row {
    flex-direction: column;
    gap: 14px;
  }

  .foot__links {
    justify-content: flex-start;
  }
}

@media (max-width: 580px) {
  .nav {
    padding: 14px 5%;
    gap: 10px;
  }

  .nav__brand {
    gap: 8px;
  }

  .nav__brand img {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .nav__brand strong {
    font-size: 18px;
  }

  .nav__brand small {
    font-size: 8px;
    letter-spacing: 0.16em;
  }

  .nav__links {
    gap: 8px;
  }

  .nav__download span {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
  }

  .nav__download {
    padding: 9px 11px;
  }

  .nav__new {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .pill {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .section {
    padding: 70px 6%;
  }

  h2 {
    font-size: clamp(32px, 9vw, 42px);
  }

  .lead {
    font-size: 16px;
  }

  .foot__social-links {
    gap: 8px;
  }

  .foot__links {
    gap: 10px 18px;
  }
}

@media (max-width: 380px) {
  .nav__brand small {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
