/* AlphaPacks corporate site — mobile-first.
   Base styles target a ~360px phone; wider layouts are added with min-width queries. */

:root {
  --ink: #14191e;
  --ink-2: #1f272e;
  --paper: #ffffff;
  --mist: #eef1f3;
  --line: #d3d9de;
  --steel: #4a5966;
  --accent: #0e6e85;
  --accent-dark: #0a5567;
  --accent-light: #7fd0e3;

  --font: "Archivo", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 1.25rem;
  --max: 1180px;
  --radius: 6px;
  --header-h: 64px;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --step-3: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  --step-4: clamp(1.875rem, 1.3rem + 2.6vw, 3rem);
  --step-5: clamp(2.125rem, 1.4rem + 3.4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--accent-light); }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 0.75rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.header-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand-mark { display: inline-flex; align-items: center; min-height: 44px; }
.brand-mark img { height: 34px; width: auto; }

.nav-toggle {
  min-height: 44px; min-width: 44px; padding: 0 0.875rem;
  display: inline-flex; align-items: center; gap: 0.625rem;
  font: inherit; font-weight: 700; font-size: var(--step--1);
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav { background: var(--paper); border-top: 1px solid var(--line); }
.site-nav ul { display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.site-nav a {
  display: flex; align-items: center; min-height: 54px;
  padding: 0 var(--gutter);
  font-weight: 600; font-size: var(--step-1);
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-nav a[aria-current="page"] { color: var(--accent-dark); box-shadow: inset 4px 0 0 var(--accent); }
.site-nav a:hover { background: var(--mist); }

/* Without JS the nav is simply visible below the bar. With JS it collapses. */
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }
.js .site-header { position: sticky; }
.js .site-nav.is-open {
  position: absolute; left: 0; right: 0; top: 100%;
  box-shadow: 0 18px 30px rgb(20 25 30 / 0.12);
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.75rem 1.25rem;
  font: inherit; font-weight: 700; font-size: var(--step-0); line-height: 1.2;
  text-decoration: none; text-align: center;
  border: 2px solid var(--accent); border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.on-dark .btn-outline { color: #fff; border-color: #fff; }
.on-dark .btn-outline:hover { background: #fff; color: var(--ink); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn .arrow, .text-link .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow, .text-link:hover .arrow { transform: translateX(3px); }

.text-link { font-weight: 700; color: var(--accent-dark); text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 1px; }
.text-link:hover { color: var(--ink); }
.on-dark .text-link { color: var(--accent-light); }
.on-dark .text-link:hover { color: #fff; }

.btn-row { display: flex; flex-direction: column; gap: 0.75rem; }

/* ---------- Typography helpers ---------- */

.label {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--steel);
}
.on-dark .label { color: var(--accent-light); }
.lede { font-size: var(--step-1); line-height: 1.6; color: var(--steel); max-width: 62ch; }
.on-dark .lede { color: #c9d3da; }
.prose p + p { margin-top: 1rem; }
.prose { max-width: 66ch; }

/* ---------- Sections ---------- */

.section { padding-block: 3.5rem; }
.section-tight { padding-block: 2.5rem; }
.section-mist { background: var(--mist); }
.section-dark { background: var(--ink); color: #fff; }
.section-head { display: grid; gap: 0.75rem; margin-bottom: 2rem; max-width: 46rem; }
.section-head h2 { font-size: var(--step-4); }

/* ---------- Hero ---------- */

.hero { padding-block: 2rem 0; }
.hero-copy { display: grid; gap: 1.25rem; }
.hero h1 { font-size: var(--step-4); text-wrap: balance; }
.hero .lede { font-size: var(--step-1); }
.hero-media { margin: 2rem calc(-1 * var(--gutter)) 0; }
.hero-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 60% 50%; }

.fact-strip { margin-top: 0; border-top: 1px solid var(--line); }
.fact-strip ul { display: grid; }
.fact-strip li { padding: 1.25rem 0; border-bottom: 1px solid var(--line); display: grid; gap: 0.25rem; }
.fact-strip li:last-child { border-bottom: 0; }
.fact-strip strong { font-weight: 800; font-size: var(--step-1); letter-spacing: -0.01em; }
.fact-strip span { color: var(--steel); font-size: var(--step--1); }

/* ---------- Brand cards ---------- */

.brand-grid { display: grid; gap: 1.5rem; }
.brand-card {
  display: grid; grid-template-rows: auto 1fr;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.brand-media { position: relative; aspect-ratio: 16 / 10; background: var(--ink); overflow: hidden; }
.brand-media img.cover { width: 100%; height: 100%; object-fit: cover; }
.brand-media .brand-logo-tile {
  position: absolute; left: 1rem; top: 1rem; width: 58px; border-radius: 4px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}
.brand-media--logo { background: linear-gradient(#2c2d2f, #1b1d1e); }
.brand-media--logo img { width: 100%; height: 100%; object-fit: contain; }

.brand-body { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem 1.25rem 1.5rem; }
.brand-body h3 { font-size: var(--step-3); }
.brand-strap { font-size: var(--step-1); font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.brand-facts { margin-bottom: 0.5rem; display: grid; gap: 0.875rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.brand-facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.brand-facts dd { font-weight: 600; margin-top: 0.125rem; }
.brand-assoc { display: flex; gap: 1rem; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem; }
.brand-assoc img { width: 84px; height: auto; flex: none; border-radius: 4px; }
.brand-assoc p { font-size: var(--step--1); color: var(--steel); }
.brand-assoc strong { color: var(--ink); }
.brand-body .btn-slot { display: grid; margin-top: auto; padding-top: 0.5rem; }

/* ---------- Split rows (home: how it works, about, etc.) ---------- */

.split { display: grid; gap: 2rem; }
.split h2 { font-size: var(--step-4); text-wrap: balance; }
.rows > li { padding: 1.25rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.375rem; }
.rows > li:last-child { border-bottom: 1px solid var(--line); }
.rows h3 { font-size: var(--step-2); }
.rows p { color: var(--steel); max-width: 60ch; }
.on-dark .rows > li { border-color: rgb(255 255 255 / 0.18); }
.on-dark .rows p { color: #c9d3da; }

/* ---------- Page header (inner pages) ---------- */

.page-head { padding-block: 2.5rem 2rem; border-bottom: 1px solid var(--line); background: var(--mist); }
.page-head .container { display: grid; gap: 1rem; }
.page-head h1 { font-size: var(--step-5); max-width: 22ch; text-wrap: balance; }
.breadcrumb { font-size: var(--step--1); color: var(--steel); }
.breadcrumb a { color: var(--steel); }

/* ---------- Relationship table ---------- */

.rel-table { width: 100%; border-collapse: collapse; }
.rel-table caption { text-align: left; font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; padding-bottom: 1rem; }
.rel-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rel-table tr { display: block; border-top: 1px solid var(--line); padding: 1rem 0; }
.rel-table tr:last-child { border-bottom: 1px solid var(--line); }
.rel-table th[scope="row"] {
  display: block; text-align: left; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--steel); font-weight: 700; margin-bottom: 0.5rem;
}
.rel-table td { display: block; padding: 0.25rem 0; }
.rel-table td::before {
  content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 700; color: var(--accent-dark);
}

/* ---------- Connection links (about) ---------- */

.connect-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.connect-item { display: grid; gap: 0.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.connect-item h3 { font-size: var(--step-2); }
.connect-item p { color: var(--steel); max-width: 60ch; }
.connect-item .text-link { justify-self: start; margin-top: 0.5rem; }

/* ---------- Routing (contact / partnerships) ---------- */

.route-list { display: grid; gap: 1rem; }
.route {
  display: grid; gap: 0.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
.route h3 { font-size: var(--step-2); }
.route p { color: var(--steel); }
.route .text-link { justify-self: start; margin-top: 0.25rem; }
.route--primary { border-color: var(--ink); border-width: 2px; }

.check-list { display: grid; gap: 0.75rem; }
.check-list li { position: relative; padding-left: 1.75rem; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 0.9rem; height: 0.5rem;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg) translateY(-30%);
}

.notice {
  border-left: 4px solid var(--accent); background: var(--mist); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.notice strong { display: block; margin-bottom: 0.25rem; }

/* ---------- Form ---------- */

.contact-layout { display: grid; gap: 3rem; }
.form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.375rem; }
.field label { font-weight: 700; font-size: var(--step--1); }
.field .hint { font-size: 0.8125rem; color: var(--steel); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0.75rem 0.875rem;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid #8795a1; border-radius: var(--radius);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.form-status { min-height: 1.5rem; font-weight: 600; }
.redirect-box[hidden], #form-fields[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- FAQ ---------- */

.faq { display: grid; }
.faq-item { padding: 1.25rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.5rem; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
.faq-item p { color: var(--steel); max-width: 62ch; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: #c9d3da; padding-block: 3rem calc(2rem + env(safe-area-inset-bottom)); font-size: var(--step--1); }
.footer-grid { display: grid; gap: 2rem; }
.footer-logo { height: 38px; width: auto; filter: brightness(0) invert(1); }
.site-footer .footer-h { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; margin: 0 0 0.75rem; font-weight: 700; }
.site-footer a { color: #fff; text-decoration-color: rgb(255 255 255 / 0.4); }
.site-footer a:hover { color: var(--accent-light); }
.footer-links { display: grid; gap: 0.25rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.18); display: grid; gap: 0.75rem; max-width: 70ch; }

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  :root { --gutter: 2rem; }
  .btn-row { flex-direction: row; flex-wrap: wrap; }
  .fact-strip ul { grid-template-columns: repeat(3, 1fr); }
  .fact-strip li { border-bottom: 0; padding: 1.5rem 1.5rem 1.5rem 0; }
  .fact-strip li + li { border-left: 1px solid var(--line); padding-left: 1.5rem; }
  .brand-body { padding: 1.75rem; }
}

@media (min-width: 900px) {
  :root { --header-h: 76px; --gutter: 2.5rem; }
  .section { padding-block: 5.5rem; }
  .brand-mark img { height: 40px; }

  .nav-toggle { display: none; }
  .js .site-nav, .site-nav { display: block !important; position: static; border: 0; box-shadow: none; max-height: none; background: transparent; }
  .site-nav ul { flex-direction: row; gap: 0.25rem; padding: 0; }
  .site-nav a {
    min-height: 44px; padding: 0 0.875rem; font-size: var(--step-0); border: 0; border-radius: var(--radius); position: relative;
  }
  .site-nav a[aria-current="page"] { box-shadow: none; }
  .site-nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 0.875rem; right: 0.875rem; bottom: 4px; height: 3px; background: var(--accent);
  }
  .site-header .container { display: flex; align-items: center; justify-content: space-between; }

  .hero { padding-block: 4rem 0; }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
  .hero-media { margin: 0; }
  .hero-media img { aspect-ratio: 4 / 5; border-radius: 8px; object-position: 62% 50%; }
  .fact-strip { margin-top: 4rem; }

  .brand-grid { grid-template-columns: 1fr 1fr; gap: 2rem; align-items: stretch; }
  .brand-body { padding: 2rem; }

  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; align-items: start; }
  .split-sticky > :first-child { position: sticky; top: calc(var(--header-h) + 2rem); }

  .page-head { padding-block: 4rem 3rem; }

  .rel-table thead { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .rel-table thead th { text-align: left; font-size: var(--step-1); font-weight: 800; padding: 0 1rem 1rem; border-bottom: 2px solid var(--ink); }
  .rel-table thead th:first-child { padding-left: 0; }
  .rel-table tr { display: table-row; border: 0; padding: 0; }
  .rel-table th[scope="row"], .rel-table td { display: table-cell; padding: 1.25rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
  .rel-table th[scope="row"] { padding-left: 0; width: 18%; margin: 0; }
  .rel-table td::before { display: none; }
  .rel-table td { width: 41%; }

  .connect-list { grid-template-columns: 1fr 1fr; border-top: 0; gap: 2rem; }
  .connect-item { border: 1px solid var(--line); border-radius: 8px; padding: 2rem; align-content: start; }

  .route-list { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; align-items: start; }

  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
}

@media (min-width: 1200px) {
  .hero-grid { gap: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
