/* Caveau site, Cellar Book look (matches the app's src/constants/theme.ts).
   Cellar stone surfaces, label paper text, one claret for the action,
   gilt only for money. Brygada 1918 for wine names, headlines and figures;
   Public Sans for everything else. */

@font-face { font-family: "Brygada 1918"; src: url("/fonts/Brygada1918-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Brygada 1918"; src: url("/fonts/Brygada1918-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/PublicSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/PublicSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --stone: #12100E;        /* page */
  --stone-2: #1A1714;      /* raised block */
  --stone-3: #221E1A;      /* phone frame, selected */
  --rule: #2C2722;         /* ledger rule */
  --rule-strong: #3E3730;
  --paper: #ECE4D3;        /* primary text */
  --paper-2: #A69C8B;      /* secondary text */
  --paper-3: #857C6F;      /* muted text, meta */
  --claret: #7D2233;       /* the one action */
  --claret-press: #621A28;
  --on-claret: #F5EADF;
  --claret-text: #D8A5A3;  /* claret as ink on stone */
  --gilt: #BE9E5E;         /* money only */
  --book: "Brygada 1918", Georgia, serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--stone);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img { display: block; max-width: 100%; height: auto; }

a { color: var(--paper); text-decoration: underline; text-decoration-color: rgba(216, 165, 163, 0.45); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color 160ms var(--ease), color 160ms var(--ease); }
a:hover { text-decoration-color: var(--claret-text); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--claret-text); outline-offset: 3px; border-radius: 4px; }

/* Header */
.site-head { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.wordmark { font-family: var(--book); font-weight: 500; font-size: 22px; line-height: 1; color: var(--paper); text-decoration: none; letter-spacing: 0.01em; }
.site-head nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.site-head nav a { color: var(--paper-2); text-decoration: none; }
.site-head nav a:hover { color: var(--paper); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--claret); color: var(--on-claret); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn-primary:hover { background: var(--claret-press); }
.btn-quiet { background: transparent; color: var(--paper); border: 1px solid var(--rule-strong); }
.btn-quiet:hover { background: var(--stone-2); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Type */
.display { font-family: var(--book); font-weight: 400; letter-spacing: -0.02em; line-height: 1.06; }
.label { font-size: 13px; color: var(--paper-3); line-height: 20px; }
.money { font-family: var(--book); color: var(--gilt); font-variant-numeric: tabular-nums lining-nums; }
.rule { height: 1px; background: var(--rule); border: 0; }

/* Phone frame around real app screens */
.phone {
  position: relative; width: 300px; border-radius: 48px; padding: 10px;
  background: var(--stone-3); border: 1px solid var(--rule-strong);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.phone .screen { border-radius: 38px; overflow: hidden; background: var(--stone); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 32px 0 64px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; font-size: 13px; color: var(--paper-3); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: var(--paper-2); text-decoration: none; }
.site-foot a:hover { color: var(--paper); }

@media (prefers-reduced-motion: no-preference) {
  .enter { animation: rise 420ms var(--ease) both; }
  .enter-2 { animation: rise 420ms var(--ease) 60ms both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------------------------------------------------------------------------
   Shared page frame and article pages (guides, atlas, legal, wine pages)
   ------------------------------------------------------------------------- */
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 32px; }
@media (max-width: 960px) { .wrap { padding-inline: 24px; } }
@media (max-width: 640px) { .site-head nav a.navlink { display: none; } }

.article { max-width: 720px; padding: 48px 0 32px; line-height: 1.7; }
.article .kicker { display: block; font-size: 13px; line-height: 20px; color: var(--paper-3); margin-bottom: 12px; }
.article h1 { font-family: var(--book); font-weight: 400; font-size: clamp(38px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 20px; }
.article .lede { color: var(--paper-2); font-size: 19px; line-height: 30px; margin-bottom: 32px; max-width: 36rem; }
.article h2 { font-family: var(--book); font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; margin: 64px 0 16px; padding-top: 48px; border-top: 1px solid var(--rule); }
.article h3 { font-family: var(--book); font-weight: 400; font-size: 20px; line-height: 28px; }
.article p { margin-bottom: 16px; color: var(--paper-2); }
.article p b, .article p strong { color: var(--paper); font-weight: 500; }
.article ul { padding-left: 20px; margin-bottom: 16px; color: var(--paper-2); }
.article ul li { margin-bottom: 8px; }
.article .note { color: var(--paper-3); font-size: 14px; line-height: 22px; }

/* Primary call to action on article pages */
.article .cta { display: inline-flex; align-items: center; height: 48px; padding: 0 20px; border-radius: 10px; background: var(--claret); color: var(--on-claret); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color 160ms var(--ease), transform 120ms var(--ease); }
.article .cta:hover { background: var(--claret-press); }
.article .cta:active { transform: scale(0.98); }

/* Numbered steps as ruled ledger lines */
.article .steps { list-style: none; counter-reset: s; margin: 8px 0 16px; }
.article .steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; padding: 16px 0; border-top: 1px solid var(--rule); }
.article .steps li:last-child { border-bottom: 1px solid var(--rule); }
.article .steps li::before { content: counter(s); font-family: var(--book); color: var(--paper-3); font-size: 17px; line-height: 27px; grid-row: 1 / span 2; }
.article .steps strong { display: block; font-weight: 500; color: var(--paper); }
.article .steps span { color: var(--paper-2); }

/* Two-column definition rows */
.article .cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; margin: 8px 0 16px; }
.article .col { padding: 14px 0; border-top: 1px solid var(--rule); }
.article .col b { display: block; font-weight: 500; color: var(--paper); }
.article .col code { font-family: var(--sans); color: var(--paper-2); font-size: 15px; }
@media (max-width: 560px) { .article .cols { grid-template-columns: 1fr; } }

.article pre { background: var(--stone-2); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 20px; margin: 16px 0; color: var(--paper); font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.8; overflow-x: auto; }

/* Ruled notes instead of filled cards */
.article .card { padding: 20px 0 4px; border-top: 1px solid var(--rule); margin: 0; }
.article .card:last-of-type { border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.article .card .kicker { margin-bottom: 4px; color: var(--paper); font-family: var(--book); font-size: 19px; }
.article .card p { margin: 0 0 16px; }

/* Tables: muted header, figures right-aligned */
.article table { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-size: 15px; }
.article th { text-align: left; color: var(--paper-3); font-size: 13px; font-weight: 400; padding: 8px 16px 8px 0; border-bottom: 1px solid var(--rule-strong); }
.article td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); color: var(--paper); vertical-align: baseline; }
.article th.num, .article td.num { text-align: right; padding-right: 0; white-space: nowrap; }
.article td.num { font-family: var(--book); color: var(--gilt); font-size: 17px; }

/* Closing call to action */
.end { padding: 64px 0 80px; margin-top: 64px; border-top: 1px solid var(--rule); }
.end h2 { font-family: var(--book); font-weight: 400; font-size: 32px; line-height: 1.15; margin: 0 0 12px; padding: 0; border: 0; color: var(--paper); }
.end p { color: var(--paper-2); margin-bottom: 24px; }
@media (max-width: 640px) { .article .cta, .end .cta { width: 100%; justify-content: center; } .article h2 { font-size: 24px; margin-top: 48px; padding-top: 40px; } }
