/* ── fonts ─────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/cormorant-italic-600.woff2") format("woff2");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/quicksand-500.woff2") format("woff2");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/quicksand-600.woff2") format("woff2");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/quicksand-700.woff2") format("woff2");
}

/* ── tokens ────────────────────────────────────────────────────────────── */

:root {
  --bg: #fbf3e6;
  --bg-alt: #f3e6cf;
  --ink: #3a2620;
  --ink-soft: #7a5f4e;
  --rose: #d97e88;
  --rose-deep: #b85864;
  --rose-ink: #ffffff;
  --sage: #75824f;
  --gold: #b8801f;
  --line: #e7d3ad;
  --shadow: 28 40% 10%;

  /* photographic sections: warm dark scrim + cream text, same in both themes */
  --scrim-a: rgba(32, 20, 12, 0.28);
  --scrim-b: rgba(28, 16, 10, 0.72);
  --on-photo: #faf1e0;
  --on-photo-soft: #e8d7c0;
  --card-surface: rgba(251, 243, 230, 0.9);

  /* semantic — separate from the rose accent, used only for save/error state */
  --ok: #5c7a3f;
  --error: #b4522f;

  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Quicksand", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-hero: clamp(2.75rem, 2.4rem + 2.4vw, 4.5rem);
  --fs-h2: clamp(1.9rem, 1.65rem + 1vw, 2.4rem);
  --fs-h3: 1.2rem;
  --fs-body: 1.05rem;
  --fs-small: 0.85rem;

  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1512;
    --bg-alt: #251c17;
    --ink: #f2e4d4;
    --ink-soft: #c2ac97;
    --rose: #e79aa2;
    --rose-deep: #f0b6bd;
    --rose-ink: #2a1520;
    --sage: #a3b285;
    --gold: #dba949;
    --line: #3c2f26;
    --shadow: 20 60% 3%;
    --scrim-a: rgba(15, 9, 6, 0.4);
    --scrim-b: rgba(12, 7, 5, 0.85);
    --card-surface: rgba(37, 27, 21, 0.88);
    --ok: #8fac6c;
    --error: #e08260;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1512;
  --bg-alt: #251c17;
  --ink: #f2e4d4;
  --ink-soft: #c2ac97;
  --rose: #e79aa2;
  --rose-deep: #f0b6bd;
  --rose-ink: #2a1520;
  --sage: #a3b285;
  --gold: #dba949;
  --line: #3c2f26;
  --shadow: 20 60% 3%;
  --scrim-a: rgba(15, 9, 6, 0.4);
  --scrim-b: rgba(12, 7, 5, 0.85);
  --card-surface: rgba(37, 27, 21, 0.88);
  --ok: #8fac6c;
  --error: #e08260;
}
:root[data-theme="light"] {
  --bg: #fbf3e6;
  --bg-alt: #f3e6cf;
  --ink: #3a2620;
  --ink-soft: #7a5f4e;
  --rose: #d97e88;
  --rose-deep: #b85864;
  --rose-ink: #ffffff;
  --sage: #75824f;
  --gold: #b8801f;
  --line: #e7d3ad;
  --shadow: 28 40% 10%;
  --scrim-a: rgba(32, 20, 12, 0.28);
  --scrim-b: rgba(28, 16, 10, 0.72);
  --card-surface: rgba(251, 243, 230, 0.9);
  --ok: #5c7a3f;
  --error: #b4522f;
}

/* ── reset & base ──────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

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

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

code, .code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.45em;
}

/* ── bow mark (pure CSS, used as a recurring signature) ───────────────── */

.bow {
  --bow-size: 1em;
  display: inline-block;
  width: var(--bow-size);
  height: calc(var(--bow-size) * 0.6);
  position: relative;
  flex-shrink: 0;
}
.bow::before, .bow::after {
  content: "";
  position: absolute;
  top: 0;
  width: 46%;
  height: 100%;
  background: var(--rose);
  border-radius: 60% 40% 60% 40% / 80% 80% 20% 20%;
}
.bow::before { left: 0; transform: rotate(-18deg); transform-origin: right center; }
.bow::after { right: 0; transform: rotate(18deg); transform-origin: left center; }
.bow span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 44%;
  background: var(--rose-deep);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

/* ── ribbon divider (mathematically generated wave) ──────────────────── */

.ribbon-divider {
  width: 100%;
  background: var(--bg);
  padding: 9px 0;
  position: relative;
  z-index: 1;
}
.ribbon-divider .wrap { height: 22px; overflow: hidden; opacity: 0.8; }
.ribbon-divider svg { width: 100%; height: 100%; display: block; }
.ribbon-divider path {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ── nav ───────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px -20px transparent;
  transition: box-shadow 0.25s ease;
}
.nav.is-scrolled {
  box-shadow: 0 8px 24px -16px hsl(var(--shadow) / 0.35);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ink);
}
.nav-links {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 600;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--rose-deep); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--rose);
  color: var(--rose-ink);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.nav-cta:hover { background: var(--rose-deep); transform: translateY(-1px); }

/* ── photo sections (hero, features, commands sit on real photos) ───────── */

.photo-section {
  position: relative;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
.photo-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--scrim-a), var(--scrim-b));
  z-index: -1;
}

/* ── hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  color: var(--on-photo);
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-photo);
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: var(--fs-hero);
  line-height: 1.08;
  max-width: 16ch;
  margin: 0 auto;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}
.hero h1 em {
  font-style: italic;
  color: var(--rose);
}
.hero-sub {
  max-width: 46ch;
  margin: 1.5rem auto 0;
  color: var(--on-photo-soft);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--rose);
  color: var(--rose-ink);
  box-shadow: 0 10px 24px -10px hsl(var(--shadow) / 0.55);
}
.btn-primary:hover { background: var(--rose-deep); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--rose); color: var(--rose-deep); }
.btn.large { padding: 1rem 2.1rem; font-size: 1.05rem; }

.photo-section .btn-ghost {
  color: var(--on-photo);
  border-color: rgba(255, 255, 255, 0.4);
}
.photo-section .btn-ghost:hover {
  border-color: var(--on-photo);
  color: var(--on-photo);
  background: rgba(255, 255, 255, 0.1);
}

.hero-prefix {
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--on-photo-soft);
}
.hero-prefix code {
  margin: 0 0.15em;
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--on-photo);
}

/* ── features ──────────────────────────────────────────────────────────── */

.features { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head {
  max-width: 52ch;
  margin: 0 auto 3rem;
  text-align: center;
}
.section-head h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: var(--fs-h2);
  color: var(--on-photo);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}
.section-head p {
  margin-top: 0.75rem;
  color: var(--on-photo-soft);
}

.tag-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.75rem 1.75rem;
  position: relative;
}
.tag-row::before {
  content: "";
  position: absolute;
  top: -1.4rem;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.45);
  display: none;
}
@media (min-width: 760px) {
  .tag-row::before { display: block; }
}

.tag-card {
  position: relative;
  background: var(--card-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 1.9rem 1.5rem 1.6rem;
  clip-path: polygon(
    12% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 22%
  );
  box-shadow: 0 18px 34px -20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tag-card::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}
.tag-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px -18px rgba(0, 0, 0, 0.55);
}
.tag-card .bow { margin-bottom: 0.9rem; --bow-size: 1.6em; }
.tag-card h3 {
  font-family: var(--body);
  font-weight: 700;
  font-size: var(--fs-h3);
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.tag-card p {
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.tag-card .tag-detail {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--sage);
  font-weight: 700;
}

/* ── commands / menu ───────────────────────────────────────────────────── */

.commands { padding: clamp(3rem, 7vw, 5rem) 0; }
.menu {
  background: var(--card-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: 0 24px 46px -24px rgba(0, 0, 0, 0.5);
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem 3rem;
}
.menu-cat h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.menu-cat dl { margin: 0; }
.menu-cat .cmd {
  display: block;
  padding: 0.55rem 0;
  border-bottom: 1px dotted var(--line);
}
.menu-cat .cmd:last-child { border-bottom: none; }
.menu-cat dt code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 0.88em;
}
.menu-cat dd {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.menu-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ── cta band ──────────────────────────────────────────────────────────── */

.cta-band {
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.cta-band h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: var(--fs-h2);
  max-width: 20ch;
  margin: 0 auto 1.75rem;
}

/* ── footer ────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
footer .wordmark { font-size: 1.1rem; margin-bottom: 0.4rem; justify-content: center; display: inline-flex; }
footer .footer-mark {
  display: block;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  border: 1.5px solid var(--line);
}

/* ── dashboard ─────────────────────────────────────────────────────────── */

.dash-body { background: var(--bg); }

.dash-main {
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(3rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

.dash-state p { color: var(--ink-soft); }

.dash-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.dash-hero-card {
  text-align: center;
  max-width: 46ch;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.dash-hero-card .bow { margin-bottom: 0.25rem; }
.dash-hero-card h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.4rem);
}
.dash-hero-card p { color: var(--ink-soft); }
.dash-hero-card .btn { margin-top: 0.5rem; }

.dash-user-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.dash-user-bar img { border-radius: 50%; border: 1.5px solid var(--line); }
.dash-user-bar span { font-weight: 700; flex: 1; }
.dash-signout { padding: 0.5rem 1rem; font-size: 0.85rem; }

.dash-guild-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.dash-guild-tile {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.dash-guild-tile:hover { transform: translateY(-2px); border-color: var(--rose); }
.dash-empty { color: var(--ink-soft); }

.dash-back {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
}
.dash-back:hover { color: var(--rose-deep); }

.dash-card h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.dash-stat-row, .dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.dash-stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.dash-stat-value {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}
.dash-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

.dash-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.dash-field { display: flex; flex-direction: column; gap: 0.4rem; }
.dash-field-wide { grid-column: 1 / -1; }
.dash-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-field input, .dash-field select {
  font-family: var(--body);
  font-size: 0.98rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.dash-field input:focus, .dash-field select:focus {
  outline: 2px solid var(--rose);
  outline-offset: 1px;
}

.dash-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.dash-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.dash-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.dash-save-status { font-size: 0.88rem; font-weight: 700; color: var(--ink-soft); }
.dash-save-ok { color: var(--ok); }
.dash-save-error { color: var(--error); }
.dash-error { color: var(--error); }

/* ── scroll reveal (progressive enhancement, see site.js) ────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dash-global h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: var(--fs-h2);
  text-align: center;
  margin-bottom: 1.75rem;
}
