/* etarkvara.eu main page. Dark by default, light when the visitor prefers it. */
:root {
  --bg: #0e110f;
  --bg-raised: #151a16;
  --surface: #1a201b;
  --line: #273027;
  --text: #eef0e8;
  --muted: #a3ab9e;
  --faint: #6f786b;
  --accent: #c9ec8e;
  --accent-ink: #13200b;
  --accent-soft: rgb(201 236 142 / 0.12);
  --shadow: 0 30px 60px -28px rgb(0 0 0 / 0.75);
  --radius: 16px;
  --gutter: clamp(16px, 4vw, 56px);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f3ee;
    --bg-raised: #ecebe4;
    --surface: #ffffff;
    --line: #dcdbd2;
    --text: #1b1f1a;
    --muted: #5d6459;
    --faint: #8a9085;
    --accent: #3f6b1f;
    --accent-ink: #f6fbef;
    --accent-soft: rgb(63 107 31 / 0.10);
    --shadow: 0 30px 60px -32px rgb(30 40 25 / 0.35);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header, main, .site-footer { max-width: 1440px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.site-header {
  height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; letter-spacing: -0.03em; }
.wordmark.small { font-size: 16px; }
.mark { width: 30px; height: 30px; flex: none; }
.wordmark.small .mark { width: 22px; height: 22px; }
.mark rect { fill: var(--accent); }
.mark path { fill: none; stroke: var(--accent-ink); stroke-width: 3.2; stroke-linecap: round; }
nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 14px; color: var(--muted); }
nav a:hover { color: var(--text); }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); font-size: 13px; white-space: nowrap;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(201 236 142 / 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgb(201 236 142 / 0); } }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center;
  gap: clamp(32px, 5vw, 80px); padding: clamp(48px, 8vw, 110px) 0 clamp(56px, 8vw, 104px);
}
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.eyebrow span { color: var(--faint); margin-left: 10px; }
h1 {
  margin: 18px 0 22px; font-size: clamp(44px, 6.6vw, 98px); line-height: 0.98; letter-spacing: -0.045em; font-weight: 650;
  text-wrap: balance;
}
h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.03em; color: var(--accent); }
.lede { margin: 0; max-width: 34em; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 12px;
  font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: transform .2s, background .2s, border-color .2s;
}
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { transform: translateY(-2px); }
.button.ghost { border-color: var(--line); background: transparent; }
.button.ghost:hover { border-color: var(--muted); }

.hero-stack { position: relative; aspect-ratio: 1 / 0.92; }
.hero-card {
  position: absolute; width: 72%; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.hero-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.hero-card span {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: rgb(10 12 10 / 0.72); color: #eef0e8; backdrop-filter: blur(6px);
}
.hero-card:nth-child(1) { right: 0; top: 0; transform: rotate(2.5deg); z-index: 1; }
.hero-card:nth-child(2) { left: 0; top: 30%; transform: rotate(-3deg); z-index: 2; }
.hero-card:nth-child(3) { right: 6%; bottom: 0; transform: rotate(1.5deg); z-index: 3; }
.hero-stack:hover .hero-card:nth-child(1) { transform: rotate(4deg) translate(10px, -8px); }
.hero-stack:hover .hero-card:nth-child(2) { transform: rotate(-5deg) translate(-12px, 0); }
.hero-stack:hover .hero-card:nth-child(3) { transform: rotate(2.5deg) translate(6px, 10px); }

/* Projects */
.projects { border-top: 1px solid var(--line); padding-top: 40px; scroll-margin-top: 16px; }
.projects-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h2 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -0.03em; }
.count-badge {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px; border-radius: 7px; font-size: 13px;
  letter-spacing: 0; color: var(--accent); background: var(--accent-soft);
}
.search {
  display: flex; align-items: center; gap: 10px; min-width: min(320px, 100%); padding: 0 14px; height: 46px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); color: var(--faint);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0 30px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; font-size: 14px; color: var(--muted); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter small { font-size: 12px; opacity: 0.7; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 40px 28px; }
.card[hidden] { display: none; }
.card a { display: block; height: 100%; }
.thumb { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-raised); border: 1px solid var(--line); }
.thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card a:hover .thumb img, .card a:focus-visible .thumb img { transform: scale(1.045); }
.thumb .index, .thumb .chip, .thumb .open {
  position: absolute; font-size: 12px; font-weight: 600; border-radius: 8px; background: rgb(10 12 10 / 0.7); color: #eef0e8; backdrop-filter: blur(6px);
}
.thumb .index { top: 12px; left: 12px; padding: 4px 9px; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.thumb .chip { bottom: 12px; left: 12px; padding: 4px 9px; }
.thumb .open {
  top: 12px; right: 12px; width: 38px; height: 38px; display: grid; place-items: center; font-size: 17px;
  background: var(--accent); color: var(--accent-ink); opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s;
}
.card a:hover .open, .card a:focus-visible .open { opacity: 1; transform: none; }
.card-body { padding: 18px 2px 0; }
.card-body h3 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-body h3 span { color: var(--faint); font-weight: 400; transition: color .2s, transform .2s; }
.card a:hover h3 span { color: var(--accent); transform: translate(2px, -2px); }
.card-body p { margin: 8px 0 14px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; padding: 3px 9px; border-radius: 7px; background: var(--bg-raised); border: 1px solid var(--line); color: var(--muted); }

.empty { padding: 64px 0; text-align: center; color: var(--muted); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 20px; }
.empty p { margin: 0 0 20px; }

/* About */
.about { margin-top: clamp(72px, 9vw, 120px); padding: clamp(28px, 4vw, 48px); border-radius: calc(var(--radius) + 6px); background: var(--bg-raised); border: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-top: 18px; }
.about-grid p { margin: 0; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; max-width: 32em; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(24px, 4vw, 56px); justify-content: flex-end; }
.facts strong { display: block; font-size: clamp(40px, 5vw, 64px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.facts span { font-size: 13px; color: var(--muted); }
.note { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint); }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 64px; padding-top: 28px; padding-bottom: 36px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint);
}

/* Small screens */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stack { aspect-ratio: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .hero-card, .hero-card:nth-child(n) { position: relative; inset: auto; width: auto; transform: none !important; }
  .hero-card img { aspect-ratio: 4 / 5; }
  .hero-card span { left: 8px; bottom: 8px; font-size: 11px; padding: 4px 7px; }
  .about-grid { grid-template-columns: 1fr; }
  .facts { justify-content: flex-start; }
}
@media (max-width: 560px) {
  nav a[href="#about"] { display: none; }
  .live-pill { padding: 6px 10px; font-size: 12px; }
  .hero-actions .button { flex: 1 1 100%; justify-content: center; }
  .search { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
