/* ==========================================================================
   wiktorwasniewski.pl — dark by default, light via [data-theme="light"]
   ========================================================================== */

:root {
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e14;
  --bg-alt: #10131b;
  --surface: #151924;
  --surface-2: #1b2030;
  --border: #252b3b;
  --text: #e8ebf2;
  --text-strong: #ffffff;
  --muted: #9aa3b6;
  --accent: #f5b83d;       /* amber, the "lightning" */
  --accent-ink: #1a1305;
  --accent-2: #9d8cff;     /* UV violet */
  --accent-soft: rgba(245, 184, 61, .12);
  --violet-soft: rgba(157, 140, 255, .14);
  --grad: linear-gradient(100deg, #f5b83d 0%, #f08a5d 45%, #9d8cff 100%);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .7);
  --header-bg: rgba(12, 14, 20, .78);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5ef;
  --bg-alt: #efece4;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --border: #e0dbcf;
  --text: #1d2130;
  --text-strong: #0b0d14;
  --muted: #5c6376;
  --accent: #a86a00;
  --accent-ink: #ffffff;
  --accent-2: #5a45d6;
  --accent-soft: rgba(196, 128, 0, .12);
  --violet-soft: rgba(90, 69, 214, .1);
  --grad: linear-gradient(100deg, #c77d00 0%, #d9582b 45%, #5a45d6 100%);
  --shadow: 0 20px 45px -28px rgba(40, 30, 10, .35);
  --header-bg: rgba(247, 245, 239, .85);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { color: var(--text-strong); line-height: 1.15; margin: 0; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); letter-spacing: -.02em; }
h3 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
strong { color: var(--text-strong); font-weight: 700; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: .85em; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .72em 1.15em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  font: 700 .95rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, background .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { color: var(--text-strong); border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-ghost { background: transparent; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  font: 800 .8rem/1 var(--font-mono);
  text-decoration: none;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; color: var(--text-strong); }
.brand:hover { color: var(--text-strong); }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  transform: rotate(45deg);
  border: 2px solid var(--accent);
  border-radius: 6px;
  font-family: var(--font-display); font-size: .85rem;
}
.brand-mark > span { transform: rotate(-45deg); }
.brand-name { white-space: nowrap; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; }
.nav a:not(.btn) { display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: .93rem; font-weight: 600; color: var(--muted); }
.nav a:not(.btn):hover, .nav a.active { color: var(--text-strong); background: var(--surface); }
.nav-cv { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: block; }
.menu-toggle { display: none; }
.menu-toggle .i-x { display: none; }
.header-cv { padding: .6em 1em; }

@media (max-width: 1080px) {
  .brand-name { display: none; }
}
@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; }
  .header-cv { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 20px;
    transform: translateY(-110%);
    visibility: hidden;
    transition: transform .3s var(--ease), visibility .3s;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a:not(.btn) { padding: 12px 14px; font-size: 1.05rem; }
  .nav-cv { display: inline-flex; margin-top: 10px; }
  .nav-open .nav { transform: none; visibility: visible; }
  .nav-open .menu-toggle .i-menu { display: none; }
  .nav-open .menu-toggle .i-x { display: block; }
  .brand-name { display: inline; }
  .header-actions { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 110px) 0 56px; isolation: isolate; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 90%; z-index: -2;
  background:
    radial-gradient(40% 50% at 78% 30%, var(--violet-soft), transparent 70%),
    radial-gradient(35% 45% at 18% 20%, var(--accent-soft), transparent 70%);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .55; }
[data-theme="light"] .hero-canvas { opacity: .35; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 1.2rem + 5.4vw, 5.2rem);
  letter-spacing: -.035em;
  line-height: 1;
  margin-bottom: 1.4rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-lead { font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem); line-height: 1.55; color: var(--text-strong); font-weight: 600; max-width: 38em; }
.hero-sub { color: var(--muted); max-width: 40em; }
.badge-available {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, #3ecf8e 12%, transparent);
  color: color-mix(in srgb, #3ecf8e 80%, var(--text-strong));
  font-size: .9rem; font-weight: 700;
  margin: .4rem 0 1.6rem;
}
[data-theme="light"] .badge-available { color: #137a4b; background: rgba(30, 150, 90, .1); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 0 rgba(62, 207, 142, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(62, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); } }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-center { justify-content: center; }

.portrait { position: relative; margin: 0 auto; width: min(360px, 78vw); aspect-ratio: 1; display: grid; place-items: center; }
.portrait img {
  width: 76%; aspect-ratio: 596 / 696; object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.diamond {
  position: absolute; inset: 7%;
  transform: rotate(45deg);
  border: 2px solid var(--accent);
  border-radius: 18px;
  box-shadow: 0 0 60px -10px color-mix(in srgb, var(--accent-2) 60%, transparent), inset 0 0 40px -20px var(--accent-2);
  animation: float 9s ease-in-out infinite;
}
.diamond::after {
  content: ''; position: absolute; inset: -14px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 70%, transparent);
  border-radius: 24px;
}
@keyframes float { 50% { transform: rotate(45deg) scale(1.03); } }

.now {
  margin: clamp(36px, 5vw, 64px) 0 18px;
  padding: 12px 18px;
  border-left: 3px solid var(--accent-2);
  background: var(--violet-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats li { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 85%, transparent); }
.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 1vw, 1.9rem);
  line-height: 1.1; margin-bottom: 6px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.stats span { display: block; font-size: .86rem; line-height: 1.45; color: var(--muted); }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(280px, 70vw); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin-bottom: .6rem; }
.section-intro { color: var(--muted); font-size: 1.08rem; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag { font-family: var(--font-mono); font-size: .74rem; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chip { font-size: .88rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text-strong); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.checks li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.checks .icon { color: var(--accent); margin-top: .3em; }
.checks.cols-2 { columns: 2 280px; column-gap: 32px; }
.checks.cols-2 li { break-inside: avoid; }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.prose p { font-size: 1.05rem; color: var(--text); }
.about-side { display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 24px); }
.quote {
  margin: 0; padding: 24px 26px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.25rem; line-height: 1.4;
  color: var(--text-strong);
  border-radius: var(--radius);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
}
.about-side .tags { margin: 0; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } .about-side { position: static; } }

/* timeline */
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; position: relative; padding-bottom: 36px; }
.tl-item::before { content: ''; position: absolute; left: 187px; top: 10px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-item::after { content: ''; position: absolute; left: 182px; top: 6px; width: 12px; height: 12px; transform: rotate(45deg); border: 2px solid var(--accent); background: var(--bg-alt); border-radius: 2px; }
.tl-item:first-child::after { background: var(--accent); }
.tl-dates { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); text-align: right; margin: 0; padding-top: 2px; }
.tl-body { padding-left: 22px; }
.tl-body h3 { font-size: 1.2rem; }
.tl-org { color: var(--accent); font-weight: 700; margin: 4px 0 10px; }
.tl-body ul li { position: relative; padding-left: 18px; margin-bottom: 6px; color: var(--text); }
.tl-body ul li::before { content: ''; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
@media (max-width: 720px) {
  .tl-item { grid-template-columns: 1fr; gap: 4px; padding-left: 28px; }
  .tl-item::before { left: 5px; }
  .tl-item::after { left: 0; }
  .tl-dates { text-align: left; }
  .tl-body { padding-left: 0; }
}

/* featured case */
.featured {
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(20px, 3vw, 36px);
  background:
    radial-gradient(60% 80% at 100% 0%, var(--violet-soft), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 36px;
}
.featured-head { max-width: 820px; margin-bottom: 24px; }
.featured-head h3 { font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); font-weight: 700; margin-bottom: 12px; }
.featured-summary { font-size: 1.08rem; color: var(--text); margin: 0; }
.featured-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); }
.featured-gallery { align-self: start; position: sticky; top: calc(var(--header-h) + 16px); }
.gallery-main img, .gallery-thumbs img { border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: zoom-in; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.gallery-thumbs img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; transition: transform .2s var(--ease), border-color .2s; }
.gallery-thumbs img:hover { transform: translateY(-2px); border-color: var(--accent); }
.note { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.meta { margin: 18px 0; display: grid; gap: 12px; }
.meta dt { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.meta dd { margin: 2px 0 0; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.facts li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.facts strong { display: block; font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); }
.facts span { font-size: .8rem; color: var(--muted); line-height: 1.3; display: block; }
@media (max-width: 960px) { .featured-grid { grid-template-columns: 1fr; } .featured-gallery { position: static; } .gallery-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* case cards */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.case { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .2s, transform .2s var(--ease); }
.case:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.case-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.case-media > img { width: 100%; height: 100%; object-fit: cover; object-position: top center; cursor: zoom-in; transition: transform .5s var(--ease); }
.case:hover .case-media > img { transform: scale(1.03); }
.case-media-empty, .project-media-empty { display: grid; place-items: center; color: var(--muted); background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--surface) 12px 24px); }
.case-media-empty .icon, .project-media-empty .icon { width: 44px; height: 44px; opacity: .6; }
.media-count { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font: 700 .8rem var(--font-mono); pointer-events: none; }
.case-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.case-meta { font-size: .88rem; color: var(--muted); margin: 0 0 4px; }
.archived { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }
.case h3 { font-size: 1.35rem; }
.case-list li { position: relative; padding-left: 18px; margin-bottom: 7px; font-size: .97rem; }
.case-list li::before { content: ''; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.result { display: flex; gap: 10px; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: .95rem; }
.result .icon { color: var(--accent); margin-top: .25em; }
.case-model { font-size: .92rem; color: var(--muted); margin: 12px 0 0; }
.case-links { margin: auto 0 0; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 14px; }
.case-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .95rem; }
.case-links .icon { width: .95em; height: .95em; }
.small-jobs { margin-top: 24px; }
.subhead { margin: 48px 0 16px; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cases-archive { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cases-archive .case-body { padding: 16px 18px 18px; }
.cases-archive h3 { font-size: 1.1rem; }
.cases-archive .case-list li { font-size: .9rem; }
.cases-archive .tags { margin: 8px 0; }
@media (max-width: 1100px) { .cases-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .cases { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cases-archive { grid-template-columns: 1fr; } }

/* print gallery */
.print-block { margin-top: 8px; }
.print-intro { color: var(--muted); margin: -6px 0 16px; }
.masonry { columns: 3 260px; column-gap: 16px; }
.masonry li { break-inside: avoid; margin-bottom: 16px; }
.masonry figure, .photo-row figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.masonry img, .photo-row img { width: 100%; cursor: zoom-in; transition: transform .4s var(--ease); }
.masonry figure:hover img, .photo-row figure:hover img { transform: scale(1.02); }
.masonry figcaption, .photo-row figcaption { padding: 10px 14px 12px; font-size: .86rem; color: var(--muted); line-height: 1.45; }

/* workshop photos */
.photo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.photo-row img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 760px) { .photo-row { grid-template-columns: 1fr; } }

/* UV feature in interests */
.feature-uv {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 40px); align-items: center;
  padding: clamp(20px, 3vw, 32px); margin-bottom: 36px;
  border-radius: calc(var(--radius) + 6px);
  background: radial-gradient(70% 90% at 0% 100%, var(--violet-soft), transparent 70%), var(--surface);
  border: 1px solid var(--border);
}
.feature-uv h3 { font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 700; margin-bottom: 12px; }
.feature-uv p:last-child { margin: 0; color: var(--text); }
.uv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uv-grid li { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.uv-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
@media (max-width: 860px) { .feature-uv { grid-template-columns: 1fr; } }

/* services */
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service p { color: var(--muted); margin: 0; font-size: .97rem; }
.service-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.service-icon .icon { width: 22px; height: 22px; }
.models { margin-top: 32px; max-width: 820px; }
.models h3 { margin-bottom: 14px; }
@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .service-grid { grid-template-columns: 1fr; } }

/* projects */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.project-wide { grid-column: span 2; }
.project-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.project-media > img { width: 100%; height: 100%; object-fit: cover; object-position: top center; cursor: zoom-in; }
.project-body { padding: 20px 22px 22px; }
.project-body p { color: var(--muted); font-size: .96rem; margin-bottom: 0; }
.project-body h3 { margin-bottom: 8px; }
@media (max-width: 960px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .project-grid { grid-template-columns: 1fr; } .project-wide { grid-column: auto; } }

/* workshop */
.workshop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: ws; }
.workshop-grid li { position: relative; padding-top: 44px; counter-increment: ws; }
.workshop-grid li::before { content: counter(ws, decimal-leading-zero); position: absolute; top: 18px; left: 24px; font: 600 .8rem var(--font-mono); color: var(--accent); }
.workshop-grid h3 { font-size: 1.05rem; margin-bottom: 8px; }
.workshop-grid p { color: var(--muted); font-size: .94rem; margin: 0; }
@media (max-width: 1000px) { .workshop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .workshop-grid { grid-template-columns: 1fr; } }

/* skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skill-group ul li:last-child { border-bottom: 0; }
.skill-group ul li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .93rem; }
.lvl { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.lvl small { font-size: .68rem; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }
.meter { display: inline-flex; gap: 3px; }
.meter i { width: 14px; height: 6px; border-radius: 3px; background: var(--border); }
.meter i.on { background: var(--grad); background-size: 400% 100%; }
.meter i.on:nth-child(1) { background: var(--accent); }
.meter i.on:nth-child(2) { background: color-mix(in srgb, var(--accent) 66%, var(--accent-2)); }
.meter i.on:nth-child(3) { background: color-mix(in srgb, var(--accent) 33%, var(--accent-2)); }
.meter i.on:nth-child(4) { background: var(--accent-2); }
.edu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.plain > div { margin-bottom: 12px; }
.plain dt { font-weight: 800; color: var(--text-strong); }
.plain dd { margin: 2px 0 0; color: var(--muted); font-size: .94rem; }
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .edu-grid { grid-template-columns: 1fr; } }

/* interests */
.interest-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.interest-grid li { padding: 20px 0 0; border-top: 2px solid var(--accent-2); }
.interest-grid h3 { margin-bottom: 8px; font-size: 1.05rem; }
.interest-grid p { color: var(--muted); font-size: .94rem; margin: 0; }
@media (max-width: 1000px) { .interest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .interest-grid { grid-template-columns: 1fr; } }

/* contact */
.contact { text-align: center; position: relative; overflow: hidden; }
.contact::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 60% at 50% 100%, var(--violet-soft), transparent 70%); }
.contact-inner { max-width: 820px; }
.contact h2 { font-size: clamp(2.2rem, 1.4rem + 3.5vw, 4rem); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 1rem; }
.contact-text { font-size: 1.12rem; color: var(--text); margin: 0 auto 28px; max-width: 40em; }
.contact-direct { margin: 28px 0 8px; font-family: var(--font-display); font-size: clamp(1.1rem, .9rem + 1vw, 1.6rem); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.contact-direct a { text-decoration: none; overflow-wrap: anywhere; }
.location { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 36px; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--muted); }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgba(5, 6, 10, .92); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lightbox figcaption { color: #d8dbe4; margin-top: 14px; text-align: center; font-size: .95rem; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(20, 22, 30, .8); color: #fff; cursor: pointer; }
.lb-btn:hover { border-color: #f5b83d; color: #f5b83d; }
.lb-btn .icon { width: 22px; height: 22px; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox figure { padding: 60px 10px 20px; } .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; } }

/* ---------- animated section backgrounds (assets/js/backgrounds.js) ---------- */
.has-bg { position: relative; isolation: isolate; }
.section-bg {
  position: absolute; inset: 0; z-index: -1;
  overflow: clip;              /* not "hidden": keeps the sticky canvas working */
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 140px, #000 calc(100% - 140px), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 140px, #000 calc(100% - 140px), transparent);
}
.section-bg--section {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 60px, #000 calc(100% - 50px), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 60px, #000 calc(100% - 50px), transparent);
}
.section-bg canvas { display: block; width: 100%; }
.section-bg canvas[data-mode="sticky"] { position: sticky; top: 0; }
.section-bg canvas[data-mode="section"] { height: 100%; }
/* drafting grid under the blueprint sketches */
.section-bg canvas[data-bg="blueprint"] {
  --g-minor: color-mix(in srgb, var(--text-strong) 3.5%, transparent);
  --g-major: color-mix(in srgb, var(--text-strong) 7%, transparent);
  background-image:
    linear-gradient(to right, var(--g-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--g-major) 1px, transparent 1px),
    linear-gradient(to right, var(--g-minor) 1px, transparent 1px),
    linear-gradient(to bottom, var(--g-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
[data-theme="light"] .section-bg canvas[data-bg="blueprint"] {
  --g-minor: color-mix(in srgb, var(--text-strong) 5%, transparent);
  --g-major: color-mix(in srgb, var(--text-strong) 9%, transparent);
}
/* cards let the animation shine through a little */
.has-bg .card { background-color: color-mix(in srgb, var(--surface) 86%, transparent); }
.has-bg:has(canvas[data-bg="blueprint"]) .card { background-color: color-mix(in srgb, var(--surface) 68%, transparent); }
.contact.has-bg { padding-bottom: clamp(140px, 14vw, 200px); }
.has-bg .feature-uv { background: radial-gradient(70% 90% at 0% 100%, var(--violet-soft), transparent 70%), color-mix(in srgb, var(--surface) 84%, transparent); }

/* aurora: three soft blobs drifting in brand colours (CSS only) */
.bg-aurora i { position: absolute; border-radius: 50%; will-change: transform; }
.bg-aurora i:nth-child(1) { width: 60vmax; height: 60vmax; top: -25vmax; right: -18vmax; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent), transparent 62%); animation: aurora-1 26s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(2) { width: 55vmax; height: 55vmax; bottom: -22vmax; left: -20vmax; background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 38%, transparent), transparent 62%); animation: aurora-2 32s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(3) { width: 36vmax; height: 36vmax; top: 30%; left: 38%; background: radial-gradient(circle, color-mix(in srgb, #f08a5d 18%, transparent), transparent 65%); animation: aurora-3 22s ease-in-out infinite alternate; }
[data-theme="light"] .bg-aurora { opacity: .7; }
@keyframes aurora-1 { to { transform: translate(-14vw, 12vh) scale(1.18); } }
@keyframes aurora-2 { to { transform: translate(16vw, -10vh) scale(1.1); } }
@keyframes aurora-3 { 0% { transform: translate(0, 0) scale(.9); } 50% { transform: translate(-10vw, -8vh) scale(1.15); } 100% { transform: translate(8vw, 6vh) scale(1); } }

/* current flowing down the experience timeline */
.timeline::after {
  content: ''; position: absolute; left: 187px; top: 10px; bottom: 36px; width: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent) 45%, #fff3 50%, var(--accent-2) 55%, transparent) no-repeat;
  background-size: 100% 220px;
  animation: current 7s cubic-bezier(.45, 0, .55, 1) infinite;
  filter: drop-shadow(0 0 6px var(--accent));
  pointer-events: none;
}
.tl-item::after { z-index: 1; }
@keyframes current { from { background-position: 0 -220px; } to { background-position: 0 calc(100% + 220px); } }
@media (max-width: 720px) { .timeline::after { left: 5px; } }

/* reveal on scroll (enabled by JS) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .timeline::after { display: none; }
}

@media print {
  .site-header, .hero-canvas, .lightbox, .cta-row, .skip { display: none !important; }
  body { background: #fff; color: #000; }
}
