/* deqartis.se. Colours as tokens; dark mode follows the visitor's system setting. */
:root {
  --ink: #0f1b2d;
  --text: #2b3a4f;
  --muted: #5b6b80;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --line: #dde3ea;
  --accent: #1f9e8f;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4f1;
  --hero: linear-gradient(135deg, #0f1b2d 0%, #16324a 60%, #1c4a5a 100%);
  --hero-text: #f2f6fa;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.06);
  --radius: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-brand: 'Montserrat', var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef3f8;
    --text: #c9d4e0;
    --muted: #93a3b6;
    --paper: #0b1420;
    --surface: #121e2d;
    --line: #22324a;
    --accent: #3cc3b1;
    --accent-ink: #062320;
    --accent-soft: #123a37;
    --hero: linear-gradient(135deg, #0b1420 0%, #102638 60%, #133a46 100%);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

/* Montserrat Bold, the typeface of the Deqartis logo, for the name and headings. Served from the
   site itself (the CSP allows no other origin). SIL Open Font License 1.1. */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/montserrat-latin-700.woff2') format('woff2'); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.0625rem/1.65 var(--font); color: var(--text); background: var(--paper); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; font-family: var(--font-brand); font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-name { font-family: var(--font-brand); font-size: 1.15rem; letter-spacing: 0.01em; }
.brand-logo { display: block; width: 41px; height: 36px; }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; }
.site-nav a, .language { color: var(--text); text-decoration: none; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.language { font-weight: 600; }

/* Buttons and links */
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 12px 22px; border-radius: 999px; border: 2px solid var(--accent); cursor: pointer; font: inherit; font-weight: 600; }
.button:hover { filter: brightness(1.08); }
.button.ghost { background: transparent; color: inherit; border-color: currentColor; }
.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Hero */
.hero { background: var(--hero); color: var(--hero-text); padding: clamp(56px, 9vw, 104px) 0; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lead { color: rgba(242, 246, 250, 0.86); max-width: 60ch; font-size: 1.15rem; }
.hero .button.ghost { color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: #8fe0d4; margin-bottom: 12px; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.hero .badge { background: rgba(143, 224, 212, 0.16); color: #8fe0d4; }

/* Sections and cards */
.section { padding-block: clamp(36px, 6vw, 64px) 0; }
.page-head { padding-block: clamp(40px, 7vw, 72px) 8px; }
.page-head .lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.featured { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin-top: -40px; position: relative; }
.featured-card, .demo-card, .card, .feature, .project, .reference, .cta, .demo-band { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.demo-card { border-top: 4px solid var(--accent); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { color: inherit; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.card:hover { transform: translateY(-2px); }
.card.plain { box-shadow: none; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature ul, .checks { margin: 0; padding-left: 1.2em; }
.feature li, .checks li { margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.tags li { font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.demo-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 12px; }
.reference, .cta, .demo-band { margin-top: clamp(36px, 6vw, 64px); }
.cta { text-align: center; }
.cta .actions { justify-content: center; }
.projects { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); padding-bottom: 8px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.3rem; }

/* CV */
.cv-head .role { font-size: 1.2rem; font-weight: 600; color: var(--accent); margin-top: -6px; }
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline > li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 0 0 24px 20px; position: relative; }
.timeline > li::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.period { color: var(--muted); font-weight: 600; margin: 0; }
.org { color: var(--muted); margin: -4px 0 6px; }
.points { margin: 0; padding-left: 1.2em; }
.points li { margin-bottom: 4px; }
.highlights { max-width: 80ch; }

/* Contact */
.contact { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; padding-bottom: 16px; }
.contact-form { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.contact-form label { display: grid; gap: 6px; font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.contact-form input, .contact-form textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; }
.contact-form .button { justify-self: start; }
.contact-form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.6em; font-weight: 600; }
.form-status[data-state="error"] { color: #c2410c; }
.form-status[data-state="sent"] { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.95rem; }

/* Footer */
.site-footer { margin-top: clamp(48px, 8vw, 96px); border-top: 1px solid var(--line); background: var(--surface); }
.footer-row { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 24px; font-size: 0.92rem; color: var(--muted); }
.footer-row p { margin: 0; }

/* Fixed columns so every row is full: six feature cards go 3+3, 2+2+2 or one column; the three-card
   grids go straight from three columns to one. */
@media (max-width: 960px) {
  .features, .skills { grid-template-columns: repeat(2, 1fr); }
  .cards, .steps, .projects { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .featured, .contact { grid-template-columns: 1fr; }
  .featured { margin-top: 24px; }
  .site-nav { margin-left: 0; order: 3; width: 100%; }
  .timeline > li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 600px) {
  .features, .skills { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
