:root {
  --bg: #070b14;
  --panel: rgba(15, 22, 37, 0.66);
  --text: #f4f7ff;
  --muted: #9da9be;
  --line: rgba(183, 205, 255, 0.14);
  --line-strong: rgba(183, 205, 255, 0.28);
  --accent: #9bbcff;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(86, 118, 186, 0.10), transparent 35%),
    radial-gradient(circle at 85% 70%, rgba(72, 89, 147, 0.08), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.page-intro {
  display: none;
}

.js .page-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(76, 104, 166, 0.10), transparent 35%),
    #070b14;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 620ms ease 120ms,
    visibility 0s linear 760ms;
}

.intro-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 18px 65px rgba(0, 0, 0, 0.32);
  transition:
    transform 620ms cubic-bezier(0.2, 0.78, 0.2, 1),
    opacity 420ms ease;
}

.intro-symbol svg {
  width: 48px;
  height: 48px;
  fill: var(--text);
}

.intro-streak {
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 118px;
  height: 1px;
  overflow: hidden;
  transform: translateX(-50%);
  background: rgba(155, 188, 255, 0.12);
}

.intro-streak::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(221, 231, 255, 0.95), transparent);
  transform: translateX(-110%);
  animation: intro-streak 900ms cubic-bezier(0.2, 0.75, 0.2, 1) 120ms both;
}

.js.is-ready .page-intro {
  opacity: 0;
  visibility: hidden;
}

.js.is-ready .intro-symbol {
  transform: translateY(-12px) scale(0.94);
  opacity: 0;
}

@keyframes intro-streak {
  to { transform: translateX(110%); }
}

::selection {
  background: rgba(155, 188, 255, 0.28);
  color: white;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  color: inherit;
  font: inherit;
}

#starfield,
#cursor-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#starfield {
  z-index: -3;
}

#cursor-trail {
  z-index: 1;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

main,
.site-footer {
  position: relative;
  z-index: 2;
}

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

.site-header {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 11, 20, 0.72);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  transition:
    opacity 640ms ease,
    transform 760ms cubic-bezier(0.18, 0.82, 0.2, 1),
    padding 240ms ease,
    background 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

.js .site-header {
  opacity: 0;
  transform: translateY(-18px) scale(0.985);
}

.js.is-ready .site-header {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 220ms, 220ms, 0ms, 0ms, 0ms, 0ms;
}

.site-header.is-compact {
  padding-block: 9px;
  border-color: rgba(183, 205, 255, 0.20);
  background: rgba(7, 11, 20, 0.84);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: var(--text);
}

.brand-domain {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

nav a {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease;
}

nav a:hover,
nav a:focus-visible,
nav a[aria-current="true"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

nav a[aria-current="true"] {
  box-shadow: inset 0 -1px 0 rgba(155, 188, 255, 0.54);
}

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 82px);
  padding-block: clamp(88px, 12vw, 150px) 96px;
}

.hero-copy {
  width: min(100%, 990px);
}

.eyebrow,
.contact-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.fragment-title {
  margin: 22px 0 24px;
  font-family: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: clamp(3.5rem, 8.7vw, 7.6rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.068em;
}

.fragment-line {
  display: block;
}

.fragment-word {
  display: inline-block;
  white-space: nowrap;
}

.fragment-title .fragment-char {
  display: inline-block;
  will-change: transform, translate, rotate, filter, opacity;
  transform: translate3d(var(--tx, 0), var(--ty, 0), 0) rotate(var(--rot, 0));
  transition:
    transform 640ms cubic-bezier(0.2, 0.75, 0.18, 1),
    filter 420ms ease,
    opacity 420ms ease,
    translate 880ms cubic-bezier(0.18, 0.86, 0.2, 1),
    rotate 880ms cubic-bezier(0.18, 0.86, 0.2, 1);
}

.js .fragment-title .fragment-char {
  opacity: 0;
  translate: var(--intro-x, 0px) var(--intro-y, 0px);
  rotate: var(--intro-rotate, 0deg);
  transition-delay: var(--intro-delay, 0ms);
}

.js.is-ready .fragment-title .fragment-char {
  opacity: 1;
  translate: 0 0;
  rotate: 0deg;
}

.js.intro-complete .fragment-title .fragment-char,
.fragment-title.is-active .fragment-char {
  transition-delay: 0ms;
}

.fragment-title.is-active .fragment-char {
  transition-duration: 180ms;
}

.js .hero-copy .eyebrow,
.js .hero-copy .hero-summary,
.js .hero-copy .hero-actions {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 620ms ease,
    transform 720ms cubic-bezier(0.18, 0.84, 0.22, 1);
}

.js.is-ready .hero-copy.is-visible .eyebrow,
.js.is-ready .hero-copy.is-visible .hero-summary,
.js.is-ready .hero-copy.is-visible .hero-actions {
  opacity: 1;
  transform: translateY(0);
}

.js.is-ready .hero-copy.is-visible .eyebrow { transition-delay: 300ms; }
.js.is-ready .hero-copy.is-visible .hero-summary { transition-delay: 600ms; }
.js.is-ready .hero-copy.is-visible .hero-actions { transition-delay: 720ms; }

.hero-summary {
  max-width: 710px;
  margin: 0;
  color: #b5bfd0;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  font-size: 0.88rem;
  font-weight: 700;
  transform: translate3d(var(--magnetic-x, 0px), var(--magnetic-y, 0px), 0);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translate3d(var(--magnetic-x, 0px), calc(var(--magnetic-y, 0px) - 2px), 0);
}

.button.primary {
  border-color: rgba(184, 205, 255, 0.62);
  background: var(--text);
  color: #0b1120;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.035);
}

.section-block {
  position: relative;
  padding-block: 94px;
}

.section-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(155, 188, 255, 0.42), var(--line) 45%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 980ms cubic-bezier(0.18, 0.84, 0.2, 1);
}

.section-block.is-active-section::before {
  transform: scaleX(1);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: clamp(2.25rem, 4.4vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -0.048em;
}

.section-heading > p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: right;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-card,
.contact-card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 26, 43, 0.66), rgba(9, 14, 25, 0.48));
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translate3d(0, var(--lift), 0);
  transform-style: preserve-3d;
  transition: border-color 200ms ease, background 200ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.info-card:hover,
.contact-card:hover,
.contact-card:focus-visible {
  --lift: -3px;
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(20, 29, 47, 0.78), rgba(10, 15, 27, 0.62));
}

.info-card {
  padding: 24px;
  border-radius: 18px;
}

.info-card h3,
.timeline-body h3 {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}

.info-card p,
.timeline-body p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr);
  gap: 34px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-meta {
  padding-top: 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.timeline-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.timeline-body p {
  margin: 0;
}

.timeline-body h3,
.timeline-meta {
  transition: transform 240ms ease, color 240ms ease;
}

.timeline-item:hover .timeline-body h3 {
  transform: translateX(5px);
}

.timeline-item:hover .timeline-meta {
  color: #c5d6ff;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 22px;
  border-radius: 18px;
  text-align: left;
}

button.contact-card {
  width: 100%;
  cursor: pointer;
}

.contact-card strong {
  display: block;
  max-width: 100%;
  margin-top: 18px;
  overflow-wrap: anywhere;
  font-family: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: clamp(1.04rem, 1.7vw, 1.3rem);
  line-height: 1.25;
}

.contact-action {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 30px 44px;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a:hover {
  color: var(--text);
}

.reveal {
  --reveal-x: 0px;
  --reveal-y: 28px;
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y), 0) scale(0.988);
  filter: blur(8px);
  clip-path: inset(0 0 12% 0 round 10px);
  transition:
    opacity 760ms ease var(--reveal-delay, 0ms),
    transform 900ms cubic-bezier(0.18, 0.86, 0.2, 1) var(--reveal-delay, 0ms),
    filter 760ms ease var(--reveal-delay, 0ms),
    clip-path 900ms cubic-bezier(0.18, 0.86, 0.2, 1) var(--reveal-delay, 0ms);
}

.reveal[data-reveal="left"] {
  --reveal-x: -32px;
  --reveal-y: 8px;
}

.reveal[data-reveal="right"] {
  --reveal-x: 42px;
  --reveal-y: 6px;
}

.reveal[data-reveal="hero"] {
  --reveal-y: 18px;
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  clip-path: inset(0 0 0 0 round 0);
}

.reveal[data-tilt] {
  transform: perspective(900px) translate3d(var(--reveal-x), var(--reveal-y), 0) scale(0.988) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.reveal.is-visible[data-tilt] {
  transform: perspective(900px) translate3d(0, var(--lift), 0) scale(1) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

@media (max-width: 900px) {
  .work-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline-body {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .section-shell,
  .site-header {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .site-header {
    top: 8px;
    margin-top: 8px;
    padding: 10px 11px;
  }

  .brand-domain {
    display: none;
  }

  nav {
    gap: 0;
  }

  nav a {
    padding: 8px 7px;
    font-size: 0.74rem;
  }

  .hero {
    min-height: 88vh;
    padding-top: 86px;
  }

  .fragment-title {
    font-size: clamp(3.1rem, 16vw, 5.2rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section-block {
    padding-block: 74px;
  }

  .section-heading {
    display: block;
    margin-bottom: 28px;
  }

  .section-heading > p {
    margin-top: 10px;
    text-align: left;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .reveal[data-reveal="left"] {
    --reveal-x: -16px;
  }

  .reveal[data-reveal="right"] {
    --reveal-x: 16px;
  }

  .intro-symbol {
    width: 70px;
    height: 70px;
    border-radius: 19px;
  }

  .intro-symbol svg {
    width: 42px;
    height: 42px;
  }
}

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

  #cursor-trail,
  .page-intro {
    display: none !important;
  }

  .site-header,
  .fragment-title .fragment-char,
  .hero-copy .eyebrow,
  .hero-copy .hero-summary,
  .hero-copy .hero-actions {
    opacity: 1 !important;
    transform: none !important;
    translate: none !important;
    rotate: none !important;
  }

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