/* ============ Tokens ============ */
:root {
  --r: 16px;
  --wrap: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root, :root[data-theme="night"] {
  --bg: #060a13; --bg2: #0a1120; --surface: #0e1626; --surface2: #131f36;
  --border: #1e2c48; --text: #e8eefb; --muted: #93a4c4;
  --accent: #3ee0ff; --accent2: #8a7bff; --on-accent: #04101c;
  --glow: rgba(62, 224, 255, .16); --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root[data-theme="day"] {
  --bg: #f5f8fd; --bg2: #eaf0fa; --surface: #ffffff; --surface2: #f7f9fe;
  --border: #d8e1f0; --text: #0b1630; --muted: #51617f;
  --accent: #0a6cff; --accent2: #6b4cff; --on-accent: #ffffff;
  --glow: rgba(10, 108, 255, .14); --shadow: 0 12px 34px rgba(24, 48, 96, .12);
  color-scheme: light;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font-family: var(--font); line-height: 1.6; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent);
}
.logo svg { width: 18px; height: 18px; stroke-width: 2.2; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.tools { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
#themeBtn .i-sun { display: none; }
:root[data-theme="night"] #themeBtn .i-sun, :root:not([data-theme]) #themeBtn .i-sun { display: block; }
:root[data-theme="night"] #themeBtn .i-moon { display: none; }
:root[data-theme="day"] #themeBtn .i-moon { display: block; }

/* Segmented controls (language + view) */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: .85rem; font-weight: 600; transition: background .2s, color .2s;
}
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); }
.seg.lang button { padding: 6px 10px; font-family: var(--mono); letter-spacing: .04em; }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 12vw, 128px) 0 clamp(48px, 8vw, 88px); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 50% at 80% 0%, var(--glow), transparent 70%),
    radial-gradient(50% 50% at 5% 30%, color-mix(in srgb, var(--accent2) 14%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 70% at 50% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000, transparent 75%);
}
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .7; }
.hero-inner > h1, .hero-inner > .lead { max-width: 820px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 24px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
h1 { font-size: clamp(2.1rem, 6vw, 3.9rem); font-weight: 800; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 22px; font-size: clamp(1.02rem, 2.2vw, 1.2rem); color: var(--muted); max-width: 640px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px;
  border-radius: 12px; font-weight: 650; border: 1px solid transparent; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); box-shadow: 0 8px 28px var(--glow); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 36px 0 0; }
.chips li { font-family: var(--mono); font-size: .8rem; padding: 6px 12px; border-radius: 8px; border: 1px dashed var(--border); color: var(--muted); }

/* ============ Projects ============ */
.projects { padding: 56px 0 24px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 6px; }

.cat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 18px; transition: border-color .25s, box-shadow .25s; }
.cat.is-open { box-shadow: var(--shadow); }
.cat-head {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px 20px;
  background: transparent; border: 0; border-radius: var(--r);
}
.cat-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--border); color: var(--accent); }
.cat-ico svg { width: 21px; height: 21px; }
.cat-text { flex: 1; min-width: 0; }
.cat-h { margin: 0; font-size: inherit; letter-spacing: 0; }
.cat-text span { display: block; }
.cat-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.cat-desc { font-size: .9rem; color: var(--muted); margin-top: 2px; font-weight: 400; }
.badge { font-family: var(--mono); font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--border); color: var(--muted); }
.chev { width: 20px; height: 20px; color: var(--muted); transition: transform .3s; flex: none; }
.cat.is-open .chev { transform: rotate(180deg); }
.cat-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.cat.is-open .cat-body { grid-template-rows: 1fr; }
.cat-inner { overflow: hidden; visibility: hidden; transition: visibility 0s .35s; }
.cat.is-open .cat-inner { visibility: visible; transition-delay: 0s; }
.items { padding: 4px 20px 20px; display: grid; gap: 16px; }

/* Card */
.card { position: relative; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px var(--glow); }
.card-link { display: flex; flex-direction: column; color: inherit; height: 100%; }
.card-link:hover { text-decoration: none; }
.shot { aspect-ratio: 16 / 9; background: var(--bg2); overflow: hidden; border-bottom: 1px solid var(--border); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.card:hover .shot img { transform: scale(1.04); }
.info { padding: 14px 16px 16px; }
.info h4 { font-size: 1rem; }
.info p { font-size: .88rem; color: var(--muted); margin-top: 3px; }
.url { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: .76rem; color: var(--accent); word-break: break-all; }

/* Plates view */
[data-view="plates"] .items { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* List view */
[data-view="list"] .items { gap: 10px; }
[data-view="list"] .card-link { flex-direction: row; align-items: center; }
[data-view="list"] .shot { width: 148px; flex: none; border-bottom: 0; border-right: 1px solid var(--border); }
[data-view="list"] .info { padding: 12px 56px 12px 16px; min-width: 0; }
[data-view="list"] .url { margin-top: 4px; }

/* QR button in the corner */
.qr-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 9px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--border); color: var(--text); transition: border-color .2s, color .2s, transform .2s;
}
.qr-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); }
.qr-btn svg { width: 16px; height: 16px; }

/* Coming soon */
.soon { margin: 4px 20px 20px; padding: 34px 20px; text-align: center; border: 1.5px dashed var(--border); border-radius: 14px; color: var(--muted); position: relative; overflow: hidden; }
.soon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, var(--glow), transparent 70%); transform: translateX(-100%); animation: sheen 3.6s infinite; }
@keyframes sheen { to { transform: translateX(100%); } }
.soon strong { display: block; color: var(--text); font-size: 1.15rem; margin-bottom: 4px; font-family: var(--mono); }
.dots::after { content: ""; animation: dots 1.6s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }

/* ============ Contact ============ */
.contact { padding: 40px 0 80px; }
.contact-card {
  text-align: center; padding: clamp(32px, 6vw, 56px) 24px; border-radius: 22px; border: 1px solid var(--border);
  background: radial-gradient(80% 120% at 50% 0%, var(--glow), transparent 70%), var(--surface);
}
.contact-card h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.contact-card p { max-width: 560px; margin: 12px auto 26px; }

/* ============ QR dialog ============ */
dialog { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); padding: 28px 26px 24px; width: min(360px, 100% - 32px); text-align: center; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2, 6, 14, .6); backdrop-filter: blur(4px); }
dialog h3 { font-size: 1.05rem; margin-bottom: 16px; padding: 0 22px; }
.qr-box { display: inline-block; padding: 14px; background: #fff; border-radius: 14px; min-height: 100px; min-width: 100px; }
.qr-box img, .qr-box canvas { display: block; }
.qr-url { font-family: var(--mono); font-size: .78rem; margin: 14px 0 6px; word-break: break-all; color: var(--accent); }
dialog .btn { margin-top: 16px; padding: 9px 18px; }
.dlg-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: transparent; border: 1px solid var(--border); }
.dlg-close svg { width: 16px; height: 16px; }

/* ============ Footer / cookie ============ */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--muted); font-size: .88rem; background: var(--bg2); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 620px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .88rem;
}
.cookie p { flex: 1 1 260px; color: var(--muted); }
.cookie .btn { padding: 8px 18px; }

/* ============ Legal pages ============ */
.doc { padding: 56px 0 72px; max-width: 780px; }
.doc .back { display: inline-block; margin-bottom: 22px; font-size: .9rem; }
.doc h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.doc .updated { color: var(--muted); margin: 8px 0 28px; font-size: .9rem; }
.doc h2 { font-size: 1.2rem; margin: 32px 0 10px; }
.doc p, .doc li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.doc p + p { margin-top: 10px; }
.doc ul { padding-left: 22px; margin: 10px 0; }
.doc .intro { font-size: 1.05rem; }

/* ============ Responsive ============ */
@media (max-width: 720px) {
  .nav { display: none; }
  .tools { margin-left: auto; }
  .bar { gap: 12px; }
}
@media (max-width: 560px) {
  .seg button span { display: none; }
  .seg:not(.lang) button { padding: 8px 12px; }
  .cat-head { padding: 14px; gap: 10px; }
  .cat-desc { display: none !important; }
  .items { padding: 2px 12px 14px; }
  .soon { margin: 2px 12px 14px; }
  [data-view="plates"] .items { grid-template-columns: 1fr; }
  [data-view="list"] .shot { width: 108px; }
  [data-view="list"] .info { padding: 10px 46px 10px 12px; }
  [data-view="list"] .info p { display: none; }
  .brand span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media print { .site-header, .cookie, #net, .qr-btn { display: none; } }
