/* Cork Companion website. Colors and type follow docs/Design-Guide.md ("Candlelight").
   No web fonts, no scripts: the serif is the system's (New York on Apple devices). */

:root {
  color-scheme: light dark;

  /* Light (Paper / Ink / Claret) */
  --bg: #FAF6EF;          /* Paper */
  --surface: #F3EBDD;     /* Cream, used as a soft card on Paper */
  --text: #231A1C;        /* Ink */
  --muted: #6B5F58;       /* Ink, muted */
  --accent: #7A2632;      /* Claret */
  --on-accent: #FAF6EF;
  --line: #E4D9C8;
  --peak: #8A6410;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 38rem;
  --wide: 60rem;
  --gap: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1416;        /* Night */
    --surface: #261D20;   /* Night surface */
    --text: #F3EBDD;      /* Cream */
    --muted: #B3A79B;     /* Cream, muted */
    --accent: #D4AE84;    /* Cork (accent, dark) */
    --on-accent: #1A1416;
    --line: #3A2E31;
    --peak: #E8C062;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 2em 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); margin-top: 0.5em; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.75rem); }
h3 { font-size: 1.2rem; margin-top: 1.5em; }

p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
strong { font-weight: 600; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.5rem 1rem; z-index: 10; }

/* Header and footer */
.site-header, .site-footer, main {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
}
.brand img { width: 3rem; height: auto; }

.site-header nav { display: flex; gap: 0.25rem; margin: 0 -0.75rem; } /* text lines up with the page edge */
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
.site-header nav a:hover { background: var(--surface); }
.site-header nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.5rem; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Text pages */
.prose { max-width: var(--measure); }
.lede { font-size: 1.2rem; color: var(--muted); }
.muted { color: var(--muted); }

/* Draft notice and placeholders */
.draft {
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1rem 0 2rem;
  background: var(--surface);
}
.draft p:last-child { margin-bottom: 0; }

.todo {
  background: none;
  color: var(--accent);
  border: 1px dashed currentColor;
  border-radius: 4px;
  padding: 0 0.3em;
  font-size: 0.95em;
}

/* Landing page */
.hero { padding: clamp(1.5rem, 6vw, 4rem) 0 1rem; display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { margin-top: 0; max-width: 16ch; }
.hero .lede { max-width: 34rem; }

@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.15fr 1fr; }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}
.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--peak);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
}
.button:hover { filter: brightness(1.08); }

/* The answer card: one of the few brand moments */
.answer {
  background: var(--surface);
  border-radius: 18px;
  padding: 1.5rem;
  max-width: 26rem;
  justify-self: center;
  width: 100%;
  box-shadow: 0 1px 0 var(--line);
}
.answer .label { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.answer .who { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.7rem 0.2rem 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.9375rem;
}
.chip span {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--on-accent); color: var(--accent);
  font-size: 0.8rem; font-weight: 600;
}
.answer .wine { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin: 0 0 0.35rem; }
.answer .why { margin: 0 0 1rem; }
.answer .serve { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; color: var(--muted); font-size: 0.9375rem; margin: 0; padding: 0; list-style: none; }
.answer .note { margin: 1rem 0 0; color: var(--muted); font-size: 0.8125rem; }

.features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}
.features li {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 0;
}
.features h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.features p { color: var(--muted); }

.split { display: grid; gap: 1rem 2.5rem; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; } }

/* FAQ */
details {
  border-bottom: 1px solid var(--line);
  padding: 0.25rem 0;
}
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 600;
  list-style: none;
  gap: 0.75rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  flex: none;
  width: 1.25rem;
  color: var(--accent);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
  text-align: center;
}
details[open] summary::before { content: "\2212"; }
details > :not(summary) { margin-left: 2rem; }

.toc { padding-left: 1.2rem; }
.updated { color: var(--muted); font-size: 0.9375rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* An invite code on /join/<code> (made by the CloudFront function in server/infra/joinPage.ts). */
.code { font: 600 2rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
