/* =========================================
   THE ICE CREAM STANDARD — Global Styles
   ========================================= */

/* ---------- Theme Tokens ---------- */
:root {
  /* Fonts */
  --font-sans: "Roboto", system-ui, -apple-system, Segoe UI, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --font-display: "Anton", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;

  /* Brand Palette */
  --brand-dark: #1D130C;
  /* deep cocoa */
  --brand-cream: #F2E9DC;
  /* cream text */
  --brand-muted: #C9B8A6;
  /* muted cream */
  --brand-accent: #6E4F3A;
  /* caramel */
  --border-subtle: #3B2F25;

  /* Page Palette (dark is default now) */
  --bg-page: #120C08;
  /* site background */
  --text-primary: #F2E9DC;
  --text-muted: #C9B8A6;
  --link: #EADBC7;
  --link-hover: #FFF5E6;

  /* Layout */
  --container-max: 1200px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Motion */
  --ease-float: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 140ms;
  --dur-med: 220ms;
}

/* ---------- Light Mode Overrides ---------- */
[data-theme="light"] {
  --bg-page: #FFFCF7;
  --text-primary: #1F1A16;
  --text-muted: #6B625B;
  --link: #6E4F3A;
  --link-hover: #4F3829;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur-fast) ease, opacity var(--dur-fast) ease;
}

a:hover,
a:focus {
  color: var(--link-hover);
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 .5rem 0;
  color: var(--text-primary);
}

h4,
h5,
h6 {
  font-family: var(--font-sans);
  margin: 0 0 .5rem 0;
}

p {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

/* ---------- Layout Utilities — applies to all pages ---------- */

.container {
  max-width: var(--container-max, 1200px);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* sitewide default padding if a section has no container */
main>section {
  padding-inline: 1rem;
}

/* ---------- Utilities ---------- */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 3;
  box-orient: vertical;
}

/* ---------- HOMEPAGE HERO ---------- */
.ics-hero {
  background: #3b2f25;
  padding: 2rem 2rem 4rem;
}

.ics-hero__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
}

.ics-hero__text {
  flex: 2;
  padding-left: 4rem;
}

.ics-hero__headline {
  font-family: "Anton", sans-serif;
  font-size: 6rem;
  line-height: 1.1;
  margin-bottom: 2rem;
  color: #f2e9dc;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 400;
  word-break: break-word;
}

.ics-hero__btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background-color: #6e4f3a;
  border-radius: 10px;
  color: #fff;
  font-family: "Anton", sans-serif;
  font-size: 1.5rem;
  text-transform: uppercase;
  transition: background-color 0.25s ease, box-shadow 0.15s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ics-hero__btn:hover {
  background-color: #8d684e;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.ics-hero__image img {
  flex: 1;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
}

@media (max-width: 900px) {
  .ics-hero__content {
    flex-direction: column;
    text-align: center;
    padding: 0 1rem;
  }

  .ics-hero__text {
    padding-left: 0;
  }

  .ics-hero__headline {
    font-size: 3.5rem;
  }

  .ics-hero__image img {
    max-width: 80%;
    margin-top: 2rem;
  }
}

/* ---------- HOMEPAGE: LATEST REVIEWS ---------- */
.ics-latest {
  background-color: #26201B;
  padding: 2rem 2rem 3rem;
  border: 0;
}

.ics-latest__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ics-latest__title {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: 2rem;
  text-transform: uppercase;
  color: #f2e9dc;
  letter-spacing: 1px;
  text-align: center;
  margin: 3rem 0 3rem 0;
  padding: 0;
}

.ics-latest__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  perspective: 1000px;
  perspective-origin: center;
}

@media (min-width: 768px) {
  .ics-latest__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .ics-latest__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Center review cards on mobile */
@media (max-width: 768px) {
  .ics-latest__grid {
    justify-items: center;
  }

  .ics-card {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .ics-card {
    max-width: 95%;
  }
}

/* ---------- Review Cards ---------- */
.ics-card {
  background-color: #3b2f25;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  max-width: 350px;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.ics-card,
.ics-card * {
  backface-visibility: hidden;
}

.ics-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.ics-card__img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.ics-card__body {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 1.5rem 1.25rem 1.5rem;
}

.ics-card__title {
  margin: 0.75rem 0 0.65rem;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  color: #f2e9dc;
}

.ics-card__excerpt {
  font-family: "Roboto", sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #d3c4b5;
  margin: 0 0 1.25rem;
  display: -webkit-box;
  display: box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ics-card__cta {
  margin-top: auto;
}

/* ---------- Buttons ---------- */
.ics-btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.25s ease, box-shadow 0.15s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ics-btn--subtle {
  background-color: #26201B;
  color: #d3c4b5;
}

.ics-card:hover .ics-btn--subtle {
  background-color: #342a23;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.ics-btn--block {
  display: block;
  width: 100%;
}

.ics-btn--wide {
  display: inline-block;
  width: 100%;
  max-width: 500px;
  /* full size on large screens */
  padding: 1.1rem 3rem;
  border-radius: 10px;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0.5px;
  color: #f2e9dc;
  background-color: #6e4f3a;
  text-align: center;
  transition: background-color 0.25s ease, box-shadow 0.15s ease, transform 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ics-btn--wide:hover {
  background-color: #8d684e;
  color: #f2e9dc;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

/* Keep it smaller and contained on mobile */
@media (max-width: 768px) {
  .ics-btn--wide {
    max-width: 320px;
    padding: 1rem 2rem;
  }
}

@media (max-width: 480px) {
  .ics-btn--wide {
    max-width: 280px;
    padding: 0.9rem 1.5rem;
  }
}

/* CTA alignment */
.ics-latest__cta {
  text-align: center;
  margin-top: 6rem;
  margin-bottom: 2.5rem;
}

/* Tablet adjustment (768px and below) */
@media (max-width: 1024px) {
  .ics-latest__cta {
    margin-top: 4rem;
    margin-bottom: 2rem;
  }
}

/* Mobile adjustment (600px and below) */
@media (max-width: 600px) {
  .ics-latest__cta {
    margin-top: 3rem;
    margin-bottom: 1.75rem;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .ics-card__img {
    height: 260px;
  }

  .ics-card__body {
    padding: 1rem 1rem 1.1rem;
  }
}

/* ========== NEWSLETTER (Homepage) ========== */
.ics-newsletter {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #efe7dc 0%, #f7f1e8 60%, #fffaf2 100%);
  /* dark theme friendly border */
  box-shadow: inset 0 12px 30px rgba(0, 0, 0, 0.06);
  padding: 2.25rem 1rem 2.75rem;
}

[data-theme="dark"] .ics-newsletter {
  background: linear-gradient(135deg, #2a211a 0%, #33271f 60%, #3b2f25 100%);
  box-shadow: inset 0 12px 30px rgba(0, 0, 0, 0.25);
}

.ics-newsletter__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  padding: 0 1rem;
}

.ics-newsletter__kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #7b5d48;
  margin-bottom: .35rem;
}

[data-theme="dark"] .ics-newsletter__kicker {
  color: #e6d3c3;
}

.ics-newsletter__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  color: #1f1a16;
  margin: 0 0 .4rem 0;
}

[data-theme="dark"] .ics-newsletter__title {
  color: var(--brand-cream);
}

.ics-newsletter__sub {
  font-family: var(--font-sans);
  color: #4b443e;
  margin: 0 0 1rem 0;
}

[data-theme="dark"] .ics-newsletter__sub {
  color: var(--brand-muted);
}

/* Form */
.ics-newsletter__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .6rem;
  align-items: center;
  justify-content: center;
  margin: .5rem auto 0;
}

@media (max-width: 560px) {
  .ics-newsletter__form {
    grid-template-columns: 1fr;
  }
}

.ics-input {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  font-size: .95rem;
  background: #fff;
  color: #1f1a16;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.ics-input:focus {
  outline: none;
  border-color: #6e4f3a;
  box-shadow: 0 0 0 3px rgba(110, 79, 58, 0.18);
}

[data-theme="dark"] .ics-input {
  background: #2d241d;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--brand-cream);
}

/* Buttons */
.ics-btn--accent {
  padding: .8rem 1.1rem;
  border-radius: 10px;
  background: #6e4f3a;
  color: #fff;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  transition: background-color .25s ease, box-shadow .15s ease, transform .2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ics-btn--accent:hover {
  background: #8d684e;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
  transform: translateY(-2px);
}

/* Progressive block (hidden → reveal) */
.ics-progressive {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease;
}

.ics-progressive__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .6rem;
  margin-top: .6rem;
}

@media (min-width: 640px) {
  .ics-progressive__grid {
    grid-template-columns: 1fr 2fr;
    align-items: center;
    justify-items: center;
    max-width: 75%;
    margin-inline: auto;
  }

  .ics-progressive__cell--wide {
    justify-self: stretch;
  }
}

/* Checkbox label */
.ics-checkbox {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  font-size: .8rem;
  text-align: left;
  color: #4b443e;
}

.ics-checkbox input[type="checkbox"] {
  margin-top: .2rem;
  width: 1rem;
  height: 1rem;
}

[data-theme="dark"] .ics-checkbox {
  color: var(--brand-muted);
}

/* Fine print */
.ics-newsletter__fine {
  font-size: .75rem;
  color: #6b625b;
  margin-top: .75rem;
}

[data-theme="dark"] .ics-newsletter__fine {
  color: var(--brand-muted);
}

/* ========== QUIZ CTA (Homepage) — Centered row with precise nudge ========== */
.ics-quiz {
  background: #2A1910;
  border-top: 2px solid #3b2f25;
  border-bottom: 1px solid #3b2f25;
  padding-block: 3rem;
}

.ics-quiz__inner {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;

  display: flex;
  justify-content: center;
  align-items: center;

  gap: 2.25rem;
  flex-wrap: nowrap;
  text-align: left;

  --quiz-align-nudge: 0.9em;
}

/* Headline — two lines, left-aligned */
.ics-quiz__headline {
  margin: 0;
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #F2E9DC;
}

.ics-btn--quiz {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  background: #7a5b46;
  color: #F2E9DC;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25) inset, 0 6px 16px rgba(0, 0, 0, .25);
  transition: background-color .25s ease, transform .2s ease, box-shadow .2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  margin-top: var(--quiz-align-nudge);
}

/* Hover */
.ics-btn--quiz:hover {
  background: #8d684e;
  transform: translateY(-2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25) inset, 0 10px 22px rgba(0, 0, 0, .35);
}

.ics-btn--quiz:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3) inset, 0 4px 10px rgba(0, 0, 0, .25);
}

/* --- Responsive: stack vertically on mobile/tablet --- */
@media (max-width: 768px) {
  .ics-quiz__inner {
    flex-direction: column;
    text-align: center;
    gap: 1.75rem;
  }

  .ics-quiz__headline {
    text-align: center;
    max-width: 90%;
  }

  .ics-btn--quiz {
    margin-top: 0;
    /* remove nudge when stacked */
    width: 100%;
    max-width: 340px;
  }
}

/* ========== 404 Page (minimal) ========== */
.ics-404 {
  background: var(--brand-brown-900);
  color: var(--brand-cream);
  text-align: center;
  padding-block: 6rem;
  border-top: 1px solid rgba(0, 0, 0, .25);
}

.page--404 .container {
  padding-inline: 2rem;
}

.ics-404__code {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 6rem;
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .06);
  margin: 0 0 1rem 0;
}

.ics-404__sub {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  margin: 0 0 .75rem 0;
}

.ics-404__desc {
  font-family: var(--font-sans);
  max-width: 640px;
  margin: 0 auto 1.25rem;
  color: #a8927c;
}

.ics-404__cta .ics-btn--accent {
  text-transform: uppercase;
}

/* Small-screen tweak */
@media (max-width: 600px) {
  .ics-404__code {
    font-size: 4rem;
  }

  .page--404 .container {
    padding-inline: 1.25rem;
  }
}

/* 404 page — force dark palette via scoped CSS variables */
body.page--404 {
  --bg-page: #120C08;
  --text-primary: #F2E9DC;
  --text-muted: #C9B8A6;
  --link: #EADBC7;
  --link-hover: #FFF5E6;
  background: var(--bg-page);
  color: var(--text-primary);
}

/* Make the section transparent so it inherits the page bg */
body.page--404 .ics-404 {
  background: transparent;
}

/* Ensure header/nav/footer inherit the light-on-dark colors here */
body.page--404 header a,
body.page--404 footer,
body.page--404 nav a {
  color: var(--text-primary);
}

body.page--404 nav a:hover {
  color: var(--link-hover);
}

/* 404 button override */
body.page--404 .ics-404__cta .ics-btn--accent {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Vertically center all 404 content */
.ics-404 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

/* Ensure the container doesn't restrict centering */
body.page--404 .ics-404 .container {
  width: 100%;
  max-width: 720px;
  padding-inline: 2rem;
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: rgba(110, 79, 58, 0.6);
  /* semi-transparent base */
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 1.5rem;
  font-family: 'Anton', sans-serif;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.scroll-top-btn.show {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background-color: rgba(141, 104, 78, 0.7);
  transform: scale(1.1);
}

.scroll-top-btn:focus {
  outline: none;
}