/* =============================================================================
  Northern Watch — global styles
  These tokens intentionally mirror DESIGN.md (Apple-inspired marketing site).

  How to read this file during a video call:
  1) ":root" holds variables (colors, spacing, type scale).
  2) "Base" sets defaults on body + links.
  3) "Layout" defines containers, grids, and section rhythm.
  4) "Components" styles buttons, cards, modal, and form fields.
  5) "Responsive" tightens type + stacks grids on small screens.
============================================================================= */

/* -----------------------------------------------------------------------------
  Design tokens (CSS variables)
  Why variables? One place to tweak the “brand math” when your teacher asks.
----------------------------------------------------------------------------- */
:root {
  /* Core neutrals (binary light/dark rhythm). */
  --color-black: #000000;
  --color-light-gray: #f5f5f7;
  --color-near-black: #1d1d1f;

  /* Accent: Tech Purple — reserved for interactive elements. */
  --color-accent: #7c3aed; /* purple-600 vibe */
  --color-accent-hover: #8b5cf6;
  --color-link: #6d28d9; /* slightly darker for text links */
  --color-link-on-dark: #a78bfa; /* brighter for dark backgrounds */

  /* Text opacity system (secondary + tertiary). */
  --color-muted: rgba(0, 0, 0, 0.48);
  --color-muted-on-dark: rgba(255, 255, 255, 0.72);

  /* Surfaces */
  --color-dark-surface: #141414;
  --color-modal-panel: #161617;
  --color-modal-border: rgba(255, 255, 255, 0.12);

  /* Shadows */
  --shadow-card: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;

  /* Typography stack (SF Pro names are hints; system fonts do the real work). */
  --font-display: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Helvetica, Arial, sans-serif;

  /* Spacing scale (kept simple on purpose). */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;

  /* Radii */
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-pill: 980px;

  /* Layout */
  --container: 1120px;
}

/* -----------------------------------------------------------------------------
  Reset-ish baseline (small, readable, not a full CSS framework)
----------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.02em;
  /* A subtle gradient makes the page feel more modern than pure flat black. */
  background: radial-gradient(1200px 800px at 20% -10%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(1000px 700px at 90% 10%, rgba(167, 139, 250, 0.12), transparent 55%),
    var(--color-black);
  color: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input {
  font: inherit;
}

/* -----------------------------------------------------------------------------
  Accessibility helpers
----------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--color-black);
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  left: 8px;
}

.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;
}

/* -----------------------------------------------------------------------------
  Typography primitives
----------------------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 56px);
  line-height: 1.07;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

.lead {
  font-size: 19px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 var(--space-4);
  max-width: 52ch;
}

.body {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.body--on-dark {
  color: rgba(255, 255, 255, 0.86);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
  color: var(--color-near-black);
}

.section-title--on-dark {
  color: #ffffff;
}

.section-subtitle {
  margin: 0 0 var(--space-5);
  max-width: 62ch;
  color: var(--color-muted);
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 var(--space-2);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.micro {
  font-size: 12px;
  line-height: 1.33;
}

.muted {
  color: var(--color-muted);
}

.muted--on-dark {
  color: var(--color-muted-on-dark);
}

/* -----------------------------------------------------------------------------
  Layout: container + sections
----------------------------------------------------------------------------- */
.container {
  width: min(var(--container), calc(100% - 2 * var(--space-4)));
  margin-inline: auto;
}

.section {
  padding: var(--space-7) 0;
}

.section--dark {
  background: radial-gradient(900px 600px at 15% 10%, rgba(124, 58, 237, 0.18), transparent 60%),
    var(--color-black);
  color: #ffffff;
}

.section--light {
  background: var(--color-light-gray);
  color: var(--color-near-black);
}

/* -----------------------------------------------------------------------------
  Header
----------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.logo {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.nav__link {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 14px;
}

.nav__link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* -----------------------------------------------------------------------------
  Hero layout (grid collapses to one column on phones)
----------------------------------------------------------------------------- */
.hero {
  /* Required by your request: hero takes 100% of viewport height. */
  min-height: 100vh;
  padding: 0; /* override `.section` padding so 100vh is literal */
  display: flex;
  align-items: center;
}

.hero__grid {
  /* Keeps content vertically centered while hero stays exactly 100vh. */
  min-height: 100vh;
  padding: var(--space-6) 0;

  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-6);
  align-items: center;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.hero__media {
  margin: 0;
  justify-self: end;
}

.hero__image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: none; /* per your request: no border */
  /* Modern “poster” feel: keep the subject centered and crisp. */
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

/* -----------------------------------------------------------------------------
  Buttons
----------------------------------------------------------------------------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--color-accent);
  color: #ffffff;
}

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

.btn--large {
  padding: 12px 22px;
  font-size: 17px;
}

.btn--ghost {
  background: transparent;
  color: var(--color-link-on-dark);
  border-color: rgba(167, 139, 250, 0.55);
}

.btn--ghost:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn--ghost-on-dark {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn--link-on-dark {
  background: transparent;
  color: var(--color-link-on-dark);
  border-color: transparent;
  padding: 8px 10px;
}

/* -----------------------------------------------------------------------------
  Admin table (simple + readable)
----------------------------------------------------------------------------- */
.admin-table th,
.admin-table td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  white-space: nowrap;
}

.admin-table th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.admin-table td {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

/* -----------------------------------------------------------------------------
  Grids + cards (light section)
----------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-4);
}

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

.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
}

.card__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__body {
  margin: 0;
  color: var(--color-muted);
}

/* -----------------------------------------------------------------------------
  Split section + “glass” panel (decorative)
----------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: var(--space-6);
  align-items: center;
}

.checklist {
  margin: var(--space-4) 0 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.86);
}

.checklist li {
  margin: 10px 0;
}

.glass-panel {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-card);
}

.glass-panel__kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.glass-panel__stat {
  margin: var(--space-2) 0 0;
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.glass-panel__caption {
  margin: var(--space-2) 0 0;
  color: rgba(255, 255, 255, 0.72);
}

/* -----------------------------------------------------------------------------
  Specs list
----------------------------------------------------------------------------- */
.specs {
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
}

.specs__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-3);
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.specs__row:last-child {
  border-bottom: none;
}

.specs dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-near-black);
}

.specs dd {
  margin: 0;
  color: var(--color-muted);
}

.center-cta {
  display: flex;
  justify-content: center;
}

/* -----------------------------------------------------------------------------
  Quote
----------------------------------------------------------------------------- */
.quote {
  text-align: center;
}

.quote__text {
  margin: 0 auto;
  max-width: 900px;
}

.quote__text p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.quote__cite {
  margin: var(--space-3) 0 0;
  color: rgba(255, 255, 255, 0.72);
}

/* -----------------------------------------------------------------------------
  Footer
----------------------------------------------------------------------------- */
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

/* -----------------------------------------------------------------------------
  Modal (dialog)
  Notes:
  - `.modal` is hidden via `[hidden]` + `aria-hidden` toggled in JS.
  - When open, we set `.modal.is-open` for animation + scroll lock on body.
----------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: end center;
  padding: var(--space-4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.modal[hidden] {
  display: none !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--color-modal-panel);
  color: #ffffff;
  border: 1px solid var(--color-modal-border);
  border-radius: calc(var(--radius-lg) + 4px);
  box-shadow: var(--shadow-card);
  transform: translateY(10px);
  transition: transform 180ms ease;
}

.modal.is-open .modal__panel {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-modal-border);
  position: sticky;
  top: 0;
  background: rgba(22, 22, 23, 0.92);
  backdrop-filter: blur(12px);
  z-index: 1;
}

.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.02em;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal__body {
  padding: var(--space-4);
}

/* -----------------------------------------------------------------------------
  Checkout form
----------------------------------------------------------------------------- */
.checkout__section {
  padding: var(--space-3) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.checkout__section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.checkout__heading {
  margin: 0 0 var(--space-3);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
}

.summary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.04);
}

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary__row:last-child {
  border-bottom: none;
}

.summary__row--muted {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.summary__row--total {
  font-weight: 600;
  padding-top: 14px;
}

.field {
  margin: var(--space-3) 0;
}

.field label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.86);
}

.field input {
  width: 100%;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.field input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.field__error {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 13px;
  color: #ff9bb0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.form-status {
  min-height: 22px;
  margin: var(--space-2) 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.checkout__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.success {
  padding: var(--space-2) 0 var(--space-4);
}

.success__card {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-card);
}

.success__top {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: var(--space-3);
}

.success__icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.32);
  color: #ffffff;
  font-weight: 700;
}

.success__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.02em;
}

.success__subtitle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.success__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.success__panel {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.28);
  padding: 12px;
}

.success__label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

.success__value {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.92);
}

.success__link {
  color: var(--color-link-on-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(167, 139, 250, 0.45);
}

.success__link:hover {
  border-bottom-color: rgba(167, 139, 250, 0.9);
}

.success__text {
  margin: 0 0 var(--space-3);
  color: rgba(255, 255, 255, 0.86);
}

.success__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  display: inline-block;
}

@media (max-width: 900px) {
  .success__grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------------
  Responsive rules
----------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav {
    display: none; /* Demo simplicity: mobile gets the hero CTAs first. */
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .hero__media {
    justify-self: center;
    order: -1; /* Show product image before copy on small screens. */
  }

  .grid--3 {
    grid-template-columns: 1fr;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .specs__row {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

/* Respect users who prefer less motion (accessibility). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .modal,
  .modal__panel {
    transition: none;
  }
}
