/* eco-web: shared stylesheet of the small HEXART product pages (hipokamp.hexart.io,
   router.hexart.io). HEXART brandbook: Onyx ground, Graphite panels, Slate lines, gold at most
   8% of the surface, Outfit for text, Barlow Condensed labels in capitals, JetBrains Mono for
   code, the top right corner cut at 30 degrees with a visible 1 px edge along the cut, radii
   0/2/4, no glow, buttons fill from left to right.

   Strict CSP (style-src 'self'): no inline styles anywhere, every value lives here. */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/outfit-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens (values from hexart-tokens.json, dark theme) ---------- */

:root {
  --hx-onyx: #0a0a0c;
  --hx-carbon: #050507;
  --hx-graphite: #141418;
  --hx-slate: #24242a;
  --hx-neutral-700: #3b3c46;
  --hx-neutral-400: #8d94a1;
  --hx-mist: #b0b8c4;
  --hx-white: #ffffff;
  --hx-gold: #d1ae53;
  --hx-gold-light: #ebd065;
  --hx-gold-600: #b4923b;
  --hx-gold-700: #96772a;

  --hx-bg: var(--hx-onyx);
  --hx-bg-deep: var(--hx-carbon);
  --hx-surface: var(--hx-graphite);
  --hx-line: var(--hx-slate);
  --hx-line-strong: var(--hx-neutral-700);
  --hx-line-accent: #d1ae5366;
  --hx-fg: var(--hx-white);
  --hx-fg-muted: var(--hx-mist);
  --hx-fg-subtle: var(--hx-neutral-400);
  --hx-accent: var(--hx-gold);
  --hx-accent-active: var(--hx-gold-600);
  --hx-accent-press: var(--hx-gold-700);
  --hx-accent-text: var(--hx-gold);
  --hx-on-accent: var(--hx-onyx);
  --hx-focus: var(--hx-gold-light);

  --hx-font-sans: "Outfit", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Arial", sans-serif;
  --hx-font-condensed: "Barlow Condensed", "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --hx-font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "Consolas", "SF Mono", "Menlo", monospace;

  --hx-text-h1: clamp(2.5rem, 1.6667rem + 3.7037vw, 5rem);
  --hx-text-h2: clamp(2rem, 1.5rem + 2.2222vw, 3.5rem);
  --hx-text-h4: clamp(1.25rem, 1.125rem + 0.5556vw, 1.625rem);
  --hx-text-lead: clamp(1.125rem, 1rem + 0.5556vw, 1.5rem);
  --hx-text-body: clamp(1rem, 0.9583rem + 0.1852vw, 1.125rem);
  --hx-text-small: clamp(0.875rem, 0.8542rem + 0.0926vw, 0.9375rem);
  --hx-text-label: clamp(0.75rem, 0.7292rem + 0.0926vw, 0.8125rem);
  --hx-text-code: clamp(0.875rem, 0.8542rem + 0.0926vw, 0.9375rem);
  --hx-tracking-caps: 0.14em;

  --hx-space-1: 4px;
  --hx-space-2: 8px;
  --hx-space-3: 12px;
  --hx-space-4: 16px;
  --hx-space-6: 24px;
  --hx-space-8: 32px;
  --hx-space-12: 48px;
  --hx-space-16: 64px;

  --hx-ease-standard: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --hx-ease-enter: cubic-bezier(0.2, 0, 0, 1);

  /* chamfer heights; the cut width is height x sqrt(3) (30 degrees) */
  --hx-chamfer-sm: 6px;
  --hx-chamfer-md: 10px;
  --hx-chamfer-lg: 16px;
  --hx-chamfer-xl: 28px;

  --gutter: clamp(1rem, 0.5rem + 2.2222vw, 2.5rem);
  --header-h: 4rem;
  color-scheme: dark;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--hx-space-6));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--hx-bg);
  color: var(--hx-fg);
  font-family: var(--hx-font-sans);
  font-size: var(--hx-text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

a {
  color: inherit;
}

code {
  font-family: var(--hx-font-mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
  font-synthesis-weight: none;
}

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

::selection {
  background: var(--hx-accent);
  color: var(--hx-on-accent);
}

.wrap {
  width: min(100% - 2 * var(--gutter), 74rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -6rem;
  z-index: 601;
  padding: var(--hx-space-3) var(--hx-space-4);
  background: var(--hx-accent);
  color: var(--hx-on-accent);
  font-weight: 500;
  text-decoration: none;
}

.skip:focus {
  top: var(--hx-space-2);
}

.label,
.kicker {
  font-family: var(--hx-font-condensed);
  font-weight: 600;
  font-size: var(--hx-text-label);
  line-height: 1.2;
  letter-spacing: var(--hx-tracking-caps);
  text-transform: uppercase;
}

.kicker {
  display: flex;
  align-items: center;
  gap: var(--hx-space-3);
  color: var(--hx-accent-text);
}

.kicker::before {
  content: "";
  flex: none;
  width: 1.75em;
  height: 1px;
  background: var(--hx-accent);
}

/* ---------- chamfer: 30 degree cut with a visible edge along the diagonal ----------
   clip-path cuts the corner; ::after draws a 1 px line on the inner side of the cut in the
   colour of the element's border (--edge), so the border runs around the whole shape. Every
   element with .cut has a 1 px border (the line box sits on the border box corner). */

.cut {
  --cut: var(--hx-chamfer-lg);
  --cut-x: calc(var(--cut) * 1.7320508);
  --edge: var(--hx-line);
  position: relative;
  border: 1px solid var(--edge);
  clip-path: polygon(0 0, calc(100% - var(--cut-x)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.cut::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: var(--cut-x);
  height: var(--cut);
  pointer-events: none;
  background: linear-gradient(
    to bottom left,
    transparent 50%,
    var(--edge) 50%,
    var(--edge) calc(50% + 1px),
    transparent calc(50% + 1.5px)
  );
}

.cut--sm {
  --cut: var(--hx-chamfer-sm);
}

.cut--md {
  --cut: var(--hx-chamfer-md);
}

.cut--xl {
  --cut: var(--hx-chamfer-xl);
}

/* ---------- buttons: fill from left to right (clip-path inset 100% to 0) ---------- */

.btn {
  --cut: var(--hx-chamfer-md);
  --edge: var(--hx-accent);
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--hx-space-6);
  font-family: var(--hx-font-sans);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 120ms linear;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fill);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 200ms var(--hx-ease-standard);
}

.btn--primary {
  --fill: var(--hx-accent-active);
  --press: var(--hx-accent-press);
  background: var(--hx-accent);
  color: var(--hx-on-accent);
}

.btn--secondary {
  --fill: var(--hx-accent);
  --press: var(--hx-accent-active);
  background: transparent;
  color: var(--hx-accent-text);
}

.btn--sm {
  --cut: var(--hx-chamfer-sm);
  min-height: 40px;
  padding: 0 var(--hx-space-4);
  font-size: 0.875rem;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover::before {
    clip-path: inset(0);
    transition: clip-path 320ms var(--hx-ease-enter);
  }
  .btn--secondary:hover {
    color: var(--hx-on-accent);
  }
}

.btn:focus-visible {
  /* the outer ring would be cut by clip-path: ring inside, Onyx on the gold fill */
  outline: 2px solid var(--hx-onyx);
  outline-offset: -6px;
}

.btn:focus-visible::before {
  clip-path: inset(0);
  transition: clip-path 320ms var(--hx-ease-enter);
}

.btn--secondary:focus-visible {
  color: var(--hx-on-accent);
}

.btn:active::before {
  clip-path: inset(0);
  background: var(--press);
  transition: none;
}

.btn--secondary:active {
  color: var(--hx-on-accent);
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--hx-bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hx-line);
}

.top__inner {
  display: flex;
  align-items: center;
  gap: var(--hx-space-6);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--hx-space-3);
  min-height: 44px;
  color: var(--hx-fg);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 32px;
  height: 32px;
}

.top nav {
  margin-left: auto;
}

.nav {
  display: flex;
  gap: var(--hx-space-6);
  padding: 0;
  list-style: none;
}

.nav a,
.lang {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hx-fg-muted);
  text-decoration: none;
}

.nav a {
  font-size: 0.9375rem;
}

.lang {
  justify-content: center;
  min-width: 44px;
  font-family: var(--hx-font-condensed);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: var(--hx-tracking-caps);
  text-transform: uppercase;
}

@media (hover: hover) and (pointer: fine) {
  .nav a:hover,
  .lang:hover {
    color: var(--hx-fg);
  }
}

@media (max-width: 767.98px) {
  .nav,
  .top .btn {
    display: none;
  }
  .lang {
    margin-left: auto;
  }
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(48px, 8vw, 112px) clamp(64px, 8vw, 128px);
}

.hero__grid {
  display: grid;
  gap: var(--hx-space-12);
  align-items: center;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--hx-space-16);
  }
}

.hero h1 {
  margin-top: var(--hx-space-4);
  font-weight: 300;
  font-size: var(--hx-text-h1);
  line-height: 1;
  letter-spacing: -0.03em;
}

h1 em,
h2 em {
  font-style: normal;
  color: var(--hx-accent-text);
}

.lead {
  max-width: 36em;
  margin-top: var(--hx-space-6);
  font-weight: 300;
  font-size: var(--hx-text-lead);
  line-height: 1.45;
  color: var(--hx-fg-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hx-space-3);
  margin-top: var(--hx-space-8);
}

.panel {
  background: var(--hx-surface);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}

.panel__mark {
  width: clamp(96px, 20vw, 152px);
  height: auto;
}

.spec {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin-top: var(--hx-space-6);
}

.spec dt,
.spec dd {
  padding-block: var(--hx-space-3);
  border-top: 1px solid var(--hx-line);
}

.spec dt {
  padding-right: var(--hx-space-4);
  color: var(--hx-fg-subtle);
}

.spec dd {
  font-size: var(--hx-text-small);
  line-height: 1.5;
}

.tools {
  margin-top: var(--hx-space-4);
  padding-top: var(--hx-space-4);
  border-top: 1px solid var(--hx-line);
}

.tools p {
  color: var(--hx-fg-subtle);
}

.tools code {
  display: block;
  margin-top: var(--hx-space-2);
  font-size: var(--hx-text-code);
  line-height: 1.6;
  color: var(--hx-fg-muted);
  overflow-wrap: anywhere;
}

/* ---------- sections ---------- */

.section {
  padding-block: clamp(64px, 8vw, 128px);
  border-top: 1px solid var(--hx-line);
}

.section__head {
  max-width: 44rem;
  margin-bottom: var(--hx-space-12);
}

.section h2 {
  margin-top: var(--hx-space-4);
  font-weight: 300;
  font-size: var(--hx-text-h2);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.grid {
  display: grid;
  gap: var(--hx-space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--hx-space-3);
  background: var(--hx-surface);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}

.card .card__num {
  color: var(--hx-accent-text);
}

.card h3,
.step h3 {
  font-weight: 500;
  font-size: var(--hx-text-h4);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card p,
.step p {
  color: var(--hx-fg-muted);
  font-size: var(--hx-text-small);
  line-height: 1.5;
}

/* how it works */

.steps {
  display: grid;
  gap: var(--hx-space-8) var(--hx-space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--hx-space-3);
  padding-top: var(--hx-space-6);
  border-top: 1px solid var(--hx-line-accent);
}

.step__num {
  font-family: var(--hx-font-condensed);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--hx-fg);
}

/* FAQ: native details, works without JavaScript */

.faq {
  max-width: 52rem;
  border-bottom: 1px solid var(--hx-line);
}

.faq details {
  border-top: 1px solid var(--hx-line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hx-space-4);
  min-height: 44px;
  padding-block: var(--hx-space-6);
  font-size: var(--hx-text-h4);
  line-height: 1.3;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  width: 1.5rem;
  font-family: var(--hx-font-mono);
  font-size: 1.25rem;
  text-align: center;
  color: var(--hx-accent-text);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  max-width: 44rem;
  padding-bottom: var(--hx-space-6);
  color: var(--hx-fg-muted);
}

/* call to action */

.cta {
  display: grid;
  gap: var(--hx-space-6);
  padding: clamp(2rem, 1rem + 4vw, 4rem);
}

.cta h2 {
  margin-top: 0;
}

.cta p {
  max-width: 40rem;
  color: var(--hx-fg-muted);
}

.cta .actions {
  align-items: center;
  margin-top: var(--hx-space-2);
}

.mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: var(--hx-space-3);
  font-family: var(--hx-font-mono);
  font-size: var(--hx-text-code);
  color: var(--hx-fg-muted);
  text-decoration: underline;
  text-decoration-color: var(--hx-line-strong);
  text-underline-offset: 0.3em;
}

@media (hover: hover) and (pointer: fine) {
  .mail:hover {
    color: var(--hx-fg);
    text-decoration-color: var(--hx-fg);
  }
}

/* ---------- footer ---------- */

.foot {
  padding-block: var(--hx-space-16) var(--hx-space-8);
  background: var(--hx-bg-deep);
  border-top: 1px solid var(--hx-line);
}

.foot__grid {
  display: grid;
  gap: var(--hx-space-12) var(--hx-space-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.foot__title {
  margin-bottom: var(--hx-space-3);
  color: var(--hx-fg-subtle);
}

.foot__logo {
  display: inline-block;
  margin-top: var(--hx-space-2);
  padding: var(--hx-space-2) 0;
}

.foot__logo img {
  width: 160px;
  height: auto;
}

.foot ul {
  padding: 0;
  list-style: none;
}

.foot li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hx-fg-muted);
  text-decoration: underline;
  text-decoration-color: var(--hx-line-strong);
  text-underline-offset: 0.3em;
}

@media (hover: hover) and (pointer: fine) {
  .foot li a:hover {
    color: var(--hx-fg);
    text-decoration-color: var(--hx-fg);
  }
}

.foot__legal {
  margin-top: var(--hx-space-12);
  padding-top: var(--hx-space-6);
  border-top: 1px solid var(--hx-line);
  font-size: var(--hx-text-label);
  line-height: 1.6;
  color: var(--hx-fg-subtle);
}
