@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --canvas: #f3f0e8;
  --canvas-deep: #e8e3d7;
  --surface: #fbfaf6;
  --surface-raised: #fffefa;
  --surface-muted: #ece8de;
  --ink: #182033;
  --ink-soft: #30394b;
  --muted: #59616e;
  --line: #d7d2c5;
  --line-strong: #b9b3a6;
  --primary: #3048b8;
  --primary-strong: #24399b;
  --primary-soft: #e1e5ff;
  --secondary: #0a6e69;
  --secondary-soft: #d8efeb;
  --accent: #c94b32;
  --accent-soft: #f6ded7;
  --focus: #6f86ee;
  --success: #2e704d;
  --success-soft: #dcf0e4;
  --warning: #8a5a00;
  --warning-soft: #fff0c9;
  --danger: #ad332b;
  --danger-soft: #f9dfdc;
  --shadow-sm: 0 1px 2px rgba(24, 32, 51, 0.06), 0 5px 18px rgba(24, 32, 51, 0.05);
  --shadow-md: 0 16px 44px rgba(24, 32, 51, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --container: 1200px;
  --reading: 720px;
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #11151c;
  --canvas-deep: #0c1016;
  --surface: #181e27;
  --surface-raised: #222a36;
  --surface-muted: #202833;
  --ink: #f2efe8;
  --ink-soft: #d9dce3;
  --muted: #b4bac5;
  --line: #343e4b;
  --line-strong: #4b5868;
  --primary: #91a6ff;
  --primary-strong: #b5c2ff;
  --primary-soft: #293252;
  --secondary: #5ccfc3;
  --secondary-soft: #1c3a3b;
  --accent: #ff8b6a;
  --accent-soft: #472a29;
  --focus: #a9b7ff;
  --success: #8bd4a6;
  --success-soft: #203a2b;
  --warning: #f2c66d;
  --warning-soft: #443719;
  --danger: #ff9e94;
  --danger-soft: #492624;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 8px 20px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.34);
}

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

html {
  min-width: 320px;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 34rem),
    radial-gradient(circle at 95% 20%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 28rem),
    var(--canvas);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body,
.site-header,
.site-footer,
.tool-workspace,
.tool-form-panel,
.tool-result-panel,
.search-dialog__panel {
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

a:hover {
  color: var(--primary);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: var(--primary);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h1,
h2 {
  font-weight: 700;
}

h3 {
  font-weight: 700;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5.3rem);
}

h2 {
  font-size: clamp(1.9rem, 3.5vw, 3.25rem);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

p {
  color: var(--muted);
}

.container {
  width: min(calc(100% - 2.5rem), var(--container));
  margin-inline: auto;
}

.reading-width {
  width: min(calc(100% - 2.5rem), var(--reading));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  color: #fff;
  background: var(--primary-strong);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.icon--sm {
  width: 1rem;
  height: 1rem;
}

.icon--lg {
  width: 1.65rem;
  height: 1.65rem;
}

.button,
.button-secondary,
.button-quiet,
.button-danger {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.button {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--primary-strong) 80%, #000);
}

.button:hover {
  color: #fff;
  background: var(--primary-strong);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--primary-strong) 80%, #000);
}

[data-theme="dark"] .button,
[data-theme="dark"] .button:hover {
  color: #182033;
}

.button:active {
  transform: none;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--primary-strong) 80%, #000);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface-raised);
  border-color: var(--line);
}

.button-secondary:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 10%, transparent);
}

.button-quiet {
  min-height: 40px;
  padding-inline: 0.7rem;
  color: var(--muted);
  background: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

[data-category-filter][aria-pressed="true"] {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

[data-theme="dark"] [data-category-filter][aria-pressed="true"] {
  color: #182033;
}

.button-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.button-danger:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 70%, var(--danger) 10%);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 1.6rem;
  height: 2px;
  content: "";
  background: currentColor;
}

.display-serif {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.muted {
  color: var(--muted);
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
}

.brand-word {
  line-height: 1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}

.header-nav a,
.header-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

.header-nav a:hover,
.header-action:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-action {
  border: 0;
  background: transparent;
}

.language-picker {
  position: relative;
}

.language-trigger {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.language-trigger:hover,
.language-picker.is-open .language-trigger {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-muted);
}

.language-trigger .icon {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 160ms var(--ease);
}

.language-picker.is-open .language-trigger .icon {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.5rem);
  right: 0;
  display: none;
  width: min(15rem, calc(100vw - 1.5rem));
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.language-picker.is-open .language-menu {
  display: grid;
  gap: 0.15rem;
}

.language-option {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 0.55rem;
  color: var(--muted);
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 650;
}

.language-option:hover,
.language-option.is-active {
  color: var(--ink);
  background: var(--surface-muted);
}

.language-option.is-active {
  font-weight: 800;
}

.language-option__flag {
  font-size: 1.05rem;
  line-height: 1;
}

.language-option__code {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.header-action--search {
  color: var(--primary);
}

.menu-toggle {
  display: none;
}

.search-dialog {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 7rem 1rem 2rem;
  background: color-mix(in srgb, var(--canvas-deep) 74%, transparent);
  backdrop-filter: blur(10px);
}

.search-dialog[hidden] {
  display: none;
}

.search-dialog__panel {
  width: min(100%, 680px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.search-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.search-dialog__header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.search-close {
  border: 0;
  background: transparent;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--line);
}

.search-field .icon {
  color: var(--muted);
}

.search-input {
  width: 100%;
  min-height: 66px;
  padding: 0.9rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.05rem;
}

.search-input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.search-input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.search-results {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding: 0.5rem;
  list-style: none;
}

.search-result {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: 10px;
  transition: background-color 140ms var(--ease);
}

.search-result:hover,
.search-result[aria-selected="true"] {
  background: var(--primary-soft);
}

.search-result__icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary);
  background: var(--surface-muted);
  border-radius: 8px;
}

.search-result__body {
  min-width: 0;
}

.search-result__title,
.search-result__description {
  display: block;
}

.search-result__title {
  color: var(--ink);
  font-weight: 800;
}

.search-result__description {
  margin-top: 0.15rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 1.5rem 1rem;
  color: var(--muted);
  text-align: center;
}

.hero {
  position: relative;
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(4.5rem, 8vw, 7rem);
}

.hero::after {
  position: absolute;
  z-index: -1;
  top: 2rem;
  right: -8rem;
  width: 22rem;
  height: 22rem;
  content: "";
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 32px color-mix(in srgb, var(--primary) 4%, transparent), 0 0 0 64px color-mix(in srgb, var(--primary) 3%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 7rem);
}

.hero-copy {
  max-width: 700px;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 1.35rem;
}

.hero h1 em {
  color: var(--primary);
  font-family: "Newsreader", Georgia, serif;
  font-style: normal;
  font-weight: 600;
}

.hero-lede {
  max-width: 580px;
  margin-bottom: 1.8rem;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.hero-search {
  max-width: 680px;
  margin-top: 1.4rem;
}

.hero-search .search-field {
  min-height: 72px;
  padding-left: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.hero-search .search-input {
  min-height: 70px;
  font-size: 1.08rem;
}

.hero-search .search-results {
  position: absolute;
  z-index: 10;
  width: 100%;
  max-height: 420px;
  margin-top: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.hero-search-wrap {
  position: relative;
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-note span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-note .icon {
  color: var(--secondary);
}

.hero-visual {
  position: relative;
  min-height: 450px;
}

.hero-board {
  position: absolute;
  inset: 1.5rem 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.6rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  transform: rotate(3deg);
}

.hero-board::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 9rem;
  height: 9rem;
  content: "";
  background: var(--primary-soft);
  border-radius: 0 0 0 100%;
}

.board-topline,
.board-bottomline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.board-number {
  color: var(--primary);
  font-size: 0.76rem;
}

.board-main {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.8rem;
}

.board-label {
  width: fit-content;
  padding: 0.35rem 0.55rem;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-equation {
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
}

.board-equation span {
  color: var(--primary);
}

.board-caption {
  max-width: 270px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.board-mark {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 4.2rem;
  height: 4.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.board-mark::before,
.board-mark::after {
  position: absolute;
  content: "";
  background: var(--accent);
}

.board-mark::before {
  top: 50%;
  left: 18%;
  width: 64%;
  height: 2px;
  transform: rotate(45deg);
}

.board-mark::after {
  top: 18%;
  left: 50%;
  width: 2px;
  height: 64%;
  transform: rotate(45deg);
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section--tight {
  padding-top: 2rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-heading h2 {
  max-width: 620px;
  margin-bottom: 0;
}

.section-heading p {
  max-width: 420px;
  margin-bottom: 0.25rem;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.section-link .icon {
  transition: transform 160ms var(--ease);
}

.section-link:hover .icon {
  transform: translateX(4px);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.featured-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  grid-column: span 4;
  padding: 1.35rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.featured-card:nth-child(2) {
  grid-column: span 5;
  background: var(--ink);
  color: #fff;
}

.featured-card:nth-child(3) {
  grid-column: span 3;
  background: var(--primary-soft);
}

.featured-card:nth-child(4) {
  grid-column: span 5;
  background: var(--secondary-soft);
}

.featured-card:nth-child(5) {
  grid-column: span 4;
  background: var(--accent-soft);
}

.featured-card:nth-child(6) {
  grid-column: span 3;
  background: var(--surface-muted);
}

.featured-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.featured-card__top,
.featured-card__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.featured-card__index {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.featured-card__icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border-radius: 9px;
}

.featured-card:nth-child(2) .featured-card__icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.featured-card:nth-child(2) .featured-card__index,
.featured-card:nth-child(2) .featured-card__description {
  color: #cbd1df;
}

.featured-card__bottom {
  align-items: end;
}

.featured-card__title {
  max-width: 260px;
  margin: 0;
  color: inherit;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

.featured-card__description {
  max-width: 290px;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.featured-card__arrow {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}

.featured-card:hover .featured-card__arrow {
  background: var(--surface-muted);
  transform: rotate(-35deg);
}

.featured-card:nth-child(2) .featured-card__arrow {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.category-card {
  position: relative;
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.15rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.category-card::after {
  position: absolute;
  right: -1.2rem;
  bottom: -1.8rem;
  width: 7rem;
  height: 7rem;
  content: "";
  border: 1px solid color-mix(in srgb, var(--category-color, var(--primary)) 28%, transparent);
  border-radius: 50%;
}

.category-card:hover {
  border-color: color-mix(in srgb, var(--category-color, var(--primary)) 55%, var(--line));
  background: color-mix(in srgb, var(--category-color, var(--primary)) 8%, var(--surface-raised));
  transform: translateY(-3px);
}

.category-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.category-card__icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: var(--category-color, var(--primary));
  background: color-mix(in srgb, var(--category-color, var(--primary)) 12%, var(--surface));
  border-radius: 9px;
}

.category-card__count {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.category-card h3 {
  margin: 1.4rem 0 0.3rem;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.category-card p {
  max-width: 190px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.explore-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
}

.explore-banner h2 {
  max-width: 580px;
  margin-bottom: 0.5rem;
  color: #fff;
}

.explore-banner p {
  max-width: 520px;
  margin-bottom: 0;
  color: #c7ccda;
}

.explore-banner .button {
  flex: 0 0 auto;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.24);
}

.explore-banner .button:hover {
  color: var(--ink);
  background: var(--primary-soft);
}

/* Only the day-counter featured card and the final home banner need a dark override.
   Their base rules use var(--ink) as a dark background, which becomes light in dark mode. */
[data-theme="dark"] .featured-card:nth-child(2) {
  background: var(--surface-raised);
  color: var(--ink);
}

[data-theme="dark"] .explore-banner {
  background: var(--surface-raised);
  color: var(--ink);
}

[data-theme="dark"] .explore-banner h2 {
  color: var(--ink);
}

[data-theme="dark"] .explore-banner p {
  color: var(--ink-soft);
}

[data-theme="dark"] .explore-banner .button {
  color: var(--canvas);
  background: var(--primary);
}

[data-theme="dark"] .explore-banner .button:hover {
  color: var(--canvas);
  background: var(--primary-strong);
}

.site-footer {
  margin-top: 4rem;
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
}

.footer-brand p {
  max-width: 280px;
  margin: 1rem 0 0;
  font-size: 0.84rem;
}

.footer-column h2 {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-column a {
  display: block;
  width: fit-content;
  margin: 0.45rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-links a {
  color: inherit;
}

.ad-slot {
  display: grid;
  min-height: 90px;
  place-items: center;
  margin: 1.5rem 0;
  padding: 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 45%, transparent);
}

.ad-slot[data-ad-state="disabled"] {
  display: none;
}

.ad-slot__label {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notice {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.84rem;
}

.notice--accent {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

[data-theme="dark"] .notice--accent {
  color: var(--primary);
}

.toast {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  max-width: min(360px, calc(100% - 2rem));
  padding: 0.8rem 1rem;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 0.84rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-hero {
  padding: 3.5rem 0 2.5rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .icon {
  color: var(--line-strong);
}

.page-hero h1 {
  max-width: 850px;
  margin-bottom: 0.85rem;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
}

.page-hero__lede {
  max-width: 680px;
  margin-bottom: 1.5rem;
  font-size: 1.08rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.3rem 0.6rem;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 800;
}

[data-theme="dark"] .tag {
  color: var(--primary);
}

.empty-state {
  padding: 3rem 1rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1000px) {
  .header-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-inner {
    position: relative;
  }

  .header-nav.is-open {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    display: grid;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-md);
  }

  .header-nav.is-open a {
    min-height: 46px;
  }

  .hero-grid {
    gap: 2rem;
  }

  .hero-visual {
    min-height: 380px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .featured-card:nth-child(n) {
    grid-column: span 6;
  }
}

@media (max-width: 720px) {
  .container,
  .reading-width {
    width: min(calc(100% - 2rem), var(--container));
  }

  .header-inner {
    min-height: 66px;
  }

  .header-action > span:not([data-theme-icon]) {
    display: none;
  }

  .language-picker .language-trigger > span {
    display: inline !important;
  }

  .language-trigger {
    min-width: 58px;
    justify-content: center;
    padding-inline: 0.45rem;
  }

  .header-action {
    min-width: 42px;
    justify-content: center;
    padding-inline: 0.55rem;
  }

  .brand-word {
    font-size: 1.15rem;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 320px;
  }

  .hero-board {
    inset: 0.5rem 0.4rem 0.5rem 0.4rem;
    padding: 1.25rem;
  }

  .section-heading,
  .explore-banner {
    align-items: start;
    flex-direction: column;
  }

  .section-heading p {
    max-width: 100%;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-card:nth-child(n) {
    min-height: 220px;
    grid-column: auto;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .container,
  .reading-width {
    width: min(calc(100% - 1.5rem), var(--container));
  }

  .header-actions {
    gap: 0;
  }

  .brand {
    gap: 0.45rem;
  }

  .brand-mark {
    width: 1.9rem;
    height: 1.9rem;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .hero-note {
    display: grid;
    gap: 0.4rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 150px;
  }

  .footer-grid {
    gap: 1.5rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
