/* =========================================================
   HasTech — shared design system
   Lightweight, dependency-free. One accent colour, system
   fonts, 4px spacing rhythm, thin borders, soft shadows.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  /* Neutrals */
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d3d7de;
  --text: #101828;
  --text-soft: #475467;
  --text-mute: #667085;

  /* Brand */
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-tint: #eef2ff;
  --brand-ring: rgba(79, 70, 229, 0.35);

  /* Dark surfaces */
  --ink: #0b1020;
  --ink-soft: #1a2138;
  --ink-text: #aeb6c8;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06),
    0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.12);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--brand-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--brand-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  font-weight: 800;
}

h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.6rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

p {
  color: var(--text-soft);
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-soft);
  line-height: 1.6;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 9vw, 112px);
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section__head {
  max-width: 640px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section__head p {
  margin-top: 14px;
  font-size: 1.05rem;
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--text-mute);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 15px 26px;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #7c73f0);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.brand__name span {
  color: var(--brand);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav__links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--text);
  background: var(--bg-alt);
  text-decoration: none;
}

.footer__col a:hover,
.footer__brand a:hover {
  text-decoration: none;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__mobile-cta {
  display: none;
}

.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
}

.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  margin-inline: auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: relative;
}

.nav__toggle span::before {
  top: -5px;
}

.nav__toggle span::after {
  top: 3px;
}

.nav.is-open .nav__toggle span {
  background: transparent;
}

.nav.is-open .nav__toggle span::before {
  transform: translateY(5px) rotate(45deg);
}

.nav.is-open .nav__toggle span::after {
  transform: translateY(-5px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(64px, 10vw, 128px);
  background:
    radial-gradient(60% 55% at 92% 8%, rgba(79, 70, 229, 0.1), transparent 70%),
    radial-gradient(50% 50% at 6% 92%, rgba(124, 115, 240, 0.08), transparent 70%),
    var(--bg);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

.hero h1 {
  margin-top: 22px;
}

.hero .lead {
  margin-top: 22px;
  max-width: 34ch;
}

.hero__note {
  margin-top: 22px;
  font-size: 0.9rem;
  color: var(--text-mute);
}

.hero__visual {
  position: relative;
}

/* Device visual */
.device {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #1b2238, #0b1020);
  padding: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.device__screen {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #05070f;
}

.device__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.device__base {
  width: 34%;
  height: 8px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #141a2c, #0b1020);
  margin: 8px auto 0;
}

.hero__chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.hero__chip small {
  display: block;
  font-weight: 500;
  color: var(--text-mute);
  font-size: 0.75rem;
}

.hero__chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
}

.hero__chip--tl {
  top: 6%;
  left: -6%;
}

.hero__chip--br {
  bottom: 8%;
  right: -5%;
}

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  gap: 22px;
}

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

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card--hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  margin-bottom: 18px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  font-size: 0.96rem;
}

/* ---------- Products ---------- */
.product {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.product__media {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: #0b1020;
  position: relative;
  overflow: hidden;
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__media--flora {
  background: radial-gradient(120% 120% at 20% 10%, #6d5ef0, #3b2fb0 60%, #241c78);
}

.product__media--sleep {
  background: radial-gradient(120% 120% at 80% 10%, #2a3b8f, #17225c 60%, #0c1236);
}

.product__glyph {
  font-size: 2.6rem;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.product__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.product__body h3 {
  margin-top: 2px;
}

.product__body p {
  font-size: 0.95rem;
  flex: 1;
}

.product__link {
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-strong);
}

.product__link::after {
  content: " →";
}

/* ---------- Split (about) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}

.split__list {
  list-style: none;
  margin-top: 24px;
  display: grid;
  gap: 14px;
}

.split__list li {
  position: relative;
  padding-left: 30px;
  color: var(--text-soft);
}

.split__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-tint);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.panel {
  background: var(--ink);
  color: var(--ink-text);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-lg);
}

.panel h3 {
  color: #fff;
}

.panel dl {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.panel dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7f8ba8;
  font-weight: 700;
}

.panel dd {
  color: #e7eaf2;
  font-weight: 500;
  margin-top: 2px;
}

/* ---------- CTA band ---------- */
.cta {
  text-align: center;
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(79, 70, 229, 0.14), transparent 70%),
    var(--bg-alt);
}

.cta h2 {
  max-width: 18ch;
  margin-inline: auto;
}

.cta p {
  max-width: 46ch;
  margin: 16px auto 0;
}

.cta .btn-row {
  justify-content: center;
}

/* ---------- Page hero (sub pages) ---------- */
.page-hero {
  padding-block: clamp(56px, 8vw, 96px);
  background:
    radial-gradient(50% 80% at 85% 10%, rgba(79, 70, 229, 0.09), transparent 70%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.page-hero p {
  margin-top: 16px;
  max-width: 56ch;
}

.crumbs {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 16px;
}

.crumbs a {
  color: var(--text-mute);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

/* ---------- Info list ---------- */
.info-list {
  display: grid;
  gap: 20px;
}

.info-list > div {
  display: grid;
  gap: 2px;
}

.info-list dt,
.info-list strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  font-weight: 700;
}

.info-list dd,
.info-list span {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Prose (legal / long form) ---------- */
.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 40px;
  margin-bottom: 12px;
}

.prose h3 {
  margin-top: 26px;
  margin-bottom: 6px;
}

.prose p {
  margin-bottom: 14px;
}

.prose ul {
  margin: 0 0 16px 22px;
}

.prose li {
  margin-bottom: 6px;
  color: var(--text-soft);
}

.prose p + h2:first-of-type {
  margin-top: 32px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--ink-text);
  padding-block: clamp(48px, 7vw, 72px) 28px;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}

.footer__brand .brand {
  color: #fff;
}

.footer__brand p {
  margin-top: 14px;
  color: #8a93a8;
  font-size: 0.92rem;
  max-width: 34ch;
}

.footer__col h4 {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.footer__col ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.footer__col a {
  color: var(--ink-text);
  font-size: 0.92rem;
}

.footer__col a:hover {
  color: #fff;
}

.footer__bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #8a93a8;
}

/* ---------- Reveal animation ----------
   Content is only hidden when JavaScript is active (html.js); without
   JS every element renders normally. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    order: -1;
    max-width: 520px;
  }

  .hero .lead {
    max-width: 52ch;
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .nav__links,
  .nav__actions .btn {
    display: none;
  }

  .nav__toggle {
    display: grid;
    place-items: center;
  }

  .nav.is-open .nav__links {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 72px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px max(calc(var(--gutter) - 14px), 6px) 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav.is-open .nav__links a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav.is-open .nav__links .nav__mobile-cta {
    display: block;
    margin-top: 8px;
  }

  .nav.is-open .nav__links .btn {
    display: inline-flex;
    width: 100%;
  }

  .nav.is-open .nav__links .btn--primary {
    color: #fff;
  }

  .nav.is-open .nav__links .btn--primary:hover {
    color: #fff;
    text-decoration: none;
  }

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

  .hero__chip--tl {
    left: 2%;
  }

  .hero__chip--br {
    right: 2%;
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .btn-row .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
