/*
  Steelvekter App Foundry: landing page styles (light edition only).
  Approved design: "Template G", desktop light.
  Colours and rules are recorded in CLAUDE.md. Change them there first.
*/

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lato-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lato-latin-700-normal.woff2") format("woff2");
}

:root {
  --bg: #eff2f3;          /* light tint background */
  --text: #3d4854;        /* body text: 8.28:1 on --bg, 9.32:1 on white */
  --accent: #b12d55;      /* Nordic Garnet */
  --ink: #667788;         /* Nordic Ink */
  --panel: #f7f9fa;
  --line: rgba(102, 119, 136, 0.45);
  --code: #e4e9ec;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Lato", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  padding: 0 clamp(24px, 3vw, 96px) 72px;
}

a {
  color: inherit;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 56px;
  width: 100%;
  max-width: 1200px;
  margin: clamp(32px, 6vh, 64px) auto 0;
}

/* Hero panel */

.hero {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  padding: clamp(28px, 4vw, 56px) clamp(28px, 4vw, 56px) clamp(24px, 2.5vw, 36px);
}

.lang {
  position: absolute;
  top: clamp(8px, 1.2vw, 16px);
  right: clamp(12px, 2vw, 24px);
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 6px 8px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.lang a[aria-current="page"] {
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.lang a:hover {
  border-bottom-color: var(--line);
}

.lang a[aria-current="page"]:hover {
  border-bottom-color: var(--accent);
}

/* A language that is shown but not yet selectable (Danish, until approved). */
.lang .off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 6px 8px;
  font-size: 15px;
  letter-spacing: 0.08em;
  border-bottom: 2px solid transparent;
  cursor: default;
}

.lang a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.lang .sep {
  opacity: 0.5;
}

/* Logo: original V1.6 SVG files, scaled proportionally only. */
.logo img {
  display: block;
  width: min(840px, 100%);
  height: auto;
  margin-left: calc(min(840px, 100%) * -0.0224);
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.split > div {
  flex: 1 1 340px;
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.2;
  min-height: 2.4em;
}

.lede {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  max-width: 46ch;
  min-height: 3.2em;
}

.stage {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

.stage strong {
  color: var(--accent);
}

.stage .step {
  white-space: nowrap;
}

/* Wide screens: a wider headline column (about 60/40).
   From 640px up, the headline breaks after the comma ("…undone," / "safeguarding…"). */
@media (min-width: 1200px) {
  .split {
    flex-wrap: nowrap;
    gap: 24px 48px;
  }

  .split > div:first-child {
    flex: 1.55 1 0;
  }

  .split > div:last-child {
    flex: 1 1 0;
  }
}

/* Tablets: headline on its own row above the lede. */
@media (min-width: 640px) and (max-width: 1199px) {
  .split > div {
    flex: 1 1 100%;
  }
}

@media (min-width: 640px) {
  .hero h1 .h1b {
    display: block;
  }
}

/* Phones: let the browser balance the headline's line lengths. */
@media (max-width: 639px) {
  .hero h1 {
    text-wrap: balance;
  }
}

/* "Developed on GitHub · Runs on macOS" row */

.built {
  margin: -32px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.built::before,
.built::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.built p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Tool cards */

.tools h2 {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  min-height: 1.4em;
  color: var(--accent);
}

.cards {
  display: grid;
  /* One, two or four columns, never three (no orphan card).
     Each card must stay at least 280px wide so every description fits
     on two lines and each brew command on one line. */
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1272px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  /* Defaults; individual cards override these custom properties. */
  --mark: var(--accent);
  --name: var(--text);
  --status: var(--text);
  --box: var(--code);
}

/* Bar above each card: the weight and gap of the upper bar of the E
   in the V1.6 logo (10 units bar, 14.45 units gap, at the 840px logo scale). */
.card .mark {
  height: 10.68px;
  margin-bottom: 15.43px;
  background: var(--mark);
}

.card .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
}

.card .head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--name);
}

.card .status {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--status);
}

.card .status code {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  margin-right: 6px;
}

.card .desc {
  margin: 8px 0 16px;
  font-size: 15px;
  line-height: 1.5;
  min-height: 3em;
}

.card .box {
  display: block;
  margin: auto 0 0;
  padding: 10px 12px;
  background: var(--box);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  min-height: 2.8em;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* Arvekiste: one-off colour exception, approved by the founder. */
.card--arvekiste {
  --mark: var(--ink);
  --name: #9a83d0;   /* 3.04:1 on panel; large text only (19px bold) */
  --status: #d43621; /* 4.57:1 on panel */
  --box: #e1daf1;
}

/* Phones: the language switch sits above the logo instead of over it. */
@media (max-width: 639px) {
  .lang {
    position: static;
    justify-content: flex-end;
    margin: -12px -6px 8px 0;
  }

  .hero h1,
  .lede {
    min-height: 0;
  }

  .built p {
    text-align: center;
  }
}

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