:root {
  --bg: #0b1623;
  --bg-alt: #102236;
  --surface: rgba(17, 36, 55, .72);
  --surface-solid: #12283e;
  --surface-soft: #162f48;
  --text: #f5f8fb;
  --muted: #9eafc1;
  --border: rgba(255, 255, 255, .10);
  --accent: #45c4e6;
  --accent-2: #ffb32b;
  --accent-soft: rgba(69, 196, 230, .13);
  --header: rgba(10, 22, 35, .78);
  --shadow: 0 24px 80px rgba(0, 0, 0, .25);
  --max-width: 1180px;
  --radius: 22px;
  --logo_bg: #transparent;
}

html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-alt: #eaf0f6;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #fff;
  --surface-soft: #eff4f8;
  --text: #102236;
  --muted: #607185;
  --border: rgba(16, 34, 54, .11);
  --accent: #087ea4;
  --accent-2: #c97900;
  --accent-soft: rgba(8, 126, 164, .10);
  --header: rgba(245, 247, 250, .82);
  --shadow: 0 24px 70px rgba(16, 34, 54, .12);
  --logo_bg: #607185;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-width: 300px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.container {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: -70px;
  left: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 16px;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 19%, rgba(69, 196, 230, .11), transparent 31%),
    radial-gradient(circle at 87% 68%, rgba(255, 179, 43, .07), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  color: var(--muted);
  opacity: .10;
  background-image: radial-gradient(circle, currentColor 1px, transparent 1.2px);
  background-size: 29px 29px;
  mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,.8) 55%, transparent 94%);
}

.shape {
  position: absolute;
  display: block;
  width: 240px;
  aspect-ratio: 1;
  border: 1px solid rgba(69, 196, 230, .16);
  border-radius: 28px;
  transform: rotate(45deg);
  will-change: transform;
}

.shape-a {
  left: -100px;
  top: 12%;
}

.shape-b {
  right: -125px;
  top: 47%;
  width: 340px;
  border-color: rgba(255, 179, 43, .13);
}

.shape-c {
  left: 38%;
  bottom: -85px;
  width: 190px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: var(--header);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.24rem;
  letter-spacing: -.02em;
  font-weight: 800;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 3px;
  background-color: var(--logo_bg);
  background-image: url("icon.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.brand b {
  color: var(--accent-2);
}

.brand strong {
  color: var(--text);
}

nav {
  margin-left: auto;
  display: flex;
  gap: 3px;
}

nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 650;
  transition: color .2s ease, background .2s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.menu-button {
  display: none;
}

.hero {
  min-height: calc(100svh - 76px);
  display: grid;
  align-items: center;
  padding: 92px 0 110px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 72px;
  align-items: center;
}

.eyebrow,
.section-kicker,
.stack-type,
.project-state {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 22px 0 19px;
  max-width: 850px;
  font-size: clamp(3.15rem, 6.5vw, 6.2rem);
  line-height: .98;
  letter-spacing: -.066em;
}

h1 span {
  display: block;
  color: var(--accent);
}

.lead {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.23rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 31px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--accent);
  color: #07141d;
}

html[data-theme="light"] .button.primary {
  color: #fff;
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
}

.button.small {
  min-height: 43px;
  padding: 9px 14px;
}

.quick-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.quick-stack span,
.tags span,
.skill-list span {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: .8rem;
  font-weight: 700;
}

.hero-visual {
  position: relative;
  min-height: 470px;
  display: grid;
  place-items: center;
}

.code-window {
  width: min(100%, 510px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(8, 19, 30, .80);
  box-shadow: var(--shadow);
  transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .code-window {
  background: rgba(255, 255, 255, .88);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
}

.code-header i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .45;
}

.code-header span {
  margin-left: 7px;
}

.code-window pre {
  margin: 0;
  padding: 25px;
  overflow: auto;
  color: var(--muted);
  font-size: .9rem;
}

.code-key {
  color: var(--accent);
}

.code-value {
  color: var(--accent-2);
}

.code-ok {
  color: #62ac3a;
}

.float-label {
  position: absolute;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  font-size: .84rem;
  font-weight: 750;
}

.label-a {
  top: 13%;
  left: 0;
}

.label-b {
  top: 29%;
  right: -2%;
}

.label-c {
  bottom: 8%;
  left: 7%;
}

.section {
  position: relative;
  padding: 106px 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(16, 34, 54, .34), transparent);
}

html[data-theme="light"] .section-alt {
  background: linear-gradient(180deg, transparent, rgba(220, 230, 240, .58), transparent);
}

.section-head {
  max-width: 780px;
}

.section-head h2 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.05;
  letter-spacing: -.048em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 50px rgba(0,0,0,.08);
  backdrop-filter: blur(15px);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
}

.service-card {
  min-height: 365px;
  display: flex;
  flex-direction: column;
  padding: 27px;
}

.card-number {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.service-card h3 {
  margin: 52px 0 12px;
  font-size: 1.38rem;
  letter-spacing: -.025em;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 27px;
}

.stack-grid {
  display: grid;
  gap: 16px;
  margin-top: 42px;
}

.stack-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 22px;
  align-items: start;
  padding: 25px;
}

.stack-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.stack-card h3 {
  margin: 5px 0 13px;
  font-size: 1.28rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  gap: 18px;
  margin-top: 42px;
}

.project-main,
.project-placeholder {
  min-height: 340px;
  padding: 30px;
}

.project-main {
  display: flex;
  flex-direction: column;
}

.project-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-status {
  color: var(--muted);
  font-size: .83rem;
}

.project-main h3,
.project-placeholder h3 {
  margin: 42px 0 12px;
  font-size: 1.75rem;
}

.project-main p,
.project-placeholder p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
}

.project-tags {
  margin-top: auto;
}

.contact-section {
  padding-top: 90px;
}

.contact-inner {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 36px;
  align-items: start;
}

.mail-card {
  padding: 28px;
}

.mail-address-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.field-caption {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 700;
}

.email-display {
  min-height: 29px;
  font-weight: 800;
}

.email-display a {
  color: var(--accent);
}

#mailForm {
  display: grid;
  gap: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: .84rem;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  padding: 13px 14px;
}

textarea {
  min-height: 155px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

footer {
  padding: 30px 0 26px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .88rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.footer-row strong {
  color: var(--text);
}

.privacy-note {
  margin-top: 9px;
  font-size: .78rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .65s ease, transform .65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 920px) {
  .hero-grid,
  .contact-inner,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 390px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 250px;
  }

  .service-card h3 {
    margin-top: 28px;
  }

  nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--header);
    backdrop-filter: blur(18px);
  }

  nav.open {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .menu-button {
    display: grid;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .section {
    padding: 82px 0;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.4rem);
  }

  .hero-visual {
    min-height: 330px;
  }

  .code-window {
    transform: none;
  }

  .float-label {
    padding: 7px 9px;
    font-size: .72rem;
  }

  .stack-card {
    grid-template-columns: 1fr;
  }

  .mail-address-row {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
