:root {
  --bg: #faf7f2;
  --bg-alt: #f1ebe2;
  --surface: #ffffff;
  --text: #1d1a16;
  --muted: #6b6358;
  --line: #e4dccf;
  --accent: #c8742f;       /* roasted coffee */
  --accent-ink: #ffffff;
  --accent-soft: #f6e6d6;
  --green: #1f6b4a;        /* coffee leaf */
  --shadow: 0 10px 30px rgba(40, 28, 15, .08);
  --radius: 18px;
  --maxw: 1160px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110e; --bg-alt: #1b1713; --surface: #221d18; --text: #f3ede4; --muted: #a99d8e;
    --line: #342c24; --accent: #e08c45; --accent-ink: #1a120a; --accent-soft: #3a2a1c; --green: #4fb386;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #14110e; --bg-alt: #1b1713; --surface: #221d18; --text: #f3ede4; --muted: #a99d8e;
  --line: #342c24; --accent: #e08c45; --accent-ink: #1a120a; --accent-soft: #3a2a1c; --green: #4fb386;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
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; overflow-x: hidden; overflow-x: clip;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section.container { padding-left: 24px; padding-right: 24px; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.sub { color: var(--muted); }
.eyebrow {
  font-family: var(--font-head); font-weight: 600; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .8em;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em; padding: .85em 1.5em; border-radius: 999px;
  font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer;
  font: 600 1rem var(--font-body); transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 14px 24px; transition: background .3s, box-shadow .3s;
}
.nav.scrolled { background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.nav:not(.scrolled) { color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .9rem; }
.nav nav { margin-left: auto; }
.nav-links { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; align-items: center; }
.nav-links a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; transition: background .2s; }
.nav-links a:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.nav-links .nav-cta { background: var(--accent); color: var(--accent-ink); }
.nav-links .nav-cta:hover { background: var(--accent); filter: brightness(1.08); }
.theme-toggle, .nav-toggle {
  background: none; border: 1px solid rgba(128,128,128,.45); border-color: color-mix(in srgb, currentColor 30%, transparent); color: inherit;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.nav-toggle { display: none; gap: 5px; align-content: center; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s; }

/* Hero */
.hero { position: relative; }
.cover { position: relative; height: min(78vh, 720px); min-height: 420px; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transform: scale(1.04); animation: coverIn 1.6s ease-out forwards; }
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,8,6,.55) 0%, rgba(10,8,6,.05) 28%, rgba(10,8,6,0) 45%, var(--bg) 92%);
}
@keyframes coverIn { to { transform: scale(1); } }
.hero-body { position: relative; margin-top: -120px; display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: end; z-index: 2; }
.avatar {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 6px solid var(--bg); box-shadow: var(--shadow); background: var(--surface);
}
.hero-text h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: .25em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.hero-role { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-weight: 600; margin: -.2em 0 0; }
.hero-role span { font: 600 .72rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--green); background: rgba(31,107,74,.12); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 4px 10px; border-radius: 999px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.5em; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 70px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stats strong { display: block; font-family: var(--font-head); font-size: 1.5rem; line-height: 1.2; color: var(--accent); }
.stats span { color: var(--muted); font-size: .92rem; line-height: 1.4; display: block; margin-top: 4px; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.about-media { position: relative; aspect-ratio: 4/5; }
.about-media img { position: absolute; border-radius: var(--radius); object-fit: cover; box-shadow: var(--shadow); }
.about-media img:first-child { width: 72%; height: 82%; top: 0; left: 0; }
.about-media img:last-child { width: 52%; height: 58%; right: 0; bottom: 0; border: 6px solid var(--bg); }
.about-text p { color: var(--muted); }
.about-text strong { color: var(--text); }

/* Cards */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px;
  transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card p { color: var(--muted); }
.card-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.card-icon svg { width: 28px; height: 28px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .8rem; font-weight: 500; padding: 4px 12px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); }

/* How I work on site */
.ethic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ethic { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 24px; }
.ethic h3 { margin: 8px 0 10px; }
.ethic p { color: var(--muted); margin: 0; font-size: .96rem; }
#integrity .section-head { max-width: 760px; }
#integrity .sub { font-size: 1.08rem; }

/* Engineering competencies */
.competencies { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.competencies > h3 { margin-bottom: 20px; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.comp-grid > div { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; border-top: 3px solid var(--accent); }
.comp-grid h4 { font-family: var(--font-head); font-size: 1rem; margin: 0 0 6px; }
.comp-grid p { color: var(--muted); font-size: .92rem; line-height: 1.6; margin: 0; }
@media (max-width: 760px) { .competencies { padding: 20px; } }

/* Projects */
.projects { display: grid; gap: 40px; }
.project {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px;
}
.project-flip .project-visual { order: 2; }
.project-text p { color: var(--muted); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green); background: rgba(31,107,74,.12); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.link-arrow { display: inline-block; margin-top: 18px; font-weight: 600; color: var(--accent); text-decoration: none; }
.link-arrow span { display: inline-block; transition: transform .2s; }
.link-arrow:hover span { transform: translateX(4px); }

.project-visual { border-radius: 18px; padding: 36px; aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; }
.visual-app { background: linear-gradient(135deg, #3b2414, #7a4a26 60%, #c8742f); }
.visual-web { background: linear-gradient(135deg, #0f3d2b, #1f6b4a 60%, #7fb069); }
.app-icon { margin: 0; display: grid; justify-items: center; gap: 18px; }
.app-icon img { width: min(220px, 60%); aspect-ratio: 1; object-fit: cover; border-radius: 28%; box-shadow: 0 20px 50px rgba(0,0,0,.4); transition: transform .5s; }
.project:hover .app-icon img { transform: translateY(-6px) scale(1.03); }
.app-icon figcaption { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; letter-spacing: .04em; color: #fff; }
.phone { display: block; width: min(230px, 58%); height: 100%; border: 8px solid #111; border-radius: 30px; overflow: hidden; background: #111; box-shadow: 0 20px 50px rgba(0,0,0,.4); transform: translateY(14%) rotate(-3deg); transition: transform .5s; }
.phone img { display: block; width: 100%; }
.project:hover .phone { transform: translateY(4%); }
@media (prefers-reduced-motion: reduce) { .app-icon img, .phone { transition: none; } }

/* App feature breakdown */
.features { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 36px; }
.features-title { margin-bottom: 24px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; transition: border-color .2s, transform .2s; }
.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature h4 { font-family: var(--font-head); font-size: 1.08rem; margin: 6px 0 8px; }
.feature p { color: var(--muted); font-size: .93rem; line-height: 1.6; margin: 0; }
.f-num { font-family: var(--font-head); font-weight: 700; font-size: .85rem; color: var(--accent); }
@media (max-width: 760px) { .features { padding: 20px; } }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  font: 500 .92rem var(--font-body); padding: 8px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); transition: all .2s;
}
.filters button.active, .filters button:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 260px; grid-auto-flow: dense; gap: 14px; }
.gallery figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--line); }
.gallery figure.wide { grid-column: span 2; }
.gallery figure.hide { display: none; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px; color: #fff; font-size: .88rem; font-weight: 500;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); opacity: 0; transform: translateY(8px); transition: all .3s;
}
.gallery figure:hover figcaption, .gallery figure:focus-visible figcaption { opacity: 1; transform: none; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--line); max-width: 760px; }
.timeline > li { position: relative; padding: 0 0 36px 24px; }
.timeline > li::before {
  content: ""; position: absolute; left: -37px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.t-date { font-family: var(--font-head); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.timeline h3 { margin: 4px 0 6px; }
.timeline p { color: var(--muted); margin: 0; }
.timeline .t-org { color: var(--text); font-weight: 500; font-size: .95rem; margin-bottom: 6px; }
.timeline ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: .95rem; }
.timeline ul li { margin-bottom: 4px; padding: 0; }
.timeline ul li::marker { color: var(--accent); }
.timeline .t-note { margin-top: 8px; font-style: italic; font-size: .93rem; color: var(--muted); border-left: 2px solid var(--accent-soft); padding: 0 4px 0 10px; }
#integrity .sub + .sub { margin-top: -.2em; }
.exp-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.exp-grid .timeline { max-width: none; }
.exp-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.side-card h3 { font-size: 1.05rem; margin-bottom: 12px; }
.side-card dl { margin: 0; display: grid; gap: 4px; }
.side-card dt { font-weight: 600; }
.side-card dd { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
@media (max-width: 960px) { .exp-grid { grid-template-columns: 1fr; } .exp-side { position: static; } }

/* Vision */
.vision {
  padding: 120px 0; color: #fff; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(rgba(20,14,8,.78), rgba(20,14,8,.85)), url("assets/img/build-slab.webp") center/cover fixed;
}
.js .vision:not(.bg-in) { background-image: linear-gradient(#2a1d12, #1a120a); }
.vision blockquote { font-family: var(--font-head); font-size: clamp(1.6rem, 3.8vw, 2.8rem); line-height: 1.25; max-width: 900px; margin: 0 auto 20px; letter-spacing: -.02em; }
.vision blockquote span { color: #f0a868; }
.vision-sub { opacity: .75; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-text > p { color: var(--muted); }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.contact-list a { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 500; }
.contact-list a:hover { color: var(--accent); }
.contact-list svg { width: 22px; height: 22px; color: var(--accent); }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.contact-form label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
.contact-form input, .contact-form textarea {
  font: 400 1rem var(--font-body); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form-note { font-size: .82rem; color: var(--muted); margin: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,6,4,.94); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 12px; min-width: 0; }
.lightbox img { width: min(100%, 1200px); height: auto; max-height: 82vh; border-radius: 10px; object-fit: contain; }
.lightbox figcaption { color: #ddd; }
.lightbox button { background: rgba(255,255,255,.1); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.2); }
.lb-close { position: absolute; top: 20px; right: 20px; }

/* Floating WhatsApp + chat assistant */
.fab-stack { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; justify-items: end; gap: 12px; }
.fab {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .2s;
}
.fab:hover { transform: scale(1.07); }
.fab svg { width: 28px; height: 28px; }
.fab-wa { background: #25d366; color: #fff; }
.fab-bot { background: var(--accent); color: var(--accent-ink); }
.fab-bot.open { background: var(--text); color: var(--bg); }
.bot-panel {
  width: min(370px, calc(100vw - 32px)); height: min(540px, calc(100vh - 180px)); height: min(540px, calc(100dvh - 180px));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden;
}
.bot-panel[hidden] { display: none; }
.bot-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--accent); color: var(--accent-ink); }
.bot-head strong { display: block; font-family: var(--font-head); line-height: 1.2; }
.bot-head small { opacity: .85; font-size: .8rem; }
.bot-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); font: 700 .85rem var(--font-head); }
.bot-close { margin-left: auto; background: none; border: 0; color: inherit; font-size: 1.7rem; line-height: 1; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.bot-close:hover { background: rgba(255,255,255,.18); }
.bot-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.bot-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.bot-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bot-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bot-msg ul { margin: 6px 0 0; padding-left: 18px; }
.bot-msg a { color: var(--accent); font-weight: 600; }
.bot-msg.typing { display: flex; gap: 4px; }
.bot-msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.bot-msg.typing i:nth-child(2) { animation-delay: .15s; } .bot-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.bot-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-top: 1px solid var(--line); scrollbar-width: thin; }
.bot-chips button {
  flex: none; font: 500 .8rem var(--font-body); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
}
.bot-chips button:hover { border-color: var(--accent); color: var(--accent); }
.bot-form { display: flex; gap: 8px; padding: 10px 12px 12px; }
.bot-form input { flex: 1; min-width: 0; font: 400 16px var(--font-body); padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.bot-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.bot-form button { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }
.bot-form button svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .fab-stack { right: 14px; bottom: 14px; } .fab { width: 52px; height: 52px; } }
@media (prefers-reduced-motion: reduce) { .bot-msg.typing i { animation: none; } }

/* Cookie consent */
.consent {
  position: fixed; left: 20px; bottom: 20px; z-index: 95; width: min(420px, calc(100vw - 40px));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.2); padding: 18px 20px;
}
.consent p { margin: 0 0 14px; font-size: .92rem; line-height: 1.55; }
.consent a { color: var(--accent); font-weight: 600; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
.consent .btn { padding: .6em 1.2em; font-size: .92rem; }
@media (max-width: 760px) {
  .consent { left: 12px; right: 12px; bottom: 12px; width: auto; }
  body.consent-open .fab-stack { bottom: 150px; }
}

/* Policy pages */
.legal { max-width: 760px; padding-top: 120px; padding-bottom: 80px; }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); }
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); }
.legal .updated { font-size: .9rem; }
.legal a { color: var(--accent); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cover img { animation: none; transform: none; }
}

/* Large screens */
@media (min-width: 1600px) {
  :root { --maxw: 1280px; }
  body { font-size: 18px; }
}
/* Short laptop screens */
@media (max-height: 700px) and (min-width: 761px) {
  .cover { height: 64vh; min-height: 380px; }
}
/* Phones in landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .cover { height: 90vh; min-height: 260px; }
  .hero-body { margin-top: -70px; }
  .bot-panel { height: calc(100vh - 100px); height: calc(100dvh - 100px); }
  .fab-stack { gap: 8px; } .fab { width: 46px; height: 46px; }
}
/* Very small phones */
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1; justify-content: center; }
}

/* Print: clean CV-style printout */
@media print {
  .nav, .fab-stack, .lightbox, .filters, .gallery, .contact-form, .skip-link, .vision, .cover, .hero-actions { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .section { padding: 24px 0; }
  .hero-body { margin-top: 0; }
  .exp-side { position: static; }
  a { text-decoration: none; }
}

/* Touch screens: no sticky hover lifts after a tap */
@media (hover: none) {
  .btn:hover, .card:hover, .feature:hover, .fab:hover, .gallery figure:hover img,
  .project:hover .app-icon img { transform: none; }
}

/* Responsive */
@media (min-aspect-ratio: 4/3) { .cover img { object-position: 50% 42%; } }
@media (max-width: 1080px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: fixed; inset: 66px 12px auto 12px; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 12px;
    box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: all .25s;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { display: block; padding: 12px 16px; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav-links { left: auto; width: min(320px, calc(100vw - 24px)); }
}
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .about, .contact, .project { grid-template-columns: 1fr; gap: 36px; }
  .project-flip .project-visual { order: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
  .vision { background-attachment: scroll; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .section { padding: 72px 0; }
  .container, .section.container { padding-left: 16px; padding-right: 16px; }
  .nav { padding: 12px 16px; }
  .brand-name { display: none; }
  .cover { height: min(62vh, 520px); min-height: 360px; }
  .hero-body { grid-template-columns: 1fr; margin-top: -90px; gap: 18px; }
  .avatar { width: 150px; height: 150px; border-width: 5px; }
  .stats { margin-top: 48px; gap: 10px; }
  .stats div { padding: 16px; }
  .stats strong { font-size: 1.2rem; }
  .gallery { grid-auto-rows: 170px; gap: 8px; }
  .gallery figcaption { opacity: 1; transform: none; font-size: .78rem; padding: 20px 10px 8px; }
  .project { padding: 18px; }
  .project-visual { padding: 18px; }
  .card, .contact-form { padding: 24px; }
  .lightbox { grid-template-columns: 1fr; padding: 12px; }
  .lb-prev, .lb-next { position: absolute; bottom: 24px; }
  .lb-prev { left: 24px; } .lb-next { right: 24px; }
}
