/* Hieg — nordic tech, restrained motion, custom stack */

:root {
  --bg: #0c0f0d;
  --bg-elevated: #141916;
  --bg-card: #171c19;
  --bg-card-hover: #1c221e;
  --border: #2a312c;
  --border-strong: #3d473f;
  --text: #f2efe8;
  --text-muted: #9a9e96;
  --text-dim: #6b716c;
  --accent: #c4854a;
  --accent-soft: #c4854a22;
  --accent-hover: #d4985c;
  --sage: #7a9a7e;
  --sage-soft: #7a9a7e18;
  --danger: #c45a4a;
  --ok: #6a9a6e;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --space-2xl: 5.5rem;
  --radius: 4px;
  --radius-lg: 8px;
  --max: 72rem;
  --narrow: 42rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 4rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent-hover); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.35rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2.5rem, var(--narrow));
  margin-inline: auto;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover { color: var(--text); }
.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.nav a:hover { color: var(--text); }

.nav__cta {
  color: var(--bg) !important;
  background: var(--accent);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.nav__cta:hover {
  background: var(--accent-hover);
  color: var(--bg) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg { width: 1.25rem; height: 1.25rem; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
  }
  .nav a:last-child { border-bottom: none; }
  .nav__cta {
    text-align: center;
    margin-top: 0.5rem;
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  padding: var(--space-2xl) 0 var(--space-xl);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 40%, var(--accent-soft) 100%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 48px,
      color-mix(in srgb, var(--border) 45%, transparent) 48px,
      color-mix(in srgb, var(--border) 45%, transparent) 49px
    );
  mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: end;
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-lg); }
}

.hero h1 {
  margin-bottom: var(--space-md);
  max-width: 14ch;
}

.hero__lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 36ch;
  margin-bottom: var(--space-lg);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

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

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

.btn--ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.hero__aside {
  border-left: 1px solid var(--border);
  padding-left: var(--space-lg);
}

@media (max-width: 860px) {
  .hero__aside {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: var(--space-lg);
  }
}

.hero__stat {
  margin-bottom: var(--space-md);
}

.hero__stat:last-child { margin-bottom: 0; }

.hero__stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ——— Sections ——— */
.section {
  padding: var(--space-xl) 0;
}

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

.section__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section__head p {
  color: var(--text-muted);
  max-width: 36ch;
  margin: 0;
}

.link-more {
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}

.link-more:hover { color: var(--accent-hover); }

/* ——— Focus cards ——— */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.focus-card {
  grid-column: span 2;
  background: var(--bg-card);
  padding: var(--space-lg) var(--space-md);
  transition: background 0.25s var(--ease);
}

.focus-card:hover { background: var(--bg-card-hover); }

.focus-card:nth-child(1),
.focus-card:nth-child(2) {
  grid-column: span 3;
}

@media (max-width: 860px) {
  .focus-grid { grid-template-columns: 1fr 1fr; }
  .focus-card,
  .focus-card:nth-child(1),
  .focus-card:nth-child(2) { grid-column: span 1; }
}

@media (max-width: 520px) {
  .focus-grid { grid-template-columns: 1fr; }
}

.focus-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.focus-card__icon svg { width: 100%; height: 100%; }

.focus-card h3 { margin-bottom: 0.4em; }

.focus-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ——— About ——— */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 760px) {
  .about-layout { grid-template-columns: 1fr; }
}

.about-copy p { color: var(--text-muted); }

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.principles li {
  background: var(--bg-card);
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--space-md);
  align-items: start;
}

.principles__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 0.2rem;
}

.principles strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.principles p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.925rem;
}

/* ——— Blog teaser / listing ——— */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-card {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: var(--space-md);
  align-items: baseline;
  background: var(--bg-card);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s var(--ease);
}

.article-card:hover {
  background: var(--bg-card-hover);
  color: inherit;
}

.article-card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.article-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.article-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.925rem;
}

.article-card__arrow {
  color: var(--accent);
  font-size: 1.25rem;
  align-self: center;
}

@media (max-width: 640px) {
  .article-card {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .article-card__arrow { display: none; }
}

/* ——— Contact ——— */
.contact-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-xl);
}

@media (max-width: 760px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-intro p { color: var(--text-muted); }

.contact-note {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--sage-soft);
  border-left: 3px solid var(--sage);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-dim);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--text-dim);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

/* Honeypot — visually hidden, not display:none (bots often skip those) */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  display: none;
  padding: var(--space-md);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.form-status.is-visible { display: block; }
.form-status--ok {
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  border: 1px solid var(--ok);
  color: var(--text);
}
.form-status--err {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  border: 1px solid var(--danger);
  color: var(--text);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ——— Footer ——— */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
  margin-top: var(--space-xl);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: center;
}

.site-footer p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.site-footer nav a:hover { color: var(--text); }

/* ——— Blog pages ——— */
.page-hero {
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 { margin-bottom: 0.4em; }
.page-hero p {
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0;
}

.article-body {
  padding: var(--space-xl) 0;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: var(--space-lg);
}

.prose {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose .article-note {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
}

.prose h2 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-size: 1.5rem;
}

.prose h3 {
  margin-top: 1.6em;
  font-size: 1.2rem;
}

.prose p { color: var(--text-muted); margin-bottom: 1.15em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol {
  color: var(--text-muted);
  margin: 0 0 1.15em;
  padding-left: 1.35rem;
}
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 1.5em 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5em 0 0;
}

.prose .table-wrap {
  margin: 1.5em 0 1.75em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.prose table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.prose th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-card);
}

.prose td { color: var(--text-muted); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: var(--bg-card-hover); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--space-lg);
}

.back-link:hover { color: var(--accent); }

/* ——— Utility ——— */
.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;
}
