/* Wardline site. One primary (teal), warm neutrals, system type.
   Themes: light by default, dark by system preference or the toggle
   (html[data-theme]). The hero is always dark: it is the brand moment. */

:root {
  --font: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #eef0f2;
  --text: #121619;
  --text-2: #4d5761;
  --text-3: #626c76;
  --line: rgba(18, 22, 25, 0.1);
  --line-strong: rgba(18, 22, 25, 0.18);
  --accent: #0a7a67;
  --accent-strong: #08604f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 122, 103, 0.12);
  --danger: #b93636;
  --danger-soft: rgba(201, 61, 61, 0.12);
  --shadow: 0 1px 2px rgba(18, 22, 25, 0.06), 0 12px 32px -12px rgba(18, 22, 25, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(18, 22, 25, 0.35);
  --radius: 14px;
  --radius-lg: 22px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;
  --dur-slow: 560ms;

  /* the hero palette does not change with the theme */
  --hero-bg: #0b1119;
  --hero-bg-2: #101a26;
  --hero-text: #e9edf1;
  --hero-text-2: #a4afba;
  --hero-line: rgba(255, 255, 255, 0.1);
  --hero-accent: #2ee6c5;
  --hero-accent-ink: #06231d;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #12171d;
  --surface-2: #181e26;
  --text: #e6e9ec;
  --text-2: #a3acb5;
  --text-3: #7c8791;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #2ee6c5;
  --accent-strong: #5cf0d6;
  --accent-ink: #06231d;
  --accent-soft: rgba(46, 230, 197, 0.13);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 99, 99, 0.14);
  --shadow: 0 1px 2px rgba(3, 8, 14, 0.4), 0 12px 32px -12px rgba(3, 8, 14, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(3, 8, 14, 0.7);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

/* author display rules must not resurrect [hidden] elements */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.hero :focus-visible {
  outline-color: var(--hero-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(1180px, 100% - 2 * clamp(16px, 4vw, 40px));
  margin-inline: auto;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--text-2);
  max-width: 60ch;
}

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-out), background-color var(--dur), border-color var(--dur), box-shadow var(--dur);
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px -10px var(--accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--text-3);
}

.btn-lg {
  min-height: 52px;
  padding-inline: 26px;
  font-size: 1.0625rem;
}

.hero .btn-primary {
  background: var(--hero-accent);
  color: var(--hero-accent-ink);
  box-shadow: 0 10px 30px -10px rgba(46, 230, 197, 0.6);
}

.hero .btn-primary:hover {
  background: #5cf0d6;
}

.hero .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--hero-line);
  color: var(--hero-text);
}

.hero .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.top-nav {
  display: none;
  gap: 4px;
  margin-inline: auto;
}

.top-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur), color var(--dur);
}

.top-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.seg button {
  min-width: 40px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--dur), color var(--dur);
}

.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur), transform var(--dur) var(--ease-out);
}

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

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .icon-btn .sun,
html:not([data-theme="dark"]) .icon-btn .moon {
  display: none;
}

.top .btn-primary {
  display: none;
}

@media (min-width: 720px) {
  .top .btn-primary {
    display: inline-flex;
    min-height: 38px;
    padding-inline: 16px;
  }
}

/* six items in German need ~560px; below that the anchors are one scroll away */
@media (min-width: 1060px) {
  .top-nav {
    display: flex;
  }
}

@media (min-width: 1060px) and (max-width: 1199px) {
  .top-nav a {
    padding: 8px 9px;
    font-size: 0.875rem;
  }
}

/* ---------- footer ---------- */
.foot {
  padding-block: 36px;
  font-size: 0.875rem;
  color: var(--text-3);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-left: auto;
}

.foot a {
  color: var(--text-2);
}

.foot-note {
  width: 100%;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}

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

html.no-observer .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- reduced motion: no movement anywhere ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .hero-glow {
    animation: none;
  }

  .hero .frame,
  .hero-visual:hover .frame {
    transform: none;
  }

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

  .btn:hover,
  .tile:hover,
  .icon-btn:hover {
    transform: none;
  }
}
