/* ==========================================================
   frogFM — Website v1 (draft)
   Minimal, postcard-led. No radio hardware visuals.
   ========================================================== */

@font-face { font-family: "Fredoka"; src: url("../assets/fonts/Fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../assets/fonts/Jost.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../assets/fonts/Jost-Italic.ttf") format("truetype"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../assets/fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../assets/fonts/BarlowCondensed-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --mud:    #413A30;
  --lime:   #D0FF0B;
  --cream:  #F4EDD3;
  --paper:  #FBF8EE;
  --poppy:  #B8323A;
  --mud-80: #675F55;
  --mud-20: #D9D3C4;

  --display: "Fredoka", "Jost", system-ui, sans-serif;
  --body:    "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --label:   "Barlow Condensed", "Jost", sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --shadow: 0 1px 2px rgba(65,58,48,.12), 0 18px 40px -12px rgba(65,58,48,.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.55;
  color: var(--mud);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Paper grain over everything, very faint */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .25 0 0 0 0 .22 0 0 0 0 .19 0 0 0 .8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Logo ---------- */
.logo { display: inline-block; line-height: 0; }
.logo svg { width: 100%; height: auto; display: block; }

/* ---------- Type helpers ---------- */
.kicker { font-family: var(--label); text-transform: uppercase; letter-spacing: .14em; font-size: 14px; color: var(--mud-80); }
.center { text-align: center; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: .95; letter-spacing: -.01em; }
h1 { font-size: clamp(52px, 7.4vw, 108px); margin: 18px 0 26px; }
h2 { font-size: clamp(40px, 5vw, 68px); text-align: center; margin-top: 10px; }
.sub { text-align: center; color: var(--mud-80); margin-top: 10px; }
/* "The hop": the word that jumps off the baseline */
.hop { display: inline-block; font-size: .5em; vertical-align: .95em; font-weight: 400; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--gutter);
  background: rgba(251,248,238,.88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.top .brand { width: 92px; color: var(--mud); }
.top nav { display: flex; gap: 28px; margin-left: auto; }
.top nav a, .listen { text-decoration: none; font-family: var(--label); text-transform: uppercase; letter-spacing: .12em; font-size: 14px; }
.top nav a { opacity: .7; }
.top nav a:hover { opacity: 1; }
.listen { background: linear-gradient(var(--lime), var(--lime)) 0 100% / 100% 6px no-repeat; padding: 0 2px; transition: background-size .2s; }
.listen:hover { background-size: 100% 100%; }
@media (max-width: 720px) { .top nav { display: none; } .listen { margin-left: auto; } }

/* ---------- Postcard pieces ---------- */
.card-front {
  background: var(--cream);
  padding: 12px;
  box-shadow: var(--shadow);
}
.card-front img { width: 100%; height: 100%; object-fit: cover; }

.card-back {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  max-width: 980px; margin: 44px auto 0;
  aspect-ratio: 3 / 2;
  background: var(--cream);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 48px);
}
.card-back > .message { padding-right: clamp(20px, 3.5vw, 44px); border-right: 1.5px solid rgba(65,58,48,.35); }
.card-back > .address { position: relative; padding-left: clamp(20px, 3.5vw, 44px); display: flex; flex-direction: column; }
.card-back::after {
  content: "POST CARD"; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  font-family: var(--label); letter-spacing: .4em; font-size: 12px; color: var(--mud-80);
}

/* Perforated stamp edge */
.stamp {
  align-self: flex-end;
  width: 110px; height: 130px; padding: 8px;
  background: #fff;
  --hole: radial-gradient(circle at center, #0000 3.2px, #000 3.7px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, var(--hole) -5px -5px / 10px 10px;
          mask: linear-gradient(#000 0 0) content-box, var(--hole) -5px -5px / 10px 10px;
  filter: drop-shadow(0 1px 1px rgba(65,58,48,.25));
  transform: rotate(3deg);
}
.stamp img { width: 100%; height: 100%; object-fit: cover; }

.postmark { position: absolute; top: 46px; right: 92px; width: 200px; height: 100px; color: var(--mud); opacity: .55; transform: rotate(-9deg); font-family: var(--label); pointer-events: none; }

.lines { list-style: none; margin-top: auto; }
.lines li, .lines label, .lines .to {
  display: block; border-bottom: 1.5px solid rgba(65,58,48,.35);
  padding: 14px 0 6px; font-size: 18px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(30px, 5vw, 80px); align-items: center;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(40px, 7vw, 100px) var(--gutter) clamp(80px, 10vw, 140px);
  min-height: min(calc(100vh - 70px), 920px);
}
.hero-text { position: relative; z-index: 2; }
.intro { font-size: clamp(21px, 1.9vw, 25px); line-height: 1.45; max-width: 30ch; }
.actions { display: flex; align-items: center; gap: 28px; margin-top: 40px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none;
  background: var(--mud); color: var(--cream);
  font-family: var(--label); text-transform: uppercase; letter-spacing: .14em; font-size: 15px;
  padding: 16px 30px; border-radius: 99px;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--lime); color: var(--mud); }
.link { font-family: var(--label); text-transform: uppercase; letter-spacing: .14em; font-size: 15px; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }

/* The pond: full-bleed behind the hero, drawn by js/pond.js. Water on the right, under the text on small screens. */
.hero { position: relative; isolation: isolate; }
.pond { position: absolute; z-index: 0; top: 0; bottom: 0; left: 50%; width: 100vw; height: 100%; transform: translateX(-50%); pointer-events: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: left; padding-bottom: max(70vw, 300px); }
}

/* ---------- Blocks ---------- */
.block { padding: clamp(70px, 9vw, 130px) var(--gutter); }
.block + .block { border-top: 1px solid var(--mud-20); max-width: 1240px; margin: 0 auto; }

/* About letter */
.letter .message { font-style: italic; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; padding-top: 26px; }
.letter .message p + p { margin-top: .9em; }
.letter .salute { font-family: var(--display); font-style: normal; font-size: clamp(26px, 2.6vw, 34px); line-height: 1; margin-bottom: 18px; }
.letter .sign span { font-family: var(--display); font-style: normal; font-size: 24px; }

/* ---------- Shows: flip cards ---------- */
.deck { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px); max-width: 1180px; margin: 56px auto 0; }
.flip { background: none; border: 0; padding: 0; cursor: pointer; perspective: 1400px; aspect-ratio: 3 / 2; text-align: left; }
.flip:nth-child(1) { transform: rotate(-2deg); }
.flip:nth-child(2) { transform: rotate(1.2deg) translateY(18px); }
.flip:nth-child(3) { transform: rotate(-.8deg); }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) { .flip:hover .flip-inner { transform: rotateY(180deg); } }
.face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--cream); box-shadow: var(--shadow); transition: opacity 0s .3s; }
/* Swap faces at the halfway point too: some engines ignore backface-visibility inside <button> */
.face.back { opacity: 0; }
.flip.is-flipped .face.front { opacity: 0; }
.flip.is-flipped .face.back { opacity: 1; }
@media (hover: hover) {
  .flip:hover .face.front { opacity: 0; }
  .flip:hover .face.back { opacity: 1; }
}
.face.front { padding: 10px; }
.face.front img { width: 100%; height: 100%; object-fit: cover; }
.face.back {
  transform: rotateY(180deg);
  display: flex; flex-direction: column; padding: 22px 24px;
  background:
    linear-gradient(rgba(65,58,48,.3), rgba(65,58,48,.3)) 62% 20px / 1.5px calc(100% - 40px) no-repeat,
    var(--cream);
}
.face.back > span { max-width: 56%; }
.face.back .when { font-family: var(--label); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; }
.face.back .when::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mud); margin-right: 8px; vertical-align: 1px; }
.face.back .name { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.1vw, 30px); line-height: 1; margin: 10px 0 8px; }
.face.back .desc { font-style: italic; font-size: 15px; line-height: 1.4; }
.face.back .who { margin-top: auto; font-size: 14px; color: var(--mud-80); }
.flip:focus-visible { outline: 3px solid var(--mud); outline-offset: 6px; }

@media (max-width: 900px) {
  .deck { grid-template-columns: 1fr; max-width: 460px; gap: 36px; }
  .flip:nth-child(n) { transform: none; }
}

/* ---------- Write to us ---------- */
.compose .message { display: block; padding-top: 26px; }
.compose textarea {
  width: 100%; height: 100%; resize: none; border: 0; outline: 0; background: transparent;
  font-style: italic; font-size: 20px; line-height: 40px;
  background-image: linear-gradient(transparent 39px, rgba(65,58,48,.18) 39px, rgba(65,58,48,.18) 40px);
  background-size: 100% 40px; background-attachment: local;
}
.compose textarea::placeholder { color: var(--mud-80); opacity: .8; }
.compose .lines label { display: flex; gap: 12px; align-items: baseline; }
.compose .lines label span { font-family: var(--label); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--mud-80); flex: none; }
.compose .lines input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 18px; }
.compose .lines label:focus-within { border-color: var(--mud); }
.compose .to { color: var(--mud-80); }

.stamp.send {
  border: 0; cursor: pointer; background: var(--lime);
  display: grid; place-items: center;
  transition: transform .2s;
}
.stamp.send span {
  width: 100%; height: 100%; display: grid; place-items: center;
  border: 1.5px solid var(--mud);
  font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--mud);
}
.stamp.send:hover { transform: rotate(0deg) scale(1.04); }
.stamp.send:focus-visible { outline: none; }
.stamp.send:focus-visible span { outline: 3px solid var(--mud); outline-offset: -8px; }
.compose.sent .stamp.send { background: var(--mud); }
.compose.sent .stamp.send span { color: var(--lime); border-color: var(--lime); font-size: 18px; }

/* Stack postcard backs on small screens */
@media (max-width: 760px) {
  .card-back { grid-template-columns: 1fr; aspect-ratio: auto; padding-top: 44px; }
  .card-back > .message { padding-right: 0; border-right: 0; border-bottom: 1.5px solid rgba(65,58,48,.35); padding-bottom: 28px; }
  .card-back > .address { padding-left: 0; padding-top: 28px; }
  .compose textarea { min-height: 240px; }
  .postmark { right: 80px; top: 30px; width: 170px; }
  .stamp { width: 90px; height: 110px; }
  .lines { margin-top: 24px; }
}

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 90px var(--gutter) 60px; border-top: 1px solid var(--mud-20); }
.foot .logo { width: 180px; color: var(--mud); }
.foot p { margin-top: 18px; font-family: var(--display); font-size: 24px; }
.foot .fine { font-family: var(--label); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--mud-80); margin-top: 30px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Little stamp on the back of each show card */
.face.back .mini-stamp {
  position: absolute; top: 18px; right: 20px;
  width: 54px; height: 64px; padding: 5px;
  background: #fff center / cover content-box;
  --hole: radial-gradient(circle at center, #0000 2.2px, #000 2.7px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, var(--hole) -3.5px -3.5px / 7px 7px;
          mask: linear-gradient(#000 0 0) content-box, var(--hole) -3.5px -3.5px / 7px 7px;
  transform: rotate(4deg);
}

/* ---------- Radio: footer bar ---------- */
body { padding-bottom: 84px; }
.radio-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  height: 84px; padding: 0 var(--gutter);
  background: var(--mud); color: var(--cream);
}
.radio-bar svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.radio-bar button { background: none; border: 0; cursor: pointer; }
.radio-bar button:focus { outline: none; }
.radio-bar button:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.rb-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--mud-80); }
.rb-progress i { display: block; height: 100%; width: 0; background: var(--lime); }

.rb-play {
  flex: none; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lime) !important; color: var(--mud);
  transition: transform .15s;
}
.rb-play:hover { transform: scale(1.06); }
.rb-play svg { width: 24px; height: 24px; }

.rb-np { flex: 1; min-width: 0; }
.rb-show, .rb-pop span, .rb-time { font-family: var(--label); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; }
.rb-show { display: flex; align-items: center; gap: 8px; color: var(--mud-20); }
.rb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mud-80); flex: none; }
.radio-bar.is-live .rb-show { color: var(--lime); }
.radio-bar.is-live .rb-dot { background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: rb-pulse 1.4s ease-in-out infinite; }
@keyframes rb-pulse { 50% { opacity: .3; } }
.rb-track { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; font-size: 17px; }
.rb-title { font-family: var(--display); font-size: 21px; }
.rb-artist { color: var(--mud-20); }

.rb-time { color: var(--mud-20); font-variant-numeric: tabular-nums; }
.rb-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--cream); }
.rb-btn:hover { background: var(--mud-80); }

.rb-vol { display: flex; align-items: center; gap: 8px; color: var(--mud-20); }
.rb-vol input { -webkit-appearance: none; appearance: none; width: 110px; height: 18px; background: transparent; cursor: pointer; }
.rb-vol input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--lime), var(--lime)) 0 / var(--p, 85%) 100% no-repeat, var(--mud-80); }
.rb-vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--lime); }
.rb-vol input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--mud-80); }
.rb-vol input::-moz-range-progress { height: 4px; background: var(--lime); }
.rb-vol input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--lime); }

.rb-pop {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 99px;
  color: var(--cream); border: 1.5px solid var(--mud-80) !important;
}
.rb-pop:hover { border-color: var(--lime) !important; color: var(--lime); }
.radio-bar.is-popped .rb-pop { border-color: var(--lime) !important; color: var(--lime); }
.radio-bar.is-popped .rb-vol, .radio-bar.is-popped .rb-time { visibility: hidden; }

@media (max-width: 760px) {
  .radio-bar { gap: 12px; }
  .rb-vol, .rb-time, .rb-pop span { display: none; }
  .rb-pop { padding: 9px; }
  .rb-title { font-size: 18px; }
}

/* Music switched off in the visitor's country */
.radio-bar button:disabled { opacity: .35; cursor: default; }
.radio-bar button:disabled:hover { transform: none; background: none; }
.radio-bar .rb-play:disabled:hover { background: var(--lime) !important; }
