:root {
  --bg: #050506;
  --bg-soft: #0b0c0f;
  --panel: rgba(14, 15, 19, 0.78);
  --panel-strong: rgba(18, 18, 22, 0.92);
  --text: #f7f7f7;
  --muted: #a8adb8;
  --red: #ff1535;
  --red-dark: #9f0017;
  --chrome: #e8edf5;
  --chrome-dark: #5b606a;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 21, 53, 0.20), transparent 30rem),
    radial-gradient(circle at 88% 6%, rgba(230, 237, 245, 0.12), transparent 24rem),
    linear-gradient(135deg, #020203 0%, #08090c 44%, #150006 100%);
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent 78%);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 21, 53, .08), transparent 31rem),
    linear-gradient(to bottom, rgba(0,0,0,.10), rgba(0,0,0,.55));
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }

.page-shell { width: 100%; overflow-x: hidden; }
.container { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }
.section-pad { padding: clamp(4rem, 8vw, 7rem) 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(3, 3, 5, 0.74);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(var(--max), calc(100% - 28px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: .78rem; font-weight: 900; letter-spacing: -.02em; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 46px;
  color: white; font-size: .86rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 22%, #ffffff 0, #d7dce5 11%, #575d68 26%, #0b0b0d 43%, #09090b 55%, #b5bac3 72%, #f8fbff 79%, #494d55 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25), 0 0 0 2px rgba(255,21,53,.45), 0 0 30px rgba(255,21,53,.42);
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.brand-text span { color: var(--red); }

.site-menu { display: flex; align-items: center; gap: .36rem; }
.site-menu > a, .dropdown-toggle {
  color: #d6d9df;
  padding: .75rem .9rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.site-menu > a:hover, .dropdown-toggle:hover { color: white; background: rgba(255,255,255,.07); }
.nav-cta {
  background: linear-gradient(135deg, var(--red), var(--red-dark)) !important;
  color: white !important;
  box-shadow: 0 12px 35px rgba(255,21,53,.25);
}

.nav-dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  min-width: 245px;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  background: rgba(10, 10, 13, .96);
  box-shadow: var(--shadow);
  transition: .18s ease;
}
.nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a { display: block; padding: .72rem .85rem; color: #d7dbe2; border-radius: 12px; }
.dropdown-toggle::after { content: " ▾"; color: var(--red); font-size: .85em; }
.dropdown-menu a:hover { background: rgba(255,21,53,.14); color: white; }

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}
.menu-toggle span { display: block; width: 22px; height: 2px; margin: 5px auto; background: white; border-radius: 2px; transition: .2s ease; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
  position: relative;
  min-height: calc(100vh - 78px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(2,2,3,.88) 0%, rgba(2,2,3,.64) 47%, rgba(2,2,3,.40) 100%),
    url("../img/bg-hero-desktop.png");
  background-image:
    linear-gradient(90deg, rgba(2,2,3,.88) 0%, rgba(2,2,3,.64) 47%, rgba(2,2,3,.40) 100%),
    image-set(url("../img/bg-hero-desktop.webp") type("image/webp"), url("../img/bg-hero-desktop.png") type("image/png"));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 13% 20%, rgba(255,21,53,.18), transparent 22rem),
    linear-gradient(to bottom, rgba(0,0,0,.12), rgba(0,0,0,.72));
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(320px, .82fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.eyebrow {
  margin: 0 0 1rem;
  color: var(--red);
  font-family: "JetBrains Mono", monospace;
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(3rem, 8vw, 6.7rem); line-height: .9; letter-spacing: -.075em; margin-bottom: 1.35rem; }
h1 span {
  display: block;
  background: linear-gradient(110deg, #ffffff, #d6dce5 34%, #ff1d3e 58%, #f4f7fb 78%, #6e7480);
  -webkit-background-clip: text;
  color: transparent;
}
.hero-lead { max-width: 720px; color: #d7dbe2; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: .85rem 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  border-color: rgba(255,21,53,.5);
  background: linear-gradient(135deg, var(--red), #7e0012);
  box-shadow: 0 20px 50px rgba(255,21,53,.25), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-ghost { background: rgba(255,255,255,.055); color: #f2f4f8; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }

.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; max-width: 680px; }
.hero-stats div { padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.045); }
.hero-stats strong { display: block; font-size: 1.15rem; }
.hero-stats span { color: var(--muted); font-size: .88rem; }

.chrome-card {
  position: relative;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.025) 32%, rgba(255,21,53,.05)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.15);
  overflow: hidden;
}
.chrome-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,21,53,.42), rgba(111,117,128,.2));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.hero-panel { position: relative; min-height: 540px; }
.panel-glow { position: absolute; inset: 8% 0 0 0; background: radial-gradient(circle, rgba(255,21,53,.3), transparent 60%); filter: blur(30px); }
.main-card { width: min(100%, 520px); margin-left: auto; padding: 1.15rem; min-height: 500px; }
.card-topline { display: flex; gap: .5rem; padding: .45rem; }
.card-topline span { width: 12px; height: 12px; border-radius: 50%; background: #ff1535; box-shadow: 0 0 18px rgba(255,21,53,.7); }
.card-topline span:nth-child(2) { background: #c5cbd5; box-shadow: 0 0 18px rgba(255,255,255,.4); }
.card-topline span:nth-child(3) { background: #484d57; }
.tech-rings { position: relative; min-height: 310px; }
.ring { position: absolute; width: 45%; filter: drop-shadow(0 20px 35px rgba(0,0,0,.65)); }
.ring-a { left: 5%; top: 32px; width: 52%; }
.ring-b { right: 2%; top: 95px; width: 42%; }
.ring-c { left: 38%; bottom: 10px; width: 38%; }
.terminal-card { border: 1px solid var(--line); border-radius: 20px; padding: 1rem; background: rgba(0,0,0,.45); font-family: "JetBrains Mono", monospace; font-size: .91rem; color: #dce1e9; }
.terminal-card p { margin: .42rem 0; }
.terminal-card span, .terminal-card .ok { color: #ff4a61; }
.chrome-orb { position: absolute; width: 28rem; aspect-ratio: 1; border-radius: 50%; filter: blur(5px); opacity: .18; pointer-events: none; }
.orb-one { top: 6rem; left: -16rem; background: radial-gradient(circle, #ff1535, transparent 64%); }
.orb-two { right: -14rem; bottom: 3rem; background: radial-gradient(circle, #ffffff, transparent 64%); }


.about, .services, .work, .contact {
  position: relative;
}
.services::before, .work::before, .contact::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(5,5,6,.92), rgba(5,5,6,.82)),
    url("../img/bg-section.png");
  background-image:
    linear-gradient(180deg, rgba(5,5,6,.92), rgba(5,5,6,.82)),
    image-set(url("../img/bg-section.webp") type("image/webp"), url("../img/bg-section.png") type("image/png"));
  background-size: cover;
  background-position: center;
  opacity: .55;
  z-index: 0;
}
.services > .container, .work > .container, .contact > .container {
  position: relative;
  z-index: 1;
}

.split-grid { display: grid; grid-template-columns: .75fr 1.15fr; gap: 2rem; align-items: start; }
.section-heading h2 { font-size: clamp(2.25rem, 5vw, 4.3rem); line-height: 1; letter-spacing: -.055em; margin-bottom: 1rem; }
.section-heading p { color: var(--muted); line-height: 1.75; font-size: 1.05rem; }
.centered { max-width: 770px; margin: 0 auto 3rem; text-align: center; }
.content-card { padding: clamp(1.4rem, 4vw, 2.2rem); }
.content-card h3 { font-size: 1.7rem; margin-bottom: 1rem; }
.content-card p { color: #d4d8df; line-height: 1.75; }

.skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.skill-grid article { padding: 1.2rem; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.045); }
.skill-grid img { width: 68px; margin-bottom: .7rem; }
.skill-grid h3 { margin-bottom: .35rem; font-size: 1.05rem; }
.skill-grid p { margin: 0; color: var(--muted); }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.service-card { padding: 1.45rem; }
.service-card img { width: 78px; margin-bottom: .95rem; }
.service-card h3 { font-size: 1.45rem; margin-bottom: .7rem; }
.service-card p { color: #d3d7df; line-height: 1.72; }
.tags { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.tags span { padding: .42rem .65rem; border-radius: 999px; color: #f1f3f8; background: rgba(255,21,53,.14); border: 1px solid rgba(255,21,53,.24); font-size: .84rem; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.project-card { display: grid; grid-template-columns: 98px 1fr; gap: 1.1rem; padding: 1.25rem; align-items: center; }
.project-icon img { width: 98px; }
.project-type { margin: 0 0 .35rem; color: var(--red); font-family: "JetBrains Mono", monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.project-card h3 { font-size: 1.42rem; margin-bottom: .45rem; }
.project-card p { color: #d0d5de; line-height: 1.65; margin-bottom: .85rem; }
.project-card a { color: white; font-weight: 900; }
.project-card a:hover { color: #ff5870; }
.project-card { scroll-margin-top: 110px; }
.project-card:focus { outline: 2px solid rgba(255,21,53,.72); outline-offset: 5px; }

.contact-panel { display: grid; grid-template-columns: 1fr auto; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.contact-panel h2 { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.055em; margin-bottom: 1rem; }
.contact-panel p { color: #d3d7df; line-height: 1.7; max-width: 720px; }
.contact-actions { display: grid; gap: .8rem; min-width: min(320px, 100%); }
.email-line { margin: 0; text-align: center; color: var(--muted) !important; font-size: .95rem; }

.site-footer { padding: 3.5rem 0 1.5rem; border-top: 1px solid var(--line); background: rgba(0,0,0,.34); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, .6fr); gap: 2rem; }
.footer-brand { margin-bottom: 1rem; }
.site-footer p { color: var(--muted); line-height: 1.7; max-width: 420px; }
.site-footer h3 { font-size: 1rem; margin-bottom: .9rem; }
.site-footer a:not(.brand) { display: block; color: #bfc4ce; padding: .22rem 0; }
.site-footer a:not(.brand):hover { color: white; }
.footer-bottom { width: min(var(--max), calc(100% - 36px)); margin: 2.2rem auto 0; padding-top: 1.2rem; border-top: 1px solid var(--line); color: #838995; font-size: .9rem; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .menu-toggle { display: block; }
  .site-menu {
    position: fixed;
    top: 78px;
    left: 14px;
    right: 14px;
    display: grid;
    gap: .35rem;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(8,8,11,.98);
    box-shadow: var(--shadow);
    transform: translateY(-18px);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
  }
  .site-menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-menu > a, .dropdown-toggle { width: 100%; text-align: left; border-radius: 14px; }
  .nav-dropdown { width: 100%; }
  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    margin-top: .35rem;
    box-shadow: none;
    border-radius: 14px;
    background: rgba(255,255,255,.045);
  }
  .nav-dropdown.is-open .dropdown-menu { display: block; }
  .nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu { transform: none; }
  .hero-grid, .split-grid, .contact-panel, .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-panel { min-height: 460px; }
  .main-card { margin: 0 auto; min-height: 455px; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-grid, .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(2,2,3,.82) 0%, rgba(2,2,3,.70) 50%, rgba(2,2,3,.78) 100%),
      url("../img/bg-hero-mobile.png");
    background-image:
      linear-gradient(180deg, rgba(2,2,3,.82) 0%, rgba(2,2,3,.70) 50%, rgba(2,2,3,.78) 100%),
      image-set(url("../img/bg-hero-mobile.webp") type("image/webp"), url("../img/bg-hero-mobile.png") type("image/png"));
    background-position: center top;
  }
  .container { width: min(100% - 24px, var(--max)); }
  .nav-wrap { width: min(100% - 20px, var(--max)); min-height: 70px; }
  .brand-text { font-size: .92rem; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .site-menu { top: 70px; left: 10px; right: 10px; }
  .section-pad { padding: 4rem 0; }
  h1 { font-size: clamp(2.7rem, 16vw, 4.2rem); }
  .hero-actions { display: grid; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-panel { min-height: 390px; }
  .main-card { min-height: 375px; border-radius: 24px; }
  .tech-rings { min-height: 245px; }
  .terminal-card { font-size: .78rem; }
  .skill-grid { grid-template-columns: 1fr; }
  .project-card { grid-template-columns: 1fr; }
  .project-icon img { width: 86px; }
}

/* CMS portfolio screenshot support */
.project-card { display: block; padding: 1.25rem; }
.project-main { display: grid; grid-template-columns: 98px minmax(0, 1fr); gap: 1.1rem; align-items: center; }
.project-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,21,53,.12), rgba(255,255,255,.05)),
    rgba(0,0,0,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 45px rgba(0,0,0,.35);
}
.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, filter .35s ease;
}
.project-shot:hover img { transform: scale(1.035); filter: brightness(1.08); }
@media (max-width: 640px) {
  .project-main { grid-template-columns: 1fr; }
}
