/* Hanetic Design System — base.css (Phase 1)
   ------------------------------------------------------------------
   Reset, page scaffolding, and the shared Hanetic shell (site header).
   Works with shell.js which toggles `shell-compact` / `shell-peek` on
   the <html> element. Dark-context shells (portal/cars) are re-tinted
   in their theme files; this file owns geometry + safe-area only once. */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--hx-bg);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--hx-ink);
  font-family: var(--hx-font);
  font-size: var(--hx-text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.98), transparent 34%),
    radial-gradient(circle at 14% 18%, rgba(154, 213, 191, 0.16), transparent 32%),
    radial-gradient(circle at 88% 24%, rgba(69, 108, 142, 0.11), transparent 30%),
    linear-gradient(180deg, #fbfdfc 0%, var(--hx-bg) 72%);
}

h1, h2, h3, h4, p, figure, dl, dt, dd {
  margin: 0;
}

img, svg, video {
  max-width: 100%;
}

button, input, select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--hx-accent);
  outline-offset: 2px;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(25, 25, 25, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 25, 25, 0.032) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 72%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 72%);
}

/* ---- Page containers -----------------------------------------------------
   Every page wrapper reserves bottom room for the iOS home indicator. */

.editorial-shell,
.dev-shell,
.section-shell {
  width: min(calc(100% - 28px), 1120px);
  margin: clamp(20px, 4vw, 54px) auto 0;
  padding: 0 0 var(--hx-page-bottom);
}

.portal-photo-shell {
  width: min(calc(100% - 28px), var(--hx-page-max));
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) 0 var(--hx-page-bottom);
}

.car-archive {
  display: grid;
  gap: var(--hx-space-4);
  width: min(calc(100% - 28px), var(--hx-page-wide));
  margin: clamp(18px, 3vw, 34px) auto 0;
  padding: 0 0 var(--hx-page-bottom);
}


@media (max-width: 760px) {
  .editorial-shell,.dev-shell,.section-shell,.portal-photo-shell,.car-archive { width: calc(100% - 20px); margin-top: 14px; }
}
