/* Tidal Brew — site styles. Mobile first. */

:root {
  /* Brand palette */
  --teal: #0F5C63;
  --teal-deep: #0A4247;
  --teal-ink: #072F33;
  --cream: #F6EFE3;
  --mist: #CFE0DD;          /* secondary text on teal */
  --copper: #B87333;        /* brand copper: decoration only, fails text contrast */
  --copper-bright: #E39A5B; /* button fill on teal, with teal-ink text */
  --copper-soft: #F6C293;   /* copper text on teal */
  --copper-deep: #8A4F1F;   /* copper text and buttons on cream */

  --font-display: "Quicksand", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale, ratio about 1.25 to 1.3 */
  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.75rem, 1.45rem + 1.3vw, 2.35rem);
  --step-3: clamp(2.25rem, 1.75rem + 2.3vw, 3.35rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4rem, 2.8rem + 5vw, 7rem);

  --radius: 14px;
  --wrap: 72rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--teal);
  color: var(--cream);
  font: 400 var(--step-0)/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); line-height: 1.25; }

p { margin: 0 0 var(--space-2); max-width: 62ch; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--copper-soft); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 3px; border-radius: 4px; }
.band-cream :focus-visible { outline-color: var(--teal-ink); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--mist); }
.band-cream .lede { color: var(--teal); }
.muted { color: var(--mist); }
.small { font-size: var(--step--1); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--cream); color: var(--teal-ink); padding: 0.75rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* ---------- Project notice ---------- */
.notice {
  margin: 0; max-width: none;
  background: var(--cream); color: var(--teal-ink);
  font-size: var(--step--1); line-height: 1.4; text-align: center;
  padding: 0.5rem 1rem;
}
.notice strong { font-weight: 700; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 5; }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: var(--space-3); row-gap: var(--space-1);
  padding-block: var(--space-2);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-1);
  text-decoration: none; margin-right: auto;
}
.brand img { width: 44px; height: 44px; border-radius: 12px; }

.menu-btn {
  font: 700 var(--step-0) var(--font-display);
  min-height: 44px; padding: 0.4rem 1rem;
  color: var(--cream); background: transparent;
  border: 2px solid var(--mist); border-radius: 999px; cursor: pointer;
}
.menu-btn[hidden] { display: none; }

.site-nav { flex-basis: 100%; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; column-gap: var(--space-3); row-gap: 0;
}
.site-nav a {
  display: inline-block; padding: 0.6rem 0;
  font-family: var(--font-display); font-weight: 700;
  text-decoration: none; border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--mist); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--copper-soft); }
.header-cta { display: none; }

/* With JS on small screens, the nav becomes a toggled list */
@media (max-width: 55.99rem) {
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav.is-open ul { flex-direction: column; padding-bottom: var(--space-2); }
  .js .site-nav.is-open a { padding: 0.75rem 0; font-size: var(--step-1); }
}

@media (min-width: 56rem) {
  .site-nav { flex-basis: auto; }
  .menu-btn { display: none; }
  .header-cta { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7rem 1.4rem;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 var(--step-0)/1.2 var(--font-display);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--copper-bright); color: var(--teal-ink); }
.btn-primary:hover { background: #EDAA70; }
.btn-ghost { border-color: var(--mist); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); }
.band-cream .btn-primary { background: var(--copper-deep); color: var(--cream); }
.band-cream .btn-primary:hover { background: #774319; }
.band-cream .btn-ghost { border-color: var(--teal); color: var(--teal-ink); }
.btn[aria-disabled="true"] { opacity: 0.75; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }

.text-link {
  font-family: var(--font-display); font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--copper-soft);
}
.band-cream .text-link { text-decoration-color: var(--copper-deep); }
.text-link::after { content: " \2192"; }

/* ---------- Bands and edges ---------- */
.band { padding-block: var(--space-6); }
.band-tight { padding-block: var(--space-5); }
.band-cream { background: var(--cream); color: var(--teal-ink); }
.band-deep { background: var(--teal-deep); }

.edge { display: block; line-height: 0; background: var(--from, var(--teal)); color: var(--to, var(--cream)); }
.edge svg { display: block; width: 100%; height: clamp(22px, 3.5vw, 52px); overflow: visible; }
.edge path { fill: currentColor; }

/* ---------- Signature: the tide line ---------- */
.tide { display: block; color: var(--copper-bright); padding-block: var(--space-2); }
.tide svg { display: block; width: 100%; height: 44px; overflow: visible; }
.tide path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tide .tide-faint { stroke: var(--mist); opacity: 0.35; stroke-width: 1.5; }
.band-cream .tide { color: var(--copper-deep); }
.band-cream .tide .tide-faint { stroke: var(--teal); }
.js .tide svg { clip-path: inset(0 calc((1 - var(--draw, 0)) * 100%) 0 0); }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-3) var(--space-4); }
.hero-grid { display: grid; gap: var(--space-4); align-items: center; }
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 40ch; }
.hero-photo {
  margin: 0; justify-self: center; width: min(100%, 26rem);
  border-radius: 16px; overflow: hidden; background: #F3E7D6;
}
.hero-photo img { width: 100%; aspect-ratio: 840 / 1104; object-fit: cover; }
.facts {
  list-style: none; margin: var(--space-3) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
  font-size: var(--step--1); color: var(--mist);
}
.facts li { display: inline-flex; gap: 0.4rem; }
.facts strong { color: var(--copper-soft); font-weight: 700; }

@media (min-width: 56rem) {
  .hero { padding-block: var(--space-4) var(--space-5); }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: var(--space-5); }
  .hero-photo { justify-self: end; }
}

/* Page heads on inner pages */
.page-head { padding-block: var(--space-4) var(--space-4); }
.page-head h1 { max-width: 20ch; }
.page-head .lede { max-width: 48ch; }

/* ---------- Split: photo beside text ---------- */
.split { display: grid; gap: var(--space-4); align-items: center; }
.split figure { margin: 0; }
.split img, .photo { border-radius: var(--radius); width: 100%; }
@media (min-width: 56rem) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .split.photo-right figure { order: 2; }
  .split.wide-photo { grid-template-columns: 1.3fr 1fr; }
}

/* ---------- Steps as a plain time strip ---------- */
.strip { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.strip li { padding-left: 1.1rem; border-left: 2px solid var(--copper-bright); }
.strip h3 { margin-bottom: 0.25rem; }
.strip p { color: var(--mist); }

/* ---------- Flavour list ---------- */
.flavours { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: 0; }
.flavour {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: var(--space-3);
  align-items: center; padding-block: var(--space-3);
  border-top: 1px solid rgb(7 47 51 / 0.18);
}
.flavour:last-child { border-bottom: 1px solid rgb(7 47 51 / 0.18); }
.flavour img { width: 5.5rem; height: 9rem; object-fit: cover; border-radius: 12px; }
.flavour h3 { margin-bottom: 0.25rem; }
.flavour p { margin-bottom: 0.5rem; }
.price { font-family: var(--font-display); font-weight: 700; color: var(--copper-deep); white-space: nowrap; }
.band:not(.band-cream) .price, .hero .price { color: var(--copper-soft); }
.flavour .meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: baseline; }
@media (min-width: 48rem) {
  .flavour { grid-template-columns: 7rem 1fr auto; gap: var(--space-4); }
  .flavour img { width: 7rem; height: 11rem; }
  .flavour .meta { justify-content: flex-end; text-align: right; flex-direction: column; align-items: flex-end; }
}

/* ---------- Limited drop ---------- */
.drop-tag {
  display: inline-block; margin-bottom: var(--space-2);
  padding: 0.3rem 0.85rem; border-radius: 999px;
  background: var(--copper-soft); color: var(--teal-ink);
  font: 700 var(--step--1)/1.3 var(--font-display);
}

/* ---------- Price table (subscriptions) ---------- */
.compare { width: 100%; border-collapse: collapse; margin-top: var(--space-3); font-size: var(--step-0); }
.compare caption { text-align: left; font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); margin-bottom: var(--space-2); }
.compare th, .compare td { text-align: left; padding: 0.85rem 0.5rem; border-bottom: 1px solid rgb(207 224 221 / 0.3); vertical-align: top; }
.compare thead th { font-family: var(--font-display); color: var(--mist); font-size: var(--step--1); }
.compare td:last-child, .compare th:last-child { text-align: right; }
.band-cream .compare th, .band-cream .compare td { border-bottom-color: rgb(7 47 51 / 0.18); }
.band-cream .compare thead th { color: var(--teal); }
.compare .best td { font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- Definition list (how it works) ---------- */
.how { display: grid; gap: var(--space-3); margin: var(--space-3) 0 0; }
.how div { display: grid; gap: 0.25rem; }
.how dt { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.how dd { margin: 0; color: var(--mist); max-width: 52ch; }
.band-cream .how dd { color: var(--teal-ink); }
@media (min-width: 48rem) { .how { grid-template-columns: 1fr 1fr; column-gap: var(--space-5); } }

/* ---------- FAQ ---------- */
.faq { margin-top: var(--space-3); border-top: 1px solid rgb(7 47 51 / 0.18); }
.faq details { border-bottom: 1px solid rgb(7 47 51 / 0.18); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1rem 2rem 1rem 0; position: relative;
  font: 700 var(--step-0)/1.4 var(--font-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 0.9rem;
  font-size: 1.4rem; line-height: 1; transition: transform 200ms var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding-bottom: 1rem; }

/* ---------- Offer block ---------- */
.offer { display: grid; gap: var(--space-3); }
.offer .big-price { font: 700 var(--step-3)/1 var(--font-display); color: var(--copper-deep); margin: 0; }
.band:not(.band-cream) .offer .big-price { color: var(--copper-soft); }

/* ---------- Note / callout ---------- */
.note {
  border: 2px dashed var(--mist); border-radius: var(--radius);
  padding: var(--space-3); max-width: 46rem;
}
.band-cream .note { border-color: var(--teal); }
.note h2, .note h3 { margin-bottom: 0.5rem; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-3); max-width: 34rem; margin-top: var(--space-3); }
.field { display: grid; gap: 0.35rem; }
.field label { font-family: var(--font-display); font-weight: 700; }
.field .hint { font-size: var(--step--1); color: var(--teal); }
.field input, .field textarea, .field select {
  font: inherit; color: var(--teal-ink); background: #FFFDF9;
  border: 2px solid var(--teal); border-radius: 10px;
  padding: 0.7rem 0.85rem; min-height: 48px; width: 100%;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 3px solid var(--copper-deep); outline-offset: 2px; }
.form-status { font-weight: 700; }
.form-status:empty { display: none; }

/* ---------- Comparison (brew guide) ---------- */
.vs { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.vs section { border-top: 3px solid var(--copper-deep); padding-top: var(--space-2); }
.vs ul { margin: 0; padding-left: 1.2rem; }
.vs li + li { margin-top: 0.4rem; }
@media (min-width: 48rem) { .vs { grid-template-columns: 1fr 1fr; gap: var(--space-5); } }

.prose { max-width: 44rem; }
.prose h2 { margin-top: var(--space-4); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 var(--space-2); }
.prose li + li { margin-top: 0.4rem; }

.ideas { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.ideas article h3 { margin-bottom: 0.35rem; }
.ideas article p { color: var(--mist); }
@media (min-width: 56rem) { .ideas { grid-template-columns: 1.4fr 1fr 1fr; align-items: start; } .ideas article:first-child h3 { font-size: var(--step-2); } }

/* ---------- Blog list ---------- */
.posts { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.posts li { padding-block: var(--space-3); border-top: 1px solid rgb(207 224 221 / 0.3); }
.posts li:last-child { border-bottom: 1px solid rgb(207 224 221 / 0.3); }
.posts h2 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.status { font-size: var(--step--1); color: var(--copper-soft); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-deep); padding-bottom: var(--space-4); }
.site-footer .tide { padding-top: var(--space-4); }
.footer-grid { display: grid; gap: var(--space-4); padding-block: var(--space-4); }
.footer-grid h2 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.footer-grid p { color: var(--mist); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.footer-grid ul a { display: inline-block; padding-block: 0.35rem; }
.hashtag { font-family: var(--font-display); font-weight: 700; color: var(--copper-soft); }
.footer-base { border-top: 1px solid rgb(207 224 221 / 0.25); padding-top: var(--space-3); font-size: var(--step--1); color: var(--mist); }
.footer-base p { max-width: 70ch; }
@media (min-width: 56rem) { .footer-grid { grid-template-columns: 1.4fr 0.8fr 1fr; gap: var(--space-5); } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .tide svg { clip-path: none; }
}

/* ---------- Utilities and variants ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.h3-size { font-size: var(--step-1); }
.posts-compact { margin-top: 0.5rem; }
.posts-compact li { padding-block: 0.85rem; border-color: rgb(7 47 51 / 0.18); }
.posts-compact a { font-family: var(--font-display); font-weight: 700; text-decoration-color: var(--copper-deep); }
.band-cream .posts li { border-color: rgb(7 47 51 / 0.18); }
.faq-dark, .faq-dark details { border-color: rgb(207 224 221 / 0.3); }

/* Fixes after first browser check */
.edge { position: relative; z-index: 1; margin-bottom: -2px; }
.edge svg { margin-bottom: -1px; }
.flavours { max-width: 52rem; }
@media (min-width: 56rem) {
  .flavour-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: var(--space-5); align-items: start; }
  .flavour-layout .flavours { margin-top: 0; }
  .flavour-layout .intro { position: sticky; top: var(--space-4); }
}
.js .tide.tide-intro svg { transition: clip-path 900ms var(--ease-out); }
.edge { background: linear-gradient(to bottom, var(--from, var(--teal)) calc(100% - 4px), var(--to, var(--cream)) 0); }
.btn.header-cta { display: none; }
@media (min-width: 56rem) { .btn.header-cta { display: inline-flex; } }
@media (max-width: 47.99rem) {
  .lede { font-size: 1.15rem; }
  .hero { padding-top: var(--space-2); }
  .hero .actions { gap: 0.75rem; }
  .hero .actions .btn { padding-inline: 1.15rem; }
  .hero-photo { width: min(100%, 20rem); }
}
@media (max-width: 47.99rem) { .flavour .meta { grid-column: 2; margin-top: -0.75rem; } .flavour { row-gap: 0; align-items: start; } }
.vs-extra { margin-top: var(--space-4); }
