/* kraliarg.com — single stylesheet. Tokens first, then base, layout, components. */

:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --fg-muted: rgba(28, 25, 23, 0.72);
  --accent: #0f766e;
  --accent-fg: #ffffff;
  --border: rgba(28, 25, 23, 0.14);
  --card: #ffffff;
  --radius: 6px;
  --max: 1040px;
  --gutter: 16px;
  --section: 64px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --fg: #fafaf9;
    --fg-muted: rgba(250, 250, 249, 0.72);
    --accent: #2dd4bf;
    --accent-fg: #042f2e;
    --border: rgba(250, 250, 249, 0.16);
    --card: #1c1917;
  }
}

@media (min-width: 768px) {
  :root {
    --section: 96px;
  }
}

/* Base */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
}

h1,
h2,
h3 {
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(40px, 5vw + 16px, 56px);
  text-wrap: balance;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 20px;
}

p {
  margin: 0 0 1em;
  max-width: 65ch;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

ul {
  padding-left: 1.2em;
}

/* Layout */

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: var(--section) 0 0;
}

.section-title {
  margin-bottom: 24px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Header and nav */

.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  font-weight: 700;
  font-size: 20px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark::after {
  content: ".";
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Hero */

.hero {
  padding: var(--section) 0 0;
}

.hero p {
  font-size: 19px;
  color: var(--fg-muted);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* Components */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius);
  text-decoration: none;
}

.btn:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card p {
  margin: 0;
  color: var(--fg-muted);
}

.card-title {
  margin: 0;
}

.card .tech {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: auto;
  padding-top: 8px;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* Footer */

.site-footer {
  margin-top: var(--section);
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a {
  color: inherit;
}

/* Legal pages */

.legal {
  padding-top: 48px;
}

.legal h2 {
  font-size: 22px;
  margin-top: 40px;
}

.updated {
  color: var(--fg-muted);
  font-size: 15px;
}
