/* ---------------------------------------------------------------------------
   Grayheadz — page shell
   Implements templates/page-shell/PageShell.dc.html against the design system.
   Every value is a token from styles.css; no raw hex below.
   --------------------------------------------------------------------------- */

/* --- Layout primitives ---------------------------------------------------- */

.gh-container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding-inline: var(--space-9);
}

.gh-skip {
  position: absolute;
  left: var(--space-9);
  top: 0;
  transform: translateY(-120%);
  z-index: 60;
  padding: var(--space-4) var(--space-6);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: var(--type-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-primary);
  transition: transform var(--dur-fast) var(--ease-out);
}

.gh-skip:focus-visible {
  transform: translateY(var(--space-5));
}

/* --- Button --------------------------------------------------------------
   Mirrors components/core/Button.jsx: uppercase label, wide tracking,
   4px radius, 8% hover brighten, uniform .985 press.
   ------------------------------------------------------------------------- */

.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  /* base.css underlines every <a>; buttons opt out. */
  border-bottom-style: solid;
  text-decoration: none;
  transition: var(--transition-control), transform var(--dur-instant) var(--ease-standard);
}

.gh-btn:hover { filter: brightness(1.08); }
.gh-btn:active { transform: scale(var(--press-scale)); }

.gh-btn[aria-disabled="true"],
.gh-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* sizes */
.gh-btn--sm { height: var(--control-h-sm); padding: 0 14px; font-size: var(--text-2xs); }
.gh-btn--md { height: var(--control-h);    padding: 0 20px; font-size: var(--text-xs);  }
.gh-btn--lg { height: var(--control-h-lg); padding: 0 28px; font-size: var(--text-sm);  }

/* variants */
.gh-btn--primary {
  background: var(--metal-silver);
  color: var(--action-text);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: var(--shadow-sm);
}

.gh-btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--action-ghost-border);
}

.gh-btn--quiet {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.gh-btn--quiet:hover {
  color: var(--text-primary);
  border-color: var(--line);
}

/* --- Card ----------------------------------------------------------------
   Mirrors components/core/Card.jsx: 10px radius, hairline border, top sheen
   doing the lifting with the shadow almost invisible underneath.
   ------------------------------------------------------------------------- */

.gh-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--inset-top-sheen), var(--shadow-md);
  transition: var(--transition-control), transform var(--dur-base) var(--ease-out);
}

/* One metal fill per view — see readme.md → Visual foundations. */
.gh-card--metal {
  background: var(--metal-graphite);
  border-color: var(--line);
  box-shadow: var(--inset-top-sheen), var(--shadow-lg);
}

.gh-card__body { padding: var(--space-8); }

.gh-card__title {
  font: var(--type-h3);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.gh-card__text {
  font: var(--type-body-sm);
  color: var(--text-muted);
}

/* --- Header --------------------------------------------------------------
   The nav bar is one of only two sticky elements in the system, and one of
   only three permitted uses of blur.
   ------------------------------------------------------------------------- */

.gh-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(10, 10, 11, .84);
  -webkit-backdrop-filter: var(--blur-veil);
  backdrop-filter: var(--blur-veil);
  border-bottom: 1px solid var(--line-subtle);
}

.gh-header__bar {
  height: 76px;
  display: flex;
  align-items: center;
  gap: var(--space-10);
}

.gh-logo { display: block; width: auto; }
.gh-logo--header { height: 26px; }
.gh-logo--footer { height: 30px; }

.gh-nav {
  display: flex;
  gap: var(--space-9);
  margin-left: var(--space-6);
}

.gh-nav__link {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: var(--transition-control);
}

.gh-nav__link:hover { color: var(--text-primary); border-bottom-color: transparent; }
.gh-nav__link[aria-current="page"] { color: var(--text-primary); }

.gh-header__actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-5);
  align-items: center;
}

/* Disclosure menu — an addition; the template defines no mobile behaviour. */
.gh-menu-toggle { display: none; }

.gh-header__drawer { display: none; }

/* --- Hero ----------------------------------------------------------------- */

.gh-hero {
  padding-block: var(--space-14) var(--space-13);
  position: relative;
  overflow: hidden;
}

/* The one atmospheric device in the system: a single soft radial wash. */
.gh-hero__wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 420px at 22% -10%, rgba(195, 201, 209, .12), transparent 70%);
  pointer-events: none;
}

.gh-hero__inner {
  position: relative;
  display: grid;
  gap: var(--space-8);
  max-width: 760px;
}

.gh-hero__title {
  font-family: var(--font-display);
  font-weight: var(--weight-light);
  /* DS hero range is 58–76px; the floor relaxes below 480px so the display
     serif still fits a phone. */
  font-size: clamp(2.75rem, 7.4vw, var(--text-5xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.gh-hero__lede {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
  max-width: 520px;
  text-wrap: pretty;
}

.gh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-4);
}

/* --- Content section ------------------------------------------------------ */

.gh-section {
  padding-block: var(--space-13);
  border-top: 1px solid var(--line-subtle);
}

.gh-section__head {
  max-width: 720px;
  display: grid;
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.gh-section__title {
  font-family: var(--font-display);
  font-weight: var(--weight-light);
  font-size: clamp(2rem, 4.5vw, var(--text-3xl));
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.gh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

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

.gh-footer {
  border-top: 1px solid var(--line-subtle);
  background: var(--ink-950);
  padding-block: var(--space-12) var(--space-10);
}

.gh-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-10);
}

.gh-footer__note {
  font-size: var(--text-2xs);
  color: var(--silver-700);
}

/* --- Responsive ----------------------------------------------------------
   The template is authored desktop-only; these are additions.
   ------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .gh-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .gh-container { padding-inline: var(--space-7); }

  /* The bar keeps only the wordmark and the disclosure; both CTAs move into
     the drawer, which is what stops the nowrap labels overflowing at 375px. */
  .gh-header__bar { gap: var(--space-6); }

  .gh-header__bar .gh-nav,
  .gh-header__actions .gh-btn--quiet,
  .gh-header__actions .gh-btn--primary { display: none; }

  .gh-menu-toggle { display: inline-flex; }

  .gh-header__drawer {
    display: grid;
    gap: var(--space-7);
    padding-block: var(--space-7) var(--space-8);
    border-top: 1px solid var(--line-subtle);
  }

  .gh-header__drawer[hidden] { display: none; }

  .gh-header__drawer .gh-nav {
    display: grid;
    gap: var(--space-7);
    margin-left: 0;
  }

  .gh-drawer__actions {
    display: grid;
    gap: var(--space-5);
    justify-items: start;
  }

  .gh-drawer__actions .gh-btn--primary { width: 100%; }

  .gh-hero { padding-block: var(--space-12) var(--space-11); }
  .gh-section { padding-block: var(--space-11); }
  .gh-footer { padding-block: var(--space-11) var(--space-9); }
}

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

  .gh-actions .gh-btn { width: 100%; }

  .gh-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
  }
}

/* Drop transforms, keep opacity — readme.md → Motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .gh-btn:active { transform: none; }
  .gh-skip { transition: none; }
}
