/* The app's look, as custom properties: names follow Croze/Design/Tokens/ColorTheme.swift (dark) and
   Croze/Design/Type/TypeStyle.swift. Violet is for figures only; no inline style anywhere (the CSP forbids it). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-Latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ColorTheme.dark */
  --ground: #15120F;
  --text: #E6EAF4;
  --secondary: #9A9CA8;
  --hairline: #2C2723;
  --violet: #6F5FC4;
  --violet-text: #8F82D6;
  --uv-wash: #211B2B;
  --uv-wash-line: #3F3462;
  --glass-fill: rgb(230 234 244 / 0.10);
  --glass-line: rgb(230 234 244 / 0.16);
  --sheet-fill: rgb(230 234 244 / 0.09);
  --pill-fill: rgb(230 234 244 / 0.08);
  --cell-separator: rgb(230 234 244 / 0.12);
  --primary-fill: #FFFFFF;
  --primary-label: #000000;

  /* The three faces: FontFamily.display (wdth 88 on the boards), .text, .figure */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-text: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-figure: "Geist Mono", ui-monospace, "SF Mono", monospace;

  /* TypeStyle sizes */
  --size-display-name: 54px;   /* displayName: 500, -0.025em, 1.0 */
  --size-display-title: 34px;  /* displayTitle: 600, -0.02em, 1.05 */
  --size-display-spec: 21px;   /* displaySpec: 500 */
  --size-body: 16px;           /* body: 400 */
  --size-row-title: 17px;      /* rowTitle */
  --size-row-subtitle: 13px;   /* rowSubtitle */
  --size-caption: 13px;        /* caption, footnote */
  --size-button: 16px;         /* buttonLabel: 500 */

  --column: 600px;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--size-body);
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* 44 pt tall with or without the toolbar control, so the wordmark and the page under it sit where they do on every page. */
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding-top: 28px; }
.wordmark {
  font-family: var(--font-display);
  font-stretch: 88%;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}

main { flex: 1; padding-top: 48px; padding-bottom: 64px; }

.site-footer {
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--hairline);
  color: var(--secondary);
  font-size: var(--size-caption);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 88%;
}
h1 {
  font-size: var(--size-display-name);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
}
h2 {
  font-size: var(--size-display-spec);
  font-weight: 500;
  line-height: 1.2;
}
p { margin: 0; }

a { color: inherit; text-decoration-color: var(--secondary); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--violet-text); outline-offset: 3px; }

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

/* Violet appears on figures, never on text blocks. */
.figure {
  font-family: var(--font-figure);
  color: var(--violet-text);
}

.hairline { border: 0; border-top: 1px solid var(--hairline); margin: 24px 0; }

details > summary { cursor: pointer; color: var(--secondary); }

.quiet h1 { font-size: var(--size-display-title); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.quiet p { margin-top: 12px; color: var(--secondary); }

/* The app's own controls, each a link into Croze (controls.ts). Colours are the tokens; nothing here moves on hover or after a tap. */

/* The toolbar's "+" and the beam button (reveal.ts): a 44 pt glass circle (Reveal-interactive.dc.html: 1px line, 10% fill, blur 24 saturate 160). */
.glass-button,
.beam-button {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--glass-line);
  background: var(--glass-fill);
  color: var(--text);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}

/* HeartCountView.pill without its count: 32 pt, 10 pt side padding, the 8% fill, the heart in secondary. */
.heart-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--pill-fill);
  color: var(--secondary);
}

/* FollowButtonView .filled .regular: 36 pt, the foreground as its fill and the ground as its label (microButton, 13 pt 600). */
.follow-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.follow {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 20px;
  border-radius: 18px;
  background: var(--text);
  color: var(--ground);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.glass-button:focus-visible,
.heart-pill:focus-visible,
.follow:focus-visible { outline: 2px solid var(--violet-text); outline-offset: 3px; }

/* ---- /d/<uuid> and /i/<uuid>: the read-only drink page (W-02). Measures are the app's DrinkScreen's. ---- */

.drink h1 { overflow-wrap: anywhere; }

/* The boards set Bricolage with both axes (Main.dc.html: 'wdth' 88, 'opsz' 96); the browser's automatic opsz would
   follow the font size and draw it looser. */
.drink h1,
.drink .ing,
.drink .description,
.drink .teaser { font-variation-settings: "wdth" 88, "opsz" 96; }

/* "Name · @handle", 14 pt (TextStyle.sourceRow / creatorName), 16 under the title. */
.byline { margin-top: 16px; font-size: 14px; line-height: 1.2; color: var(--secondary); }
.byline a { text-decoration: none; }
.byline .name { font-weight: 600; color: var(--text); }

/* 42 under the title or byline: the header's 20 and the body's 22. One figure gutter for the page: the grid's first column is as wide as the widest figure, nowrap, 14 to the text. */
.spec-rows {
  list-style: none;
  margin: 42px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  row-gap: 6px;
  align-items: baseline;
}
.spec-rows li { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: baseline; }
.spec-rows .figure { font-size: 16px; line-height: 1.2; white-space: nowrap; }
.spec-rows .ing {
  font-family: var(--font-display);
  font-stretch: 88%;
  font-weight: 500;
  font-size: var(--size-display-spec);
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.spec-rows a.ing:hover { text-decoration: underline; text-decoration-color: var(--secondary); }

/* Method and garnish: body, 14 apart, 26 under the rows. */
.paragraphs { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.paragraphs p { font-size: var(--size-body); line-height: 1.45; overflow-wrap: anywhere; }

/* TextStyle.displaySpecDescription: 19 pt Bricolage, 1.35, secondary. */
.description {
  margin-top: 26px;
  font-family: var(--font-display);
  font-stretch: 88%;
  font-size: 19px;
  line-height: 1.35;
  color: var(--secondary);
  overflow-wrap: anywhere;
}

/* A house-made ingredient below its own hairline: name 15 semibold, recipe line 15 secondary. */
.house { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.house-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.house-name a { text-decoration: none; }
.house-line { margin-top: 3px; font-size: 15px; line-height: 1.4; color: var(--secondary); overflow-wrap: anywhere; }

/* The credit: two lines of the history, clipped; "more" opens the rest in place with no script. */
.credit { margin-top: 28px; }
.credit .teaser {
  font-family: var(--font-display);
  font-stretch: 88%;
  font-size: 17px;
  line-height: 1.35;
  color: var(--secondary);
  overflow-wrap: anywhere;
}
.credit summary { position: relative; display: block; list-style: none; cursor: pointer; }
.credit summary::-webkit-details-marker { display: none; }
.credit summary .teaser {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  padding-right: 44px;
}
.credit .more {
  position: absolute;
  right: 0;
  bottom: 0;
  padding-left: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--violet-text);
  background: linear-gradient(to right, transparent, var(--ground) 12px);
}
.credit details[open] summary .teaser { display: block; -webkit-line-clamp: unset; line-clamp: unset; padding-right: 0; line-height: 1.4; }
.credit details[open] .more { display: none; }
.sources { list-style: none; margin: 10px 0 0; padding: 6px 0 0; border-top: 1px solid var(--hairline); }
.sources li { padding: 11px 0; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.sources .citation { color: var(--secondary); }

/* The reveal (reveal.ts): a closed <details> whose summary is the app's beam button; its body is the app's revealed
   header under the drink's own. The body's resting styles are the end state; once the details is open, the keyframes
   below play the app's choreography (RevealChoreography.swift) into them, each time it opens. The beam's polygon is
   Reveal-interactive.dc.html's clip-path, which the board draws on a 402 pt canvas, as fractions of the card's width. */
.reveal { margin-top: 28px; }
/* DrinkScreen's beam control: BeamGlyph(22) on a 44 pt glass circle, trailing as in the toolbar. Off: clear glass, the glyph in
   violetText at 35% wedge. On (.glassProminent, tint onFill): filled violet, the glyph in onLabel, the wedge solid. */
.reveal > .beam-button {
  margin-left: auto;
  list-style: none;
  cursor: pointer;
  color: var(--violet-text);
}
.beam-button::-webkit-details-marker { display: none; }
.beam-button .wedge { fill: currentColor; fill-opacity: 0.35; }
.reveal[open] > .beam-button {
  background: var(--violet);
  border-color: var(--violet);
  color: var(--primary-fill);
}
.reveal[open] > .beam-button .wedge { fill-opacity: 1; }
.beam-button:focus-visible { outline: 2px solid var(--violet-text); outline-offset: 3px; }
.reveal-card {
  position: relative;
  overflow: hidden;
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--uv-wash-line);
  border-radius: 16px;
  background-color: var(--uv-wash);
}
.reveal + .spec-rows { margin-top: 26px; }
.reveal-beam {
  position: absolute;
  inset: 0;
  background: var(--violet);
  opacity: 0.26;
  clip-path: polygon(-2.49% 0%, 17.41% 0%, 124.38% 100%, 62.19% 100%);
  pointer-events: none;
}
.reveal-head { position: relative; display: flex; align-items: center; gap: 10px; }
.reveal-glass { flex: none; width: 30px; height: 40px; overflow: visible; }
.reveal-glass .liquid { fill: var(--violet); fill-opacity: 0.7; stroke: none; }
.reveal-glass .outline { stroke: #CFC7F0; }
/* The paired drink's name: displayTitle, a step under the page's own 54 pt name above it. */
.reveal-name {
  min-width: 0;
  font-size: var(--size-display-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variation-settings: "wdth" 88, "opsz" 96;
  overflow-wrap: anywhere;
}
.reveal-name a { text-decoration: none; }
.reveal-name a:hover { text-decoration: underline; text-decoration-color: var(--secondary); }
/* TextStyle.displayReason: 28 pt Bricolage, 1.15, violet text, 16 under the name. */
.reveal-reason {
  position: relative;
  margin-top: 16px;
  font-family: var(--font-display);
  font-stretch: 88%;
  font-size: 28px;
  line-height: 1.15;
  color: var(--violet-text);
  font-variation-settings: "wdth" 88, "opsz" 96;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal[open] .reveal-card { animation: reveal-wash 0.45s ease-in-out 0.25s both; }
  .reveal[open] .reveal-beam { animation: reveal-sweep 0.9s cubic-bezier(0.45, 0, 0.15, 1) both, reveal-beam-in 0.15s ease-in-out both; }
  .reveal[open] .reveal-glass .liquid { animation: reveal-liquid 0.4s ease-in-out 0.35s both; }
  .reveal[open] .reveal-glass .outline { animation: reveal-outline 0.4s ease-in-out 0.35s both; }
  .reveal[open] .reveal-name { animation: reveal-fade 0.3s ease-in-out 0.4s both; }
  .reveal[open] .reveal-reason { animation: reveal-rise 0.35s ease-in-out 0.55s both; }
}
/* Reduce Motion: beam, wash and liquid are simply there; the name and the reason still fade, over 0.2 s, with no movement. */
@media (prefers-reduced-motion: reduce) {
  .reveal[open] .reveal-name,
  .reveal[open] .reveal-reason { animation: reveal-fade 0.2s ease-in-out both; }
}

@keyframes reveal-wash {
  from { background-color: transparent; border-color: transparent; }
}
@keyframes reveal-sweep {
  from { clip-path: polygon(6.97% 0%, 7.96% 0%, 7.96% 0%, 6.97% 0%); }
}
@keyframes reveal-beam-in {
  from { opacity: 0; }
}
@keyframes reveal-liquid {
  from { fill: var(--secondary); fill-opacity: 0.12; }
}
@keyframes reveal-outline {
  from { stroke: var(--secondary); }
}
@keyframes reveal-fade {
  from { opacity: 0; }
}
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(6px); }
}

/* ---- /l/<uuid> and /u/<handle>: the list and the profile (W-03). Measures are ListScreen's and ProfileScreen's. ---- */

.list h1,
.profile h1,
.profile h2,
.row-name,
.list .owner .name { overflow-wrap: anywhere; }
.list h1,
.profile h1 { font-variation-settings: "wdth" 88, "opsz" 96; }

/* AvatarView: initials in a glass circle, the display face at 0.4 of the circle, tracked 0.02em. */
.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  background: var(--glass-fill);
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "wdth" 88;
  letter-spacing: 0.02em;
  line-height: 1;
  overflow: hidden;
}
.avatar.small { width: 24px; height: 24px; font-size: 10px; }
.avatar.large { width: 68px; height: 68px; font-size: 27px; }

/* A list: displayTitle (34 pt, 600), the owner row 9 under it, then the rows 18 below. */
.list h1 { font-size: var(--size-display-title); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.owner-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.owner { flex: 1; min-width: 0; font-size: 14px; line-height: 1.2; }
.owner a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; max-width: 100%; }
.owner .owner-text { min-width: 0; color: var(--secondary); }
.owner .name { font-weight: 600; color: var(--text); }

/* DrinkRowView: 60 pt rows, a hairline under each, the rank in a 24 pt right-aligned mono gutter, a chevron at the end. */
.rows { list-style: none; margin: 18px 0 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--hairline); }
.rows a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 8px 24px 8px 0;
  text-decoration: none;
}
.rows a::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--secondary);
  border-right: 2px solid var(--secondary);
  transform: translateY(-50%) rotate(45deg);
}
.rows a:hover .row-name { text-decoration: underline; text-decoration-color: var(--secondary); text-underline-offset: 3px; }
.rows .rank { flex: none; width: 24px; font-size: 17px; line-height: 1.2; text-align: right; }
.rows .row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rows .row-name { font-size: var(--size-row-title); line-height: 1.2; }
.rows .row-sub { font-size: var(--size-row-subtitle); line-height: 1.2; color: var(--secondary); overflow-wrap: anywhere; }

/* A profile: the 68 pt mark and the name 16 apart, the bio 12 under, sections 26 above their header. */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-names { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile h1 { font-size: 30px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.05; }
.profile .handle { font-size: 14px; line-height: 1.2; color: var(--secondary); overflow-wrap: anywhere; }
.bio { margin-top: 12px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.profile-section { margin-top: 26px; }
.profile-section h2 { font-family: var(--font-text); font-stretch: 100%; font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: 0; }
.profile-section .rows { margin-top: 10px; border-top: 1px solid var(--hairline); }
