/* ============================================================
   TIKI SYRUPS — exotic mid-century theme
   Light: sun-bleached menu paper. Dark: tiki bar after sundown.
   ============================================================ */

:root {
  --paper: #f7edd8;
  --paper-deep: #f1e2c4;
  --panel: #fdf6e7;
  --ink: #4a3b2a;
  --ink-soft: #7a6449;
  --rust: #b5502a;
  --rust-deep: #8f3c1e;
  --teal: #1f6f63;
  --green: #3e6b3f;
  --gold: #c98a2d;
  --bamboo: #6b4a2f;
  --line: #d9c7a3;
  --shadow: rgba(74, 59, 42, .18);
  --glow: transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c130d;
    --paper-deep: #160e09;
    --panel: #2a1d13;
    --ink: #f0e2c8;
    --ink-soft: #c4ab87;
    --rust: #e07a4a;
    --rust-deep: #f0956a;
    --teal: #4fd1b8;
    --green: #7fb069;
    --gold: #ffb454;
    --bamboo: #a97c50;
    --line: #4a3524;
    --shadow: rgba(0, 0, 0, .5);
    --glow: rgba(255, 180, 84, .08);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Woven mat texture behind everything */
.mat {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, var(--shadow) 14px 15px),
    repeating-linear-gradient(-45deg, transparent 0 14px, var(--shadow) 14px 15px),
    var(--paper);
  opacity: .18;
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  text-align: center;
  padding: 2.2rem 1rem 1.2rem;
  background:
    radial-gradient(ellipse at 50% -40%, var(--glow), transparent 65%),
    linear-gradient(var(--paper-deep), var(--paper));
  border-bottom: 3px solid var(--rust);
  overflow: hidden;
}

.masthead-inner { position: relative; z-index: 2; }

.logo {
  width: 56px;
  height: 56px;
  color: var(--rust);
  filter: drop-shadow(0 2px 0 var(--shadow));
}

.masthead h1 {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  font-size: clamp(1.9rem, 6vw, 3rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rust);
  text-shadow: 2px 2px 0 var(--shadow);
}

.masthead h1 a { color: inherit; text-decoration: none; }

.masthead-sub {
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

.masthead-leaves {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 22px;
  fill: var(--teal);
  opacity: .5;
  z-index: 1;
}

/* Drifting hibiscus petals */
.petals { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.petal {
  position: absolute;
  top: -1.5em;
  color: var(--rust);
  opacity: .5;
  font-size: 1.1rem;
  animation: drift 9s linear infinite;
}
.petal.p1 { left: 8%;  animation-delay: 0s;   color: var(--rust); }
.petal.p2 { left: 28%; animation-delay: 2.2s; color: var(--gold); font-size: .9rem; }
.petal.p3 { left: 55%; animation-delay: 4.5s; color: var(--teal); }
.petal.p4 { left: 74%; animation-delay: 1.3s; color: var(--rust); font-size: 1.3rem; }
.petal.p5 { left: 90%; animation-delay: 6s;   color: var(--gold); }

@keyframes drift {
  0%   { transform: translateY(-10%) rotate(0deg); opacity: 0; }
  12%  { opacity: .55; }
  100% { transform: translateY(160px) rotate(300deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .petal { animation: none; display: none; }
  html { scroll-behavior: auto; }
}

/* ---------- layout ---------- */

main {
  flex: 1;
  width: min(680px, 100% - 2rem);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  outline: none;
}

.intro {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  padding: 0 .5rem;
}

/* ---------- category sections ---------- */

.category { margin-bottom: 2.5rem; }

.category-head { text-align: center; }

.category h2 {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 1.25rem;
  color: var(--teal);
}

.category-blurb {
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
}

.rope {
  color: var(--bamboo);
  height: 12px;
  margin: .8rem auto 1.2rem;
  width: min(320px, 80%);
  opacity: .7;
}
.rope svg { width: 100%; height: 100%; display: block; }

/* ---------- recipe cards ---------- */

.cards { display: grid; gap: .8rem; }

.card {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 0 var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  /* bamboo edge on the left */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: repeating-linear-gradient(180deg, var(--bamboo) 0 14px, var(--gold) 14px 16px);
  opacity: .65;
}

.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--shadow);
  border-color: var(--rust);
}

.card-icon {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  color: var(--rust);
}
.card-icon svg { width: 100%; height: 100%; }

.card-body { display: flex; flex-direction: column; min-width: 0; }

.card-name {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .95rem;
  color: var(--rust);
  font-weight: 700;
}

.card-tagline { font-style: italic; font-size: .88rem; color: var(--ink-soft); }
.card-yield  { font-size: .78rem; color: var(--teal); letter-spacing: .05em; margin-top: .15rem; }

.card-go {
  margin-left: auto;
  color: var(--gold);
  font-size: 1.3rem;
  flex: 0 0 auto;
}

/* ---------- recipe detail ---------- */

.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--teal);
  text-decoration: none;
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  letter-spacing: .08em;
  font-size: .9rem;
  text-transform: uppercase;
}
.back:hover { text-decoration: underline; }

.recipe-head { text-align: center; }

.recipe-icon {
  display: inline-block;
  width: 54px; height: 54px;
  color: var(--rust);
}
.recipe-icon svg { width: 100%; height: 100%; }

.recipe-kicker {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .75rem;
  color: var(--teal);
}

.recipe-head h2 {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--rust);
  margin: .1rem 0;
}

.recipe-tagline { font-style: italic; color: var(--ink-soft); }
.recipe-basemakes { font-size: .85rem; color: var(--teal); letter-spacing: .04em; margin-top: .3rem; }

/* ---------- yield controls ---------- */

.yield-box {
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  margin: 1.2rem 0 1.5rem;
  box-shadow: 0 3px 0 var(--shadow);
}

.yield-label {
  display: block;
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .8rem;
  color: var(--gold);
  margin-bottom: .6rem;
  text-align: center;
}

.yield-row { display: flex; align-items: center; gap: .9rem; }

input[type="range"] {
  flex: 1;
  accent-color: var(--rust);
  height: 2rem;
  cursor: pointer;
}

.yield-num {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: .25rem .55rem;
}

.yield-num input {
  width: 4ch;
  border: none;
  background: transparent;
  color: var(--rust);
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: right;
}
.yield-num input:focus { outline: none; }
.yield-num input::-webkit-outer-spin-button,
.yield-num input::-webkit-inner-spin-button { -webkit-appearance: none; }
.yield-num input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.yield-unit { color: var(--ink-soft); font-size: .85rem; }

.yield-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: .4rem;
  font-size: .9rem;
  color: var(--ink-soft);
  font-style: italic;
}

.scale-badge {
  font-style: normal;
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: .1rem .6rem;
}

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }

.chip {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  font-size: .8rem;
  letter-spacing: .05em;
  border: 1.5px solid var(--bamboo);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: .3rem .8rem;
  cursor: pointer;
  transition: all .12s ease;
}

.chip:hover { border-color: var(--rust); color: var(--rust); }

.chip-on {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--paper);
}

.chip-reset { border-style: dashed; color: var(--ink-soft); }

/* ---------- panels: ingredients / steps / notes ---------- */

.panel {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 2px 0 var(--shadow);
}

.panel h3 {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 1rem;
  color: var(--teal);
  margin-bottom: .6rem;
  border-bottom: 2px dotted var(--line);
  padding-bottom: .35rem;
}

.ings { list-style: none; }

.ing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .55rem;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--line);
}
.ing:last-child { border-bottom: none; }

.ing-qty {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  font-weight: 700;
  color: var(--rust);
  white-space: nowrap;
}

.ing-qty .oz { font-weight: 400; font-size: .8rem; color: var(--ink-soft); }

.ing-name { color: var(--ink); }

.ing-link { color: var(--teal); text-decoration: underline dotted; text-underline-offset: 3px; }
.ing-link:hover { color: var(--rust); }

.ing-note {
  flex-basis: 100%;
  font-size: .82rem;
  font-style: italic;
  color: var(--ink-soft);
}

.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: .55rem; }
.steps li::marker {
  color: var(--gold);
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  font-weight: 700;
}

.panel-notes { border-left: 4px solid var(--gold); }
.panel-notes p { margin-bottom: .5rem; font-size: .93rem; }
.panel-notes p:last-child { margin-bottom: 0; }

.storage {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: .92rem;
  margin-top: 1.4rem;
}

/* ---------- misc ---------- */

.notfound { text-align: center; padding: 3rem 1rem; }
.notfound h2 {
  font-family: 'Trebuchet MS', 'Avenir Next', Futura, Verdana, sans-serif;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--rust);
}
.notfound a { color: var(--teal); }

.footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  border-top: 3px solid var(--rust);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: .82rem;
}

.footer-tiki { margin-top: .4rem; letter-spacing: .4em; color: var(--gold); }

/* view transitions */
.home, .recipe { animation: fadein .25s ease; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home, .recipe { animation: none; }
  .card, .chip { transition: none; }
}
