/* ===== Design tokens ===== */
:root {
  --bg: #0b1020;
  --bg-alt: #10162b;
  --surface: #151d38;
  --surface-2: #1b2547;
  --text: #e8ecf7;
  --muted: #9aa5c4;
  --brand: #4f7cff;
  --brand-2: #22d3ee;
  --accent: #a855f7;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg: #f6f8ff;
  --bg-alt: #eef1fb;
  --surface: #ffffff;
  --surface-2: #f4f6fd;
  --text: #131a2e;
  --muted: #566085;
  --border: rgba(19, 26, 46, 0.1);
  --shadow: 0 18px 50px -24px rgba(30, 45, 90, 0.35);
}
[data-theme="light"] .field input::placeholder,
[data-theme="light"] .field textarea::placeholder { color: #9aa3c0; }

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
h1, h2, h3 { font-family: "Space Grotesk", "Inter", sans-serif; line-height: 1.15; letter-spacing: -0.02em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

/* ===== Buttons ===== */
.btn {
  --pad: 0.8rem 1.4rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: var(--pad);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 10px 30px -10px rgba(79, 124, 255, 0.7);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(79, 124, 255, 0.85); }
.btn--ghost { color: var(--text); border-color: var(--border); background: rgba(255,255,255,0.03); }
.btn--ghost:hover { border-color: var(--brand); transform: translateY(-2px); }
.btn--block { width: 100%; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 16, 32, 0.65);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.header.is-scrolled { background: rgba(11, 16, 32, 0.9); border-bottom-color: var(--border); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.05rem; }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.brand__accent { color: var(--brand-2); }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav__list { display: flex; gap: 1.75rem; }
.nav__link { color: var(--muted); font-weight: 500; position: relative; transition: color 0.2s; }
.nav__link::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width 0.25s var(--ease); }
.nav__link:hover { color: var(--text); }
.nav__link:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Theme toggle ===== */
.theme-toggle {
  display: grid; place-items: center; position: relative;
  width: 42px; height: 42px; margin-left: 0.5rem;
  color: var(--text); background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}
.theme-toggle:hover { border-color: var(--brand); transform: translateY(-2px); }
.theme-toggle__icon { position: absolute; transition: opacity 0.3s, transform 0.4s var(--ease); }
.theme-toggle__icon--sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle__icon--moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle__icon--sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle__icon--moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

/* ===== Hero ===== */
.hero { position: relative; padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem); overflow: hidden; }
.hero__glow { position: absolute; inset: -20% 0 auto; height: 620px; background:
    radial-gradient(600px 300px at 20% 20%, rgba(79,124,255,0.25), transparent 70%),
    radial-gradient(500px 300px at 80% 10%, rgba(168,85,247,0.22), transparent 70%),
    radial-gradient(500px 300px at 60% 60%, rgba(34,211,238,0.15), transparent 70%);
  filter: blur(10px); pointer-events: none; }
.hero__inner { position: relative; max-width: 820px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; font-weight: 700; color: var(--brand-2); margin-bottom: 1rem; }
.hero__title { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 800; }
.grad { background: linear-gradient(120deg, var(--brand), var(--accent), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); margin: 1.5rem 0 2rem; max-width: 620px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3.25rem; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-family: "Space Grotesk", sans-serif; font-size: 1.8rem; }
.hero__stats span { color: var(--muted); font-size: 0.9rem; }

/* ===== Sections ===== */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section__title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
.section__sub { color: var(--muted); margin-top: 0.85rem; font-size: 1.05rem; }

/* ===== Grid / cards ===== */
.grid { display: grid; gap: 1.25rem; }
.grid--cards { grid-template-columns: repeat(3, 1fr); }
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.9rem 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(79,124,255,0.5); }
.card__icon { font-size: 1.9rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: rgba(79,124,255,0.12); margin-bottom: 1.1rem; }
.card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* ===== Portfolio / Work ===== */
.grid--work { grid-template-columns: repeat(2, 1fr); }
.work {
  overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.work:hover { transform: translateY(-6px); border-color: rgba(79,124,255,0.5); }
.work__thumb { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.work__thumb span { font-family: "Space Grotesk", sans-serif; font-size: 3rem; font-weight: 700; color: rgba(255,255,255,0.85); }
.work__thumb--1 { background: linear-gradient(135deg, #4f7cff, #22d3ee); }
.work__thumb--2 { background: linear-gradient(135deg, #a855f7, #4f7cff); }
.work__thumb--3 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.work__thumb--4 { background: linear-gradient(135deg, #22d3ee, #34d399); }
.work__body { padding: 1.5rem 1.6rem 1.75rem; }
.work__tag { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 700; color: var(--brand-2); margin-bottom: 0.5rem; }
.work__body h3 { font-size: 1.25rem; margin-bottom: 0.45rem; }
.work__body p { color: var(--muted); font-size: 0.96rem; }

/* ===== Testimonials ===== */
.grid--quotes { grid-template-columns: repeat(3, 1fr); }
.quote {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1rem;
}
.quote__stars { color: #f5b942; letter-spacing: 0.15em; font-size: 0.95rem; }
.quote blockquote { color: var(--text); font-size: 1rem; line-height: 1.65; flex: 1; }
.quote figcaption { display: flex; align-items: center; gap: 0.85rem; }
.quote__avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 0.85rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.quote__who { display: flex; flex-direction: column; }
.quote__who strong { font-size: 0.98rem; }
.quote__who small { color: var(--muted); font-size: 0.85rem; }

/* ===== About ===== */
.about__inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about__media { display: grid; place-items: center; }
.about__panel {
  width: 100%; max-width: 420px; aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  padding: 1.25rem; position: relative;
}
.about__dot { position: absolute; top: 1.1rem; width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.about__dot:nth-child(2) { left: 2.6rem; background: #febc2e; }
.about__dot:nth-child(3) { left: 4.1rem; background: #28c840; }
.about__dot:first-child { left: 1.1rem; }
.about__bars { position: absolute; inset: 3.2rem 1.4rem 1.4rem; display: flex; flex-direction: column; justify-content: center; gap: 0.85rem; }
.about__bars i { display: block; height: 12px; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); opacity: 0.85; }
.about__body p { color: var(--muted); margin-top: 1rem; }
.ticklist { margin: 1.5rem 0 2rem; display: grid; gap: 0.7rem; }
.ticklist li { position: relative; padding-left: 1.9rem; color: var(--text); }
.ticklist li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 1.3rem; height: 1.3rem; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: #fff; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); }

/* ===== Contact ===== */
.contact__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact__meta { margin-top: 2rem; display: grid; gap: 1rem; }
.contact__meta li { display: flex; flex-direction: column; }
.contact__meta span { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--muted); }
.contact__meta a:hover { color: var(--brand-2); }

.contact__form { background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%; padding: 0.8rem 0.95rem; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 12px;
  font: inherit; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: #6c789c; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,124,255,0.2); }
.field textarea { resize: vertical; }
.field.is-invalid input, .field.is-invalid textarea { border-color: #ff6b6b; }
.error { display: block; color: #ff8f8f; font-size: 0.8rem; margin-top: 0.35rem; min-height: 1em; }
.form__success { margin-top: 1rem; color: #45e0a0; font-weight: 600; text-align: center; }

/* ===== Footer ===== */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 3rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; padding-bottom: 2rem; }
.footer__brand { max-width: 340px; }
.footer__brand p { color: var(--muted); margin-top: 0.75rem; font-size: 0.95rem; }
.footer__nav { display: flex; gap: 1.5rem; }
.footer__nav a { color: var(--muted); transition: color 0.2s; }
.footer__nav a:hover { color: var(--text); }
.footer__social { display: flex; gap: 0.6rem; }
.footer__social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; color: var(--muted); transition: all 0.25s; }
.footer__social a:hover { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.footer__bottom { border-top: 1px solid var(--border); padding: 1.25rem 1.25rem; text-align: center; color: var(--muted); font-size: 0.88rem; }

/* ===== Reveal animation ===== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid--cards { grid-template-columns: repeat(2, 1fr); }
  .grid--quotes { grid-template-columns: 1fr; }
  .about__inner, .contact__inner { grid-template-columns: 1fr; }
  .about__media { order: -1; }
}

@media (max-width: 720px) {
  .nav {
    position: fixed; inset: 72px 0 auto; flex-direction: column; gap: 1.25rem;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.25rem 2rem; transform: translateY(-140%);
    transition: transform 0.35s var(--ease); align-items: stretch;
  }
  .nav.is-open { transform: translateY(0); }
  .nav__list { flex-direction: column; gap: 1rem; }
  .nav__cta { text-align: center; }
  .nav-toggle { display: flex; }
}

@media (max-width: 520px) {
  .grid--cards { grid-template-columns: 1fr; }
  .grid--work { grid-template-columns: 1fr; }
  .hero__stats { gap: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
