/* =====================================================================
   Avi Kahana — Personal Portfolio
   Modern dark design system (rebuilt 2026). Brand: #151515 + #00a0cc.
   ===================================================================== */

/* ---------- Design tokens ----------
   Dark is the default theme; the light theme overrides these in the
   :root[data-theme="light"] block further down. Anything that needs to flip
   between themes MUST be a token here (no hardcoded colors in rules below). */
:root {
  --bg: #151515;
  --bg-alt: #181818;
  --surface: #1c1c1c;
  --surface-2: #222222;
  --border: #2c2c2c;
  --border-soft: #262626;
  --accent: #00a0cc;
  --accent-hover: #2bbbe6;
  --accent-soft: rgba(0, 160, 204, 0.12);
  /* Cyan used to FILL buttons/launcher — decoupled from --accent (which also
     colors small text/links) so light mode can keep text dark + contrasty while
     button fills stay bright. */
  --accent-fill: #00a0cc;
  --accent-fill-hover: #2bbbe6;
  --text: #ffffff;
  --text-strong: #ffffff;   /* pure-white content text (was #fff literals) */
  --text-soft: #e9e9e9;     /* slightly-dimmed leads/quotes (was #efefef/#ececec) */
  --muted: #9a9a9a;
  --muted-2: #777777;

  /* Surfaces layered over the fixed sky (translucent so the sky shows through) */
  --section-bg: rgba(14, 14, 16, 0.62);
  --section-alt-bg: rgba(19, 19, 22, 0.74);
  --nav-scrolled-bg: rgba(18, 18, 18, 0.86);
  --nav-drawer-bg: rgba(16, 16, 16, 0.98);
  --footer-bg: rgba(19, 19, 22, 0.8);
  --nav-link: rgba(255, 255, 255, 0.82);
  --social-border: rgba(255, 255, 255, 0.22);
  --field-text: #ffffff;
  --backdrop: rgba(0, 0, 0, 0.72);

  /* Buttons */
  --btn-primary-text: #06222b;
  --btn-ghost-bg: transparent;
  --btn-ghost-bg-hover: transparent;
  --btn-ghost-border: rgba(255, 255, 255, 0.28);

  /* Contact form status banners */
  --warn-bg: rgba(204, 60, 60, 0.12);
  --warn-border: rgba(204, 60, 60, 0.40);
  --warn-text: #ff9a9a;
  --ok-bg: var(--accent-soft);
  --ok-border: rgba(0, 160, 204, 0.40);
  --ok-text: var(--accent);

  /* The fixed full-bleed sky behind everything (body::before) */
  --sky-base: #0c0c0c;
  --sky-image: url("../images/intro-bg.jpg");
  /* Hero readability veil over the sky — two stacked gradients */
  --hero-overlay:
    linear-gradient(90deg, rgba(8,8,11,0.55) 0%, rgba(8,8,11,0.18) 45%, rgba(8,8,11,0) 70%),
    linear-gradient(180deg, rgba(10,10,12,0.20) 0%, rgba(12,12,14,0.05) 35%, rgba(14,14,16,0.62) 100%);

  --font-body: "lora-regular", Georgia, serif;
  --font-head: "poppins-bold", "Helvetica Neue", Arial, sans-serif;
  --font-bold: "poppins-bold", "Helvetica Neue", Arial, sans-serif;
  --font-semi: "poppins-semibold", "Helvetica Neue", Arial, sans-serif;
  --font-med: "poppins-medium", "Helvetica Neue", Arial, sans-serif;
  --font-reg: "poppins-regular", "Helvetica Neue", Arial, sans-serif;

  --container: 1140px;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Light theme ----------
   Only color/surface tokens flip. The accent is darkened slightly so cyan text
   keeps enough contrast on white, while button fills use the brighter
   --accent-fill. The fixed night sky is swapped for the daytime sky photo. */
:root[data-theme="light"] {
  --bg: #eef2f7;
  --bg-alt: #e7ecf3;
  --surface: #ffffff;
  --surface-2: #f1f5fa;
  --border: #d9e0ea;
  --border-soft: #e6ebf2;
  --accent: #0a7fa3;
  --accent-hover: #0894c0;
  --accent-soft: rgba(10, 127, 163, 0.14);
  /* Brighter cyan for button/launcher fills (the darker --accent stays for text) */
  --accent-fill: #16acd8;
  --accent-fill-hover: #34bfe8;
  /* Higher-contrast text so it reads crisply over the photo / light panels */
  --text: #0b111b;
  --text-strong: #04070d;
  --text-soft: #161d28;
  --muted: #3c4654;
  --muted-2: #5e6878;

  /* Slightly more opaque panels = more contrast behind body text */
  --section-bg: rgba(248, 250, 253, 0.82);
  --section-alt-bg: rgba(237, 242, 248, 0.88);
  --nav-scrolled-bg: rgba(255, 255, 255, 0.85);
  --nav-drawer-bg: rgba(255, 255, 255, 0.98);
  --footer-bg: rgba(236, 241, 247, 0.85);
  --nav-link: rgba(22, 30, 42, 0.82);
  --social-border: rgba(20, 30, 44, 0.34);
  --field-text: #1b212b;
  --backdrop: rgba(30, 40, 54, 0.45);

  --shadow: 0 18px 40px -22px rgba(40, 60, 90, 0.45);

  /* Buttons: visible dark borders + a light fill so they read on the bright page */
  --btn-primary-text: #04222b;
  --btn-ghost-bg: rgba(255, 255, 255, 0.72);
  --btn-ghost-bg-hover: rgba(255, 255, 255, 0.95);
  --btn-ghost-border: rgba(20, 30, 44, 0.40);

  /* Status banners: darker text + stronger borders so they read on light */
  --warn-bg: rgba(200, 45, 45, 0.10);
  --warn-border: rgba(190, 45, 45, 0.55);
  --warn-text: #b3231b;
  --ok-bg: rgba(10, 127, 163, 0.10);
  --ok-border: rgba(10, 127, 163, 0.55);
  --ok-text: #0a6d8e;

  /* Light background: the daytime sky photo (the hillside gazer) — daylight
     counterpart to the night-sky hero. --sky-base matches the photo's blue so it
     blends before the image loads. */
  --sky-base: #6fa6d8;
  --sky-image: url("../images/intro-bg-day.jpg");
  --hero-overlay:
    linear-gradient(90deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.16) 45%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(247,250,253,0.10) 0%, rgba(247,250,253,0.05) 35%, rgba(247,250,253,0.72) 100%);
}

/* Smooth the swap between themes on the big structural surfaces. (Cards keep
   their own hover transitions; this only animates the theme color change.)
   The reduced-motion query at the bottom zeroes this out. */
body,
body::before,
.section,
.footer,
.nav__links,
.field input,
.field textarea,
.theme-toggle {
  transition: background-color 0.45s var(--ease), background-image 0.45s var(--ease),
    color 0.45s var(--ease), border-color 0.45s var(--ease);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; background: #0c0c0c; }
body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Fixed night-sky backdrop — stays put behind all content while scrolling.
   Uses a fixed pseudo-element (not background-attachment:fixed) so it also
   works smoothly on iOS. Content sections sit above it and are translucent. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background-color: var(--sky-base);
  background-image: var(--sky-image);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hover); }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, h5 { font-family: var(--font-head); color: var(--text); line-height: 1.2; margin: 0 0 0.6em; font-weight: normal; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }
/* Translucent so the fixed night sky shows through while scrolling.
   Alternating opacity keeps a subtle rhythm; cards/inputs stay solid for
   readability. -webkit-backdrop-filter softens the stars behind dense text. */
.section {
  padding: clamp(64px, 9vw, 120px) 0; position: relative;
  background: var(--section-bg);
  -webkit-backdrop-filter: blur(2.5px); backdrop-filter: blur(2.5px);
}
.section--alt { background: var(--section-alt-bg); }

.section-head { max-width: 720px; margin: 0 0 clamp(36px, 5vw, 60px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  font-family: var(--font-semi);
  font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); display: inline-block; margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(28px, 4.4vw, 42px); margin-bottom: 16px; }
.section-head p { color: var(--muted); margin: 0; font-size: 17px; }
.section-head .bar { width: 54px; height: 3px; background: var(--accent); border-radius: 3px; margin-top: 22px; }
.section-head.center .bar { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-semi); font-size: 14px; letter-spacing: 0.04em;
  padding: 14px 28px; border-radius: 40px; cursor: pointer;
  border: 1.5px solid transparent; transition: all 0.25s var(--ease); white-space: nowrap;
}
.btn--primary { background: var(--accent-fill); color: var(--btn-primary-text); }
.btn--primary:hover { background: var(--accent-fill-hover); color: var(--btn-primary-text); transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(0,160,204,0.6); }
.btn--ghost { background: var(--btn-ghost-bg); color: var(--text); border-color: var(--btn-ghost-border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--btn-ghost-bg-hover); transform: translateY(-2px); }
.btn--sm { padding: 10px 20px; font-size: 13px; }
.btn__bot { width: 19px; height: 19px; flex: none; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center;
  background: transparent; transition: background 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-scrolled-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 30px -20px rgba(0,0,0,0.9);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav__home {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 40px; color: var(--text-strong); font-size: 18px;
  background: linear-gradient(145deg, rgba(0,160,204,0.22), rgba(255,255,255,0.03));
  border: 1px solid rgba(0,160,204,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 6px 16px -9px rgba(0,160,204,0.55);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s, background 0.3s,
    width 0.35s var(--ease), height 0.35s var(--ease), border-radius 0.35s var(--ease), font-size 0.35s var(--ease);
}
/* soft outer ring that lights up on hover */
.nav__home::after {
  content: ""; position: absolute; inset: -4px; border-radius: 44px;
  border: 1px solid transparent; transition: border-color 0.3s var(--ease);
}
.nav__home i { color: var(--accent); transition: transform 0.3s var(--ease); }
.nav__home:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(0,160,204,0.34), rgba(0,160,204,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 12px 26px -10px rgba(0,160,204,0.8);
}
.nav__home:hover::after { border-color: rgba(0,160,204,0.35); }
.nav__home:hover i { transform: scale(1.12); }
.nav__home:active { transform: translateY(0); }
/* Grows into a prominent back-to-top affordance once the user scrolls down —
   mirrors the appearance threshold of the old floating arrow (toggled in main.js). */
.nav__home.grow { width: 56px; height: 56px; border-radius: 40px; font-size: 24px; }
.nav__home.grow::after { border-radius: 44px; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a:not(.btn) {
  font-family: var(--font-med); font-size: 14px; letter-spacing: 0.03em;
  color: var(--nav-link); position: relative; padding: 6px 0;
}
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.nav__links a:not(.btn):hover { color: var(--text-strong); }
.nav__links a:not(.btn):hover::after, .nav__links a.active::after { width: 100%; }
.nav__toggle {
  display: none; background: none; border: 0; color: var(--text-strong); font-size: 22px;
  cursor: pointer; padding: 6px; line-height: 1;
}

/* ---------- Theme toggle (light-bulb) ----------
   One glyph (FA4 has no solid bulb); on/off is conveyed by a warm glow when lit
   vs a dimmed outline when off. aria-pressed reflects light-mode = on. */
.nav__right { display: flex; align-items: center; gap: 22px; }
.theme-toggle {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; cursor: pointer; padding: 0;
  background: transparent; border: 1px solid var(--social-border);
  color: var(--muted); font-size: 18px; line-height: 1;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle i { transition: transform 0.3s var(--ease); }
/* Lit state = light mode is active. Border/icon use a deeper amber and a faint
   drop shadow so the button stays defined even when the nav turns near-white on
   scroll (the warm glow alone vanishes on white). */
:root[data-theme="light"] .theme-toggle {
  color: #e08c0a; border-color: rgba(216,142,18,0.85);
  background: rgba(255,201,82,0.22);
  box-shadow: 0 0 0 3px rgba(255,201,82,0.20), 0 0 16px -3px rgba(255,170,40,0.7),
    0 2px 7px rgba(120,80,10,0.20);
}
:root[data-theme="light"] .theme-toggle i {
  text-shadow: 0 0 9px rgba(255,180,50,0.8), 0 0 20px rgba(255,180,50,0.45);
}
:root[data-theme="light"] .theme-toggle:hover { color: #c97a00; border-color: rgba(201,122,0,0.95); transform: translateY(-2px); }

/* Light mode: make the home button read on the bright sky — white-ish fill,
   solid accent border + ring, and a bolder accent icon. */
:root[data-theme="light"] .nav__home {
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 16px -9px rgba(10,127,163,0.55);
}
:root[data-theme="light"] .nav__home::after { border-color: rgba(10,127,163,0.30); }
:root[data-theme="light"] .nav__home i { color: var(--accent); }
:root[data-theme="light"] .nav__home:hover {
  background: linear-gradient(145deg, #ffffff, rgba(255,255,255,0.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 12px 26px -10px rgba(10,127,163,0.8);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  background: transparent; /* shows the shared fixed night sky (body::before) */
}
/* Light overlay: keeps the kid + Milky Way prominent, just enough contrast for
   the headline, and a soft fade at the very bottom into the first section. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--hero-overlay);
}
.hero__inner { position: relative; z-index: 2; padding: 120px 0 90px; max-width: 860px; }
.hero__hi { font-family: var(--font-semi); color: var(--accent); letter-spacing: 0.16em; text-transform: uppercase; font-size: 14px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(44px, 8vw, 92px); letter-spacing: -0.02em; margin: 0 0 14px; line-height: 1.02; }
.hero__role { font-family: var(--font-semi); font-size: clamp(19px, 3vw, 30px); color: var(--text-soft); margin: 0 0 22px; }
.hero__role .accent { color: var(--accent); }
.hero__tags { font-family: var(--font-reg); color: var(--muted); font-size: clamp(15px, 2vw, 18px); line-height: 1.7; margin: 0 0 38px; max-width: 640px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.hero__social { display: flex; gap: 14px; margin-left: 6px; }
.hero__social a {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--social-border); color: var(--text-strong); font-size: 18px;
  transition: all 0.25s var(--ease);
}
.hero__social a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.hero__scroll {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 2;
  color: var(--muted); font-size: 22px; animation: bob 2s infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 10px); } }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(36px, 6vw, 72px); align-items: start; }
.about__photo { position: relative; }
.about__photo img { border-radius: 20px; border: 1px solid var(--border); width: 100%; }
.about__photo::after {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--accent);
  border-radius: 20px; z-index: -1; opacity: 0.5;
}
.about__lead { font-size: 20px; color: var(--text-soft); line-height: 1.7; margin: 0 0 18px; }
.about__body p { color: var(--muted); margin: 0 0 16px; }
.about__themes { display: grid; gap: 14px; margin: 26px 0 30px; }
.about__theme { display: flex; gap: 14px; align-items: flex-start; }
.about__theme i { color: var(--accent); font-size: 18px; margin-top: 4px; flex: none; width: 22px; text-align: center; }
.about__theme b { font-family: var(--font-semi); color: var(--text-strong); font-weight: normal; }
.about__theme span { color: var(--muted); }
.about__quote {
  margin: 0 0 30px; padding: 18px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-body); font-style: italic; font-size: 17px; line-height: 1.7; color: var(--text-soft);
}
.stats { display: flex; flex-wrap: wrap; gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 22px; min-width: 120px;
}
.stat b { display: block; font-family: var(--font-bold); color: var(--accent); font-size: 26px; line-height: 1; }
.stat span { font-family: var(--font-reg); color: var(--muted); font-size: 13px; letter-spacing: 0.02em; }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; max-width: 880px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--border) 80%); }
.tl { position: relative; padding: 0 0 38px 44px; }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl__date { font-family: var(--font-semi); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.tl__role { font-family: var(--font-semi); font-size: 19px; color: var(--text-strong); margin: 0; }
.tl__org { font-family: var(--font-med); color: var(--muted); font-size: 15px; margin: 2px 0 12px; }
.tl__org .stealth { color: var(--muted-2); font-style: italic; }
.tl ul { display: grid; gap: 7px; }
.tl li { position: relative; padding-left: 18px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.tl li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.7; }
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 34px; }
.edu__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px 22px; }
.edu__item i { color: var(--accent); margin-right: 8px; }
.edu__item b { font-family: var(--font-semi); font-weight: normal; color: var(--text-strong); display: block; font-size: 16px; }
.edu__item span { color: var(--muted); font-size: 14px; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.skill {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.skill:hover { transform: translateY(-5px); border-color: rgba(0,160,204,0.5); background: var(--surface-2); }
.skill__icon {
  width: 50px; height: 50px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 16px;
}
.skill h3 { font-family: var(--font-semi); font-size: 17px; margin: 0 0 8px; }
.skill__desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.skill__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill__tags span {
  font-family: var(--font-reg); font-size: 12.5px; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 5px 11px;
}

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.proj-group, .skill-group { margin-bottom: clamp(34px, 4.5vw, 56px); }
.proj-group:last-child, .skill-group:last-child { margin-bottom: 0; }
.proj-group__title, .skill-group__title {
  font-family: var(--font-med); font-size: 13px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
  margin: 0 0 20px; display: flex; align-items: center; gap: 16px;
}
.proj-group__title::after, .skill-group__title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.proj {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.proj:hover { transform: translateY(-6px); border-color: rgba(0,160,204,0.5); box-shadow: var(--shadow); }
.proj__icon { font-size: 30px; color: var(--accent); margin-bottom: 18px; }
.proj h3 { font-family: var(--font-semi); font-size: 19px; margin: 0 0 8px; }
.proj__meta { font-family: var(--font-med); color: var(--muted-2); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 14px; }
.proj p { color: var(--muted); font-size: 15.5px; margin: 0 0 18px; }
.proj__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.proj__tags span { font-family: var(--font-reg); font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 4px 10px; }
.proj__link { font-family: var(--font-semi); font-size: 13.5px; margin-top: 16px; display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Avi'sBot ---------- */
.avibot__intro { max-width: 760px; color: var(--muted); font-size: 17px; line-height: 1.75; margin: 0 0 clamp(32px, 4vw, 48px); }
.avibot__intro b { font-family: var(--font-semi); color: var(--text-strong); font-weight: normal; }
.avibot__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.avibot__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 26px; transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.avibot__card:hover { transform: translateY(-5px); border-color: rgba(0,160,204,0.5); background: var(--surface-2); }
.avibot__icon {
  width: 50px; height: 50px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 16px;
}
.avibot__card h3 { font-family: var(--font-semi); font-size: 17px; margin: 0 0 10px; }
.avibot__card p { color: var(--muted); font-size: 15.5px; line-height: 1.7; margin: 0; }
.avibot__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: clamp(30px, 4vw, 44px); }
.avibot__hint { color: var(--muted-2); font-family: var(--font-reg); font-size: 14px; }

/* ---------- Contact ---------- */
.contact__book {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 18px; text-align: center; margin: 0 0 clamp(28px, 4vw, 40px);
}
.contact__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 5vw, 56px); align-items: start; }
.field { margin-bottom: 18px; }
.field input, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--field-text); font-family: var(--font-reg); font-size: 15px; padding: 15px 18px; transition: border-color 0.2s, background 0.2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
#message-warning, #message-success { display: none; border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 16px; font-family: var(--font-reg); font-size: 14px; }
#message-warning { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
#message-success { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-text); }
#message-success i { margin-right: 8px; }
.contact__cards { display: grid; gap: 16px; }
.cinfo {
  display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; transition: transform 0.25s var(--ease), border-color 0.25s;
}
.cinfo:hover { transform: translateX(4px); border-color: rgba(0,160,204,0.5); }
.cinfo i { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; flex: none; }
.cinfo b { font-family: var(--font-semi); font-weight: normal; color: var(--text-strong); display: block; font-size: 15px; }
.cinfo span, .cinfo a { color: var(--muted); font-size: 14px; }
.cinfo a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; background: var(--footer-bg); }
.footer .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__copy { color: var(--muted-2); font-size: 14px; font-family: var(--font-reg); }
.footer__social { display: flex; gap: 12px; }
.footer__social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); color: var(--muted); font-size: 16px; transition: all 0.25s var(--ease); }
.footer__social a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Scroll reveal ----------
   Content is visible by default. JS adds .will-reveal ONLY to elements that are
   below the fold at init, so anything already on screen is never hidden — the
   page can never render blank even if the observer never fires. */
.reveal.will-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.will-reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ---------- Mobile nav drawer ---------- */
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 0; align-items: stretch;
    background: var(--nav-drawer-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: 12px 28px 24px;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: all 0.25s var(--ease);
  }
  .nav__links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
  .nav__links a:not(.btn)::after { display: none; }
  .nav__links .btn { margin-top: 16px; justify-content: center; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 260px; }
  .about__photo::after { inset: 12px -12px -12px 12px; }
  .contact__grid { grid-template-columns: 1fr; }
  .hero { background-attachment: scroll; }
  .hero__social { margin-left: 0; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .hero__cta { gap: 12px; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .hero__social { width: 100%; justify-content: flex-start; }
  .stat { flex: 1; min-width: 90px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero { background-attachment: scroll; }
}

/* ---------- Honeypot (anti-bot) ---------- */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Verify-email popup ---------- */
.vp {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.vp.is-open { display: flex; }
.vp__backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
.vp__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px 36px;
  text-align: center;
  animation: vpIn 0.35s var(--ease);
}
@keyframes vpIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.vp__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.vp__close:hover { color: var(--accent); }
.vp__card h3 {
  font-family: var(--font-bold);
  color: var(--text);
  margin: 18px 0 10px;
  font-size: 22px;
}
.vp__card p {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 12px;
  line-height: 1.6;
}
.vp__card p strong { color: var(--accent); }
.vp__hint { font-size: 13px; color: var(--muted-2); }
.vp__icon { font-size: 38px; color: var(--accent); }

/* spinner */
.vp__spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vpSpin 0.9s linear infinite;
}
@keyframes vpSpin { to { transform: rotate(360deg); } }

/* pane visibility driven by [data-state] on #verifyPopup */
.vp__pane { display: none; }
.vp[data-state="pending"] .vp__pane--pending { display: block; }
.vp[data-state="expired"] .vp__pane--expired { display: block; }
.vp__pane--expired .btn { margin-top: 10px; }
