/*
 * TrashFree public website.
 *
 * Colours, fonts, radii and shadows are the same design tokens as the admin
 * dashboard (trash-free/packages/ui/src/styles/globals.css). Rules that apply:
 *   - no gradients, no large saturated areas; navy primary, light-blue secondary
 *   - orange `brand` is the accent and always carries dark text
 *   - Fraunces for headings, Geist for everything else
 *   - body text 7:1, secondary text and controls 4.5:1, control borders 3:1
 */

@font-face {
  font-family: "Fraunces Variable";
  src: url("fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Variable";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --background: #f5f7fa;
  --foreground: #0f172a;
  --card: #ffffff;
  --muted: #eef2f6;
  --muted-foreground: #475569;
  --border: #e2e8f0;
  --input: #7c8aa0;
  --ring: #2563eb;

  --primary: #1e3a5f;
  --primary-hover: #16304f;
  --primary-foreground: #ffffff;
  --secondary: #e3ecf7;
  --secondary-hover: #d3e1f2;
  --secondary-foreground: #1e3a5f;
  --brand: #f97316;
  --brand-hover: #ea6a0f;
  --brand-foreground: #2a1205;

  --bezel: #0f172a;
  --shadow-card: 0 1px 2px rgb(15 23 42 / 0.05), 0 4px 14px rgb(15 23 42 / 0.05);
  --shadow-card-hover: 0 2px 4px rgb(15 23 42 / 0.06), 0 10px 24px rgb(15 23 42 / 0.09);
  --shadow-device: 0 2px 6px rgb(15 23 42 / 0.1), 0 24px 48px rgb(15 23 42 / 0.16);

  --radius: 0.625rem;
  --font-sans: "Geist Variable", system-ui, sans-serif;
  --font-heading: "Fraunces Variable", Georgia, serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --page: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0b1220;
    --foreground: #e5eaf2;
    --card: #131c2e;
    --muted: #1b2538;
    --muted-foreground: #9aa7ba;
    --border: #263247;
    --input: #6b7a90;
    --ring: #60a5fa;

    --primary: #8db4f0;
    --primary-hover: #a9c7f5;
    --primary-foreground: #0b1a33;
    --secondary: #1c2a44;
    --secondary-hover: #253656;
    --secondary-foreground: #d3e2f7;
    --brand: #fb923c;
    --brand-hover: #fda55f;
    --brand-foreground: #2a1205;

    --bezel: #2c394f;
    --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.04), 0 4px 16px rgb(0 0 0 / 0.35);
    --shadow-card-hover: 0 0 0 1px rgb(255 255 255 / 0.06), 0 10px 28px rgb(0 0 0 / 0.45);
    --shadow-device: 0 24px 48px rgb(0 0 0 / 0.45);
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  margin: 0;
  text-wrap: pretty;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn svg {
  flex: none;
}

.btn-brand {
  background: var(--brand);
  color: var(--brand-foreground);
}

.btn-brand:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-card-hover);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-card-hover);
}

.btn-lg {
  min-height: 3.25rem;
  padding-inline: 1.4rem;
  font-size: 1.0625rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--foreground);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--secondary);
}

.nav-toggle .icon-close,
.nav-open .nav-toggle .icon-open {
  display: none;
}

.nav-open .nav-toggle .icon-close {
  display: block;
}

/* ---------- Device frame ---------- */

.device {
  width: 100%;
  margin: 0;
  padding: 0.5rem;
  border-radius: 1.9rem;
  background: var(--bezel);
  box-shadow: var(--shadow-device);
}

/* The screenshots run edge to edge; the strips above and below continue the
   app's own header and tab-bar colours so the rounded corners don't cut into
   the interface. */
.screen {
  overflow: hidden;
  border-radius: 1.45rem;
}

.screen::before,
.screen::after {
  content: "";
  display: block;
  height: 0.9rem;
  background: #ffffff;
}

.screen::after {
  background: #f3f1ef;
}

.screen img {
  width: 100%;
}

/* ---------- Hero: split like the admin sign-in screen ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  background: var(--card);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-block: clamp(3rem, 6vw, 5.5rem);
  padding-left: max(var(--gutter), (100vw - var(--page)) / 2);
  padding-right: clamp(2rem, 5vw, 5rem);
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.35rem, 1.3rem + 3.7vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
}

.hero .lead {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--muted-foreground);
  font-size: 1.1875rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
}

.hero-note {
  max-width: 30rem;
  margin-top: 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.975rem;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(2.5rem, 4vw, 3.5rem) 2rem;
  background: var(--secondary);
}

.hero-visual .device {
  max-width: 18.5rem;
}

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

.section {
  padding-block: clamp(4rem, 8vw, 7rem);
}

.section-card {
  background: var(--card);
}

.section-head {
  max-width: 40rem;
}

.section-head p {
  margin-top: 1rem;
  color: var(--muted-foreground);
}

/* ---------- Two ways to hand over waste ---------- */

.tracks {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem clamp(2.5rem, 6vw, 5.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.track-title {
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.track-title p {
  margin-top: 0.35rem;
  color: var(--muted-foreground);
  font-size: 1rem;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
}

.steps strong {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
}

.steps span {
  display: block;
  color: var(--muted-foreground);
  font-size: 1rem;
}

.track-link {
  margin-top: 1.75rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius);
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.track-link strong {
  font-weight: 650;
}

/* ---------- Screens ---------- */

.screens {
  display: grid;
  grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: 3rem clamp(3rem, 8vw, 7.5rem);
  align-items: start;
}

.screens-device {
  max-width: 19rem;
}

.screens-body {
  display: grid;
  gap: 2.75rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  margin: 0;
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0.25rem 0 0;
  color: var(--muted-foreground);
  font-size: 1rem;
}

.history {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 2.5rem;
  align-items: center;
  padding-top: 2.75rem;
  border-top: 1px solid var(--border);
}

.history p {
  margin-top: 0.6rem;
  color: var(--muted-foreground);
  font-size: 1rem;
}

.history img {
  width: 100%;
  border-radius: 1rem;
  box-shadow: var(--shadow-card-hover);
}

/* ---------- Download ---------- */

.download {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.download-band {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.download p {
  max-width: 36rem;
  margin-top: 1rem;
}

.download .btn {
  margin-top: 1.75rem;
}

.download .download-note {
  margin-top: 1rem;
  font-size: 0.975rem;
}

.qr-card {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-card);
}

.qr-card img {
  width: 100%;
  border-radius: 0.4rem;
}

.qr-card strong {
  display: block;
  font-weight: 600;
}

.qr-card figcaption span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  font-size: 0.975rem;
}

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

.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.contact-facts {
  margin: 2.25rem 0 0;
}

.contact-facts div {
  padding-block: 1.1rem;
  border-top: 1px solid var(--border);
}

.contact-facts dt {
  font-weight: 600;
}

.contact-facts dd {
  margin: 0.2rem 0 0;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.975rem;
  font-weight: 550;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 1rem;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--primary);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--ring);
  border-radius: var(--radius);
}

.form-end {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-items: center;
  gap: 1rem 1.5rem;
}

.form-end p {
  flex: 1 1 15rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.975rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding-block: 2rem;
}

.site-footer p {
  margin-right: auto;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.35rem;
}

/* ---------- Privacy pages ---------- */

.legal {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 46rem);
  gap: 2.5rem clamp(2.5rem, 6vw, 5.5rem);
  padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(4rem, 8vw, 6rem);
}

.legal-toc {
  position: sticky;
  top: 6.5rem;
  align-self: start;
  font-size: 0.95rem;
}

.legal-toc strong {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc li a {
  display: block;
  padding: 0.4rem 0.75rem;
  margin-left: -0.75rem;
  border-radius: 0.4rem;
  color: var(--muted-foreground);
  text-decoration: none;
}

.legal-toc li a:hover {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.legal-body h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.85rem);
}

.legal-body .subtitle {
  margin: 0.9rem 0 2.25rem;
  color: var(--muted-foreground);
}

.legal-body h2 {
  margin: 3rem 0 0.9rem;
  font-size: 1.5rem;
}

.legal-body h3 {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.125rem;
}

.legal-body p + p {
  margin-top: 1rem;
}

.legal-body ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal-body li {
  margin-bottom: 0.5rem;
}

.legal-body li::marker {
  color: var(--primary);
}

.legal-body code {
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: var(--muted);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.legal-body .table-scroll {
  overflow-x: auto;
  margin: 1.1rem 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.legal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.legal-body th,
.legal-body td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal-body tr:last-child td {
  border-bottom: 0;
}

.legal-body th {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  font-weight: 550;
}

.legal-body td:first-child {
  min-width: 8.5rem;
  font-weight: 550;
}

.legal-body .contact-box {
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius);
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.legal-body .closing {
  margin-top: 3rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* ---------- Motion: one short entrance, nothing hidden without it ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero-visual .device {
    animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero-copy > :nth-child(n + 3) {
    animation-delay: 0.12s;
  }

  .hero-visual .device {
    animation-delay: 0.16s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 60rem) {
  .tracks,
  .download,
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }

  .screens {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 2.5rem 3rem;
  }

  .facts,
  .history {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal {
    grid-template-columns: minmax(0, 46rem);
  }

  .legal-toc {
    position: static;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-card);
  }
}

@media (max-width: 47.5rem) {
  .hero,
  .screens {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    padding: 2.75rem var(--gutter) 2.5rem;
  }

  .screens-device {
    order: 2;
    margin-inline: auto;
  }

  .nav-toggle {
    display: inline-flex;
    margin-right: -0.6rem;
  }

  .site-header .wrap {
    gap: 0.5rem;
  }

  /* Without JavaScript the links stay visible as a second row. */
  .site-nav {
    order: 3;
    flex-wrap: wrap;
    width: 100%;
    padding-bottom: 0.75rem;
  }

  .site-header .wrap {
    flex-wrap: wrap;
    padding-block: 0.6rem;
    min-height: 0;
  }

  .js .site-nav {
    display: none;
    flex-direction: column;
    padding-bottom: 0.25rem;
  }

  .js .nav-open .site-nav {
    display: flex;
  }

  .site-nav a {
    padding-block: 0.75rem;
  }

  .contact-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

html:not(.js) .nav-toggle {
  display: none;
}

@media (max-width: 26rem) {
  .qr-card {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 1.1rem;
    padding: 1.1rem;
  }

  .brand {
    font-size: 1.15rem;
  }

  .hero-actions .btn,
  .download .btn,
  .form-end .btn {
    width: 100%;
  }
}
