/* townsville.nl — placeholder. Palette and type follow the business card:
   logo red, ink black, Delicious throughout. */

@font-face { font-family: "Delicious"; src: url("../fonts/Delicious-Roman.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Delicious"; src: url("../fonts/Delicious-Italic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Delicious"; src: url("../fonts/Delicious-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Delicious"; src: url("../fonts/Delicious-Heavy.otf") format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --red: #e52320;
  --red-hi: #f2473c;
  --red-lo: #a8121a;
  --ink: #231f20;
  --bg: #ffffff;
  --fg: #231f20;
  --muted: #6f6869;
  --line: rgba(35, 31, 32, .14);
  --card-shadow: rgba(35, 31, 32, .3);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141112;
    --fg: #f6f2f2;
    --muted: #a8a0a1;
    --line: rgba(255, 255, 255, .12);
    --card-shadow: rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Delicious", system-ui, sans-serif;
  font-size: 1.15rem;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; border-radius: 6px; }
.hero :focus-visible { outline-color: #fff; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: radial-gradient(120% 90% at 50% 40%, var(--red-hi) 0%, var(--red) 45%, var(--red-lo) 100%);
}
/* Faint contour rings radiating from the logo. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background: repeating-radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .07) 0 1px, transparent 1px 64px);
  animation: contour 14s linear infinite;
}
@keyframes contour { to { transform: scale(1.12); opacity: .4; } }

.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3.5vh, 2.2rem);
  padding: 4.5rem 1rem 6.5rem;
  text-align: center;
  pointer-events: none;
}

.hero-mark { width: min(46vh, 72vw, 500px); aspect-ratio: 1; }
.hero-mark img { width: 100%; height: 100%; filter: brightness(0) invert(1); transition: opacity .6s; }
.particles-on .hero-mark img { opacity: 0; }

.wordmark {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.6rem, 5.4vw, 3.6rem);
  line-height: 1;
  white-space: nowrap;
}
.wordmark .town {
  display: inline-block;
  letter-spacing: .22em;
  margin-right: -.22em;
  animation: track 2s var(--ease) .4s both;
}
@keyframes track { from { letter-spacing: 1.1em; opacity: 0; filter: blur(10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(1rem); } }

.hero-tag {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  opacity: .92;
  animation: rise 1.2s var(--ease) 1.8s both;
}

.hero-corner {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  z-index: 1;
  margin: 0;
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  pointer-events: none;
  animation: rise 1s var(--ease) 2.4s both;
}
.hero-hint { left: 1.25rem; opacity: .75; max-width: 45vw; }
.hero-status { right: 1.25rem; display: flex; align-items: center; gap: .6rem; }

.scroll-cue {
  position: absolute;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  font-size: .75rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  animation: rise 1s var(--ease) 2.6s both;
}
.scroll-cue span { width: 1px; height: 52px; background: #fff; animation: drip 2.2s var(--ease) infinite; }
@keyframes drip {
  0%    { transform: scaleY(0); transform-origin: top; }
  50%   { transform: scaleY(1); transform-origin: top; }
  50.1% { transform: scaleY(1); transform-origin: bottom; }
  100%  { transform: scaleY(0); transform-origin: bottom; }
}

/* Status dot; takes its colour from the surrounding text. */
.pulse { position: relative; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; flex: none; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 2s ease-out infinite; }
@keyframes ping { to { transform: scale(3.2); opacity: 0; } }

/* ---------- Marquee ---------- */

.marquee { overflow: hidden; padding: clamp(1rem, 2.5vw, 1.6rem) 0; border-bottom: 1px solid var(--line); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee-track span {
  padding-right: .45em;
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 1.05;
  color: var(--red);
  white-space: nowrap;
}
.marquee-track .o { color: transparent; -webkit-text-stroke: 2px var(--red); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section { max-width: 1200px; margin: 0 auto; padding: clamp(4.5rem, 12vw, 9rem) clamp(1rem, 6vw, 6rem); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1.75rem;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--red);
}
.eyebrow::before { content: ""; width: 2.25rem; height: 2px; background: currentColor; }

.statement { margin: 0; font-weight: 700; font-size: clamp(1.75rem, 4.4vw, 3.6rem); line-height: 1.14; }
.statement .w { opacity: .13; transition: opacity .45s; }
.statement .w.on { opacity: 1; }
.statement .hl { color: var(--red); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: clamp(3.5rem, 8vw, 6rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.stats li { display: flex; flex-direction: column; gap: .35rem; padding: 1.6rem 1.5rem 0 0; }
.stats li + li { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.label { font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.value {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-variant-numeric: tabular-nums;
}
.stats .pulse { color: var(--red); }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .stats li { padding: 1.4rem 0; }
  .stats li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: center;
  padding-top: 0;
}
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

.contact h2 {
  margin: 0 0 1.25rem;
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: .95;
}
.contact h2 em { display: block; font-weight: 400; color: var(--red); }
.lead { max-width: 34ch; margin: 0 0 2.25rem; color: var(--muted); }

.actions { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; margin: 0; padding: 0; list-style: none; }

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1.5rem;
  border: 2px solid var(--red);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
  transition: color .35s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.btn:hover, .btn:focus-visible { color: #fff; }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn-quiet { border-color: var(--line); }

/* ---------- Business card ---------- */

.card-stage { display: grid; place-items: center; perspective: 1400px; padding: 1rem 0 2rem; }
.card-float { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-16px) rotate(-1deg); } }

.card {
  --rx: 0deg;
  --ry: 0deg;
  --flip: 0deg;
  --gx: 50%;
  --gy: 25%;
  position: relative;
  display: block;
  width: min(300px, 70vw);
  aspect-ratio: 55 / 85;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  container-type: inline-size;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip)));
  transition: transform .8s var(--ease);
}
.card.flipped { --flip: 180deg; }

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 3cqw;
  text-align: left;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 40px 70px -25px var(--card-shadow), 0 0 0 1px rgba(0, 0, 0, .05);
}
/* Glare that follows the pointer. */
.card-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .55), transparent 55%);
  mix-blend-mode: soft-light;
}

.card-front { padding: 20cqw 8cqw 10cqw 22.6cqw; background: #fff; color: var(--ink); }
.card-front .card-logo { width: 22cqw; margin-bottom: 25cqw; }
.card-name { font-weight: 700; font-size: 6.4cqw; letter-spacing: .02em; line-height: 1.2; }
.card-role { margin-bottom: 7cqw; font-size: 5.2cqw; letter-spacing: .12em; }
.card-line { font-size: 5.2cqw; letter-spacing: .07em; line-height: 1.5; }
.card-foot { margin-top: auto; font-size: 5.2cqw; color: var(--red); }

.card-back {
  align-items: center;
  padding: 22cqw 6cqw 12cqw;
  background: #ed1c24;
  color: #fff;
  transform: rotateY(180deg);
}
.card-back .card-logo { width: 30cqw; filter: brightness(0) invert(1); }
.card-mark { margin: 5cqw -.14em 0 0; font-size: 8cqw; letter-spacing: .14em; white-space: nowrap; }
.card-url { margin-top: auto; font-size: 5.2cqw; letter-spacing: .12em; }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 6vw, 6rem) max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}
.footer-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--fg); }
.footer-brand img { width: 28px; height: 28px; }

/* ---------- Scroll reveal & cursor (only when JS runs) ---------- */

.js .reveal { opacity: 0; transform: translateY(2rem); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.stats .reveal:nth-child(2) { transition-delay: .12s; }
.stats .reveal:nth-child(3) { transition-delay: .24s; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: none;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid var(--red);
  border-radius: 50%;
  pointer-events: none;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), border-color .3s, background-color .3s;
}
.cursor.light { border-color: #fff; }
.cursor.big { width: 72px; height: 72px; margin: -36px 0 0 -36px; background: rgba(229, 35, 32, .12); }
.cursor.light.big { background: rgba(255, 255, 255, .15); }
@media (hover: hover) and (pointer: fine) { .js .cursor { display: block; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .statement .w { opacity: 1; }
}
