@font-face {
  font-family: "Merienda";
  src: url("Merienda-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --white: #FFFFFF;
  --petal: #FCF6F7;
  --pale-mauve: #EDD9E1;
  --dusty-rose: #DCAAB6;
  --mauve: #9A5F77;
  --plum: #6E3B54;
  --berry: #552A3D;

  --page: var(--petal);
  --text: var(--berry);
  --muted: var(--plum);
  --card: var(--white);
  --line: rgba(85, 42, 61, 0.12);
  --header: rgba(252, 246, 247, 0.88);
}

html[data-theme="dark"] {
  --page: var(--berry);
  --text: var(--petal);
  --muted: var(--dusty-rose);
  --card: var(--berry);
  --line: rgba(237, 217, 225, 0.2);
  --header: rgba(85, 42, 61, 0.9);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  transition: background-color .3s, color .3s;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

h1, h2, .brand span {
  font-family: "Merienda", Georgia, serif;
  font-weight: 400;
  margin: 0;
}
h1 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 28px; }
h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 10px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; object-fit: contain; }
.brand span { font-size: 20px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--text); }

.switch {
  display: flex; padding: 3px; border-radius: 999px;
  border: 1px solid var(--line);
}
.switch button {
  font: inherit; font-size: 14px; font-weight: 600;
  border: 0; border-radius: 999px; padding: 6px 14px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.switch button[aria-pressed="true"] { background: var(--mauve); color: var(--white); }
html[data-theme="dark"] .switch button[aria-pressed="true"] { background: var(--pale-mauve); color: var(--berry); }

/* Sections */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.hero { padding-top: 40px; }
.theme-note {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--mauve);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 32px;
}
html[data-theme="dark"] .theme-note { border-left-color: var(--pale-mauve); }
.theme-note-title { margin: 0 0 12px; font-weight: 600; }
.theme-note .switch { display: inline-flex; margin-bottom: 12px; }
.theme-note-list { margin: 0; padding-left: 20px; color: var(--muted); }
.theme-note-list li + li { margin-top: 6px; }
.theme-note-list strong { color: var(--text); }
.lead { margin: 0 0 28px; color: var(--muted); max-width: 640px; }

/* Logo grid: a "mark on top" (square) beside its "mark on left" (2:1),
   so 1fr + 2fr columns give both cards the same height. */
.logo-grid { display: grid; gap: 20px; }
.logo-row { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.logo-row.single { grid-template-columns: 1fr; width: calc((100% - 40px) / 3); margin: 0 auto; }

.logo-card { margin: 0; }
.logo-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .3s;
}
.logo-card.square .logo-frame { aspect-ratio: 1 / 1; }
.logo-card.wide .logo-frame { aspect-ratio: 2 / 1; }
.logo-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
[data-kind="still"] .logo-frame img { padding: 9%; }
[data-kind="still"] .logo-card.wide .logo-frame img { padding: 6% 7%; }

.logo-card figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* Palette */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.swatch {
  font: inherit; color: inherit; text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px; padding: 0; overflow: hidden; cursor: pointer;
  transition: transform .15s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch:focus-visible { outline: 2px solid var(--mauve); outline-offset: 3px; }
.swatch-color { display: block; height: 120px; border-bottom: 1px solid var(--line); }
.swatch-info { display: block; padding: 12px 14px 14px; }
.swatch-name { display: block; font-weight: 700; }
.swatch-hex { display: block; font-family: Consolas, "SF Mono", monospace; font-size: 15px; }
.swatch-rgb { display: block; font-size: 13px; color: var(--muted); }

/* Downloads */
.downloads { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 560px; }
.dl {
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 24px; border-radius: 16px; text-decoration: none;
  border: 1px solid var(--line);
  transition: transform .15s;
}
.dl:hover { transform: translateY(-2px); }
.dl-light { background: var(--white); color: var(--berry); }
.dl-dark { background: var(--berry); color: var(--petal); }
html[data-theme="dark"] .dl-dark { border-color: rgba(237, 217, 225, 0.35); }
.dl-font { background: var(--pale-mauve); color: var(--berry); }
.dl-title { font-family: "Merienda", Georgia, serif; font-size: 22px; }
.dl-title::before { content: "↓ "; font-family: "Segoe UI", system-ui, sans-serif; }
.dl-meta { font-size: 13px; opacity: .8; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--berry); color: var(--petal);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
html[data-theme="dark"] .toast { background: var(--petal); color: var(--berry); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Phone */
@media (max-width: 760px) {
  .nav { display: none; }
  .switch { margin-left: auto; }
  .logo-row { grid-template-columns: 1fr; }
  .logo-row.single { width: 100%; }
  .section { padding: 40px 0; }
}
@media (max-width: 380px) {
  .brand span { font-size: 17px; }
  .switch button { padding: 6px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
