/* Fonts */
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,400italic,600italic|Roboto+Slab:400,700");

@layer reset, base, components, utilities;

/* ===== reset ===== */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    margin: 0;
  }
  img,
  picture,
  svg,
  video {
    max-width: 100%;
    height: auto;
    display: block;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}

/* ===== base (tokens + primitives) ===== */
@layer base {
  :root {
    --container: 110em;
    --gutter: 2rem;
    --radius: 10px;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-6: 3rem;
    --space-8: 4rem;

    --bg: #ffffff;
    --surface: #f5f6f7;
    --ink: #3d4449;
    --muted: #7f888f;
    --brand: #f56a6a;
    --brand-ink: #ffffff;

    --header-height: 64px;

    --line: #e7e7ee;
  }

  body {
    background: var(--bg);
    color: var(--ink);
    font:
      400 clamp(9pt, 2vw, 13pt) / 1.65 "Open Sans",
      sans-serif;
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--ink);
    font-family: "Roboto Slab", serif;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1em 0;
  }
  h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
  }
  h2 {
    font-size: clamp(1.9rem, 3vw, 2.2rem);
  }
  h3 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
  }

  p {
    margin: 0 0 2em 0;
  }
  strong,
  b {
    color: var(--ink);
    font-weight: 600;
  }

  .container {
    width: min(var(--container), calc(100% - 2 * var(--gutter)));
    margin-inline: auto;
  }
  .section {
    padding-block: clamp(2.25rem, 4.2vw, 3.75rem);
  }

  /* Anchor offset for sticky header */
  [id] {
    scroll-margin-top: var(--header-height);
  }

  a {
    transition: color 0.2s ease-in-out;
  }
  a:hover {
    color: var(--brand);
  }
}

/* ===== components (shared sitewide bits) ===== */
@layer components {
  /* Header */
  #header {
    height: var(--header-height);
    width: 100%;
    background-color: var(--surface);
    border-bottom: 3px solid var(--brand);
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  #header.is-scrolled {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
  }
  .header-column {
    flex: 1 1 250px;
  }
  .header-center {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
  }
  .header-right {
    display: flex;
    justify-content: flex-end;
    gap: 1em;
  }

  .header-logo {
    font-family: "Roboto Slab", serif;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .header-nav {
    display: flex;
    gap: 2em;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .header-nav a {
    font-weight: 600;
    color: #333;
  }
  .header-nav a:hover,
  .header-nav a.active {
    color: var(--brand);
  }
  .header-nav a.active {
    border-bottom: 2px solid var(--brand);
    padding-bottom: 0.1em;
  }

  .header-cta {
    display: inline-block;
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--brand);
    color: var(--brand);
    padding: 0.75em 1.5em;
    border-radius: 0.375em;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .header-cta:hover {
    background-color: rgba(245, 106, 106, 0.05);
  }

  /* Burger & mobile panel */
  #burger-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #333;
    cursor: pointer;
  }

  @media (max-width: 820px) {
    .header-nav {
      display: none;
    }
    #burger-toggle {
      display: block;
    }
    .header-logo {
      font-size: 1.1em;
    }

    #header {
      height: var(--header-height);
    }
    .header-inner {
      padding: 1em 1.5em;
    }

    .header-cta {
      padding: 0.7em 1em;
      font-size: 0.75em;
    }
  }

  #mobile-panel {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: #eaeaea;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
  #mobile-panel.active {
    display: block;
    animation: slideDown 0.3s ease-out forwards;
  }
  #mobile-panel ul {
    list-style: none;
    margin: 0;
    padding: 2em 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5em;
  }
  #mobile-panel a {
    color: #666;
    font-weight: 700;
    font-size: 1.1em;
  }
  #mobile-panel a:hover {
    color: var(--brand);
  }
  #mobile-panel a.nav-link.active {
    color: var(--brand);
    text-decoration: underline;
    text-decoration-color: var(--brand);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.15em;
  }
  #close-panel {
    position: absolute;
    top: 1em;
    right: 1em;
    background: none;
    border: none;
    font-size: 2em;
    color: #666;
    cursor: pointer;
    z-index: 1001;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Banner */
  #banner {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  #banner .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
  }
  #banner .content {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    padding: 2em;
    max-width: 124ch;
    margin: 0 auto;
  }
  #banner h1 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1em;
    color: #fff;
  }
  #banner p {
    font-size: 1.2em;
    line-height: 1.6;
    color: #fff;
    margin-bottom: 2em;
  }
  #banner .content .btn--light {
    background: transparent;
    color: #fff;
    font-weight: 600;
    padding: 0.8em 1.6em;
    border-radius: 0.375em;
    box-shadow: inset 0 0 0 2px #fff;
  }
  #banner .content .btn--light:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  @media (max-width: 1024px) {
    #banner {
      min-height: 640px;
    }
    #banner .content {
      max-width: 72ch;
      padding: 1.5em 1.25em;
    }
    #banner h1 {
      font-size: clamp(2.1rem, 1.2rem + 2.5vw, 2.6rem);
      line-height: 1.22;
      text-wrap: balance;
    }
    #banner p {
      font-size: 1.1em;
      line-height: 1.6;
    }
  }

  @media (max-width: 820px) {
    #banner {
      min-height: 560px;
      padding: 1em;
    }
    #banner .content {
      padding: 1.5em 1em;
      max-width: 64ch;
      font-size: 1.0625rem;
      line-height: 1.7;
    }
    #banner h1 {
      font-size: clamp(2rem, 1.2rem + 3.6vw, 2.6rem);
      line-height: 1.25;
      text-wrap: balance;
    }
    #banner p {
      font-size: 1em;
    }
    #banner .content > :last-child {
      margin-bottom: 0;
    }
  }

  @media (max-width: 600px) {
    #banner {
      min-height: 640px;
      padding: 1.75em 1em;
    }
    #banner .content {
      max-width: 60ch;
    }
    #banner h1 {
      font-size: clamp(1.9rem, 1rem + 3.4vw, 2.3rem);
      line-height: 1.28;
    }
    #banner p {
      font-size: 1rem;
      line-height: 1.6;
    }
    #banner .content > :last-child {
      margin-bottom: 0;
    }
  }

  @media (max-width: 420px) {
    #banner {
      min-height: min(680px, 92vh);
      padding-top: 2em;
    }
    #banner .content {
      max-width: 58ch;
    }
    #banner h1 {
      font-size: clamp(1.85rem, 1rem + 3.2vw, 2.15rem);
    }
  }

  /* Ruled section titles */
  .h-ruled {
    display: inline-block;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--brand);
  }

  /* Footer */
  #footer {
    width: 100%;
    background: var(--surface);
    color: #333;
    font-size: 0.9em;
    border-top: 3px solid var(--brand);
  }
  .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 1em 6em;
    max-width: 1200px;
    margin: 0 auto;
  }
  .footer-bottom {
    margin: 0 auto;
    padding: 0.75em 6em;
    background: #eaeaea;
    text-align: center;
    color: #333;
    font-size: 0.85em;
  }
  .footer-bottom p {
    margin: 0;
    line-height: 1.2;
  }
  .footer-column {
    flex: 1 1 250px;
  }
  .footer-left,
  .footer-right {
    flex: 1 1 300px;
  }
  .footer-center {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
  }
  .footer-logo {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
  }
  .footer-nav {
    display: flex;
    gap: 2em;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
  }
  .footer-nav a {
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5em;
    transition: color 0.3s;
  }
  .footer-nav a:hover {
    color: var(--brand);
  }
  .contact-links {
    display: flex;
    align-items: center;
    gap: 1.5em;
    justify-content: flex-end;
  }
  #footer .contact-links a {
    color: var(--brand);
  }
  #footer .contact-links a:hover {
    text-decoration: underline;
  }
  #footer .design-credit {
    color: #9fa3a6;
    font-size: 0.8em;
    margin-top: 0.5em;
  }
  #footer .design-credit a {
    color: inherit;
  }
  #footer .design-credit a:hover {
    color: var(--brand);
    text-decoration: underline;
  }

  @media (max-width: 1014px) and (min-width: 821px) {
    #footer .footer-top {
      padding: 0.85em 3em;
      flex-wrap: nowrap;
    }
    #footer .footer-left,
    #footer .footer-right {
      flex: 0 1 220px;
    }
    #footer .footer-center {
      flex: 1 1 auto;
      min-width: 0;
      display: flex;
      justify-content: center;
    }
    #footer .footer-nav {
      flex-wrap: wrap;
      gap: 1.5em;
    }
  }

  @media (max-width: 820px) {
    .footer-top {
      flex-direction: column;
      padding: 1em 2em 2em;
    }
    .footer-column,
    .footer-left,
    .footer-center,
    .footer-right {
      flex: 1 1 100%;
      width: 100%;
      text-align: center;
      margin-top: 1.5em;
    }
    .footer-column:first-child {
      margin-top: 0;
    }
    .footer-nav {
      justify-content: center;
      flex-wrap: wrap;
    }
    .contact-links {
      justify-content: center;
      flex-wrap: wrap;
    }
    .footer-bottom {
      font-size: 0.75em;
      padding: 1em 2em;
    }
  }
}

/* ===== utilities ===== */
@layer utilities {
  .muted {
    color: var(--muted);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.9rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    text-decoration: none;
    transition:
      filter 0.2s ease,
      background-color 0.2s ease,
      box-shadow 0.2s ease;
  }
  .btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }

  .btn--brand {
    background: var(--brand);
    color: var(--brand-ink);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  }
  .btn--brand:hover {
    filter: brightness(0.96);
  }

  .btn--ghost {
    background: transparent;
    color: var(--brand);
    box-shadow: inset 0 0 0 2px var(--brand);
  }
  .btn--ghost:hover {
    background: rgba(245, 106, 106, 0.05);
  }

  .btn--ghost-on-dark {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--brand); /* brand border */
  }
  .btn--ghost-on-dark:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}
