:root {
  --color-background: #08080a;
  --color-surface: #0e0f12;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --color-text: #ededef;
  --color-text-muted: #8a8f98;
  --color-accent: #34e3b0;
  --color-accent-secondary: #4f9dff;
  --font-sans: "Geist", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --page-gutter: clamp(16px, 5vw, 48px);
  --content-width: 1080px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Film grain over everything, so flat dark areas do not look like plain digital black. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

::selection {
  background: rgba(52, 227, 176, 0.3);
}

/* Background glow */

.page-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 900px;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}

.glow-orb-primary {
  width: 640px;
  height: 420px;
  top: -220px;
  left: calc(50% - 480px);
  background: var(--color-accent);
  animation: drift-primary 18s ease-in-out infinite alternate;
}

.glow-orb-secondary {
  width: 560px;
  height: 400px;
  top: -200px;
  left: calc(50% - 40px);
  background: var(--color-accent-secondary);
  animation: drift-secondary 22s ease-in-out infinite alternate;
}

/* Isometric block field drawn by block-field.js.
   It uses the large viewport height so a phone's sliding address bar never resizes it mid-scroll. */
#block-field {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.2s linear;
}

@keyframes drift-primary {
  to {
    transform: translate(120px, 40px) scale(1.1);
  }
}

@keyframes drift-secondary {
  to {
    transform: translate(-140px, 60px) scale(0.92);
  }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px var(--page-gutter) 0;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(14, 15, 18, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.site-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

.site-nav .nav-cta {
  color: var(--color-background);
  background: var(--color-text);
  font-weight: 500;
}

.site-nav .nav-cta:hover {
  color: var(--color-background);
  background: #ffffff;
}

/* Layout */

main {
  overflow-x: clip;
}

main > section {
  position: relative;
  max-width: var(--content-width);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
  box-sizing: content-box;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - 70px);
  min-height: calc(100svh - 70px);
  padding-block: clamp(80px, 14vh, 150px) 0;
}

.dot-grid {
  position: absolute;
  inset: -80px 0 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 35%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 35%, black, transparent);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(52, 227, 176, 0.2);
}

h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.6));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.accent-text {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 54ch;
  margin: 28px 0 0;
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--color-text-muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease-out);
}

.button:hover svg {
  transform: translateX(3px);
}

.button-primary {
  background: var(--color-text);
  color: var(--color-background);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 24px -8px rgba(255, 255, 255, 0.35);
}

.button-primary:hover {
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 10px 32px -8px rgba(52, 227, 176, 0.6);
}

.button-secondary {
  border-color: var(--color-border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
}

.button-secondary:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

/* Section headings */

.work,
.contact {
  padding-block: clamp(72px, 12vw, 128px);
}

.section-heading {
  margin-bottom: 40px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.section-label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

h2 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* Bento cards */

.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)), var(--color-surface);
  overflow: hidden;
  isolation: isolate;
}

/* Soft light that follows the pointer inside the card. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(360px circle at var(--pointer-x) var(--pointer-y), rgba(52, 227, 176, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Brighter border segment that follows the pointer. */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--pointer-x) var(--pointer-y), rgba(52, 227, 176, 0.6), transparent 60%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

.card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 32px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 48px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-accent);
}

.card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  max-width: 42ch;
  color: var(--color-text-muted);
  font-size: 15px;
}

.code-sample {
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: #c9ced6;
  overflow-x: auto;
}

.code-keyword {
  color: #c792ea;
}

.code-type {
  color: #4f9dff;
}

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

.code-modifier {
  color: #f5b862;
}

/* Contact */

.contact-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(40px, 8vw, 88px) clamp(20px, 5vw, 64px);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(52, 227, 176, 0.12), transparent 70%),
    var(--color-surface);
  overflow: hidden;
}

.contact-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.contact-panel h2 {
  max-width: 16ch;
}

.contact-copy {
  max-width: 44ch;
  margin: 18px 0 32px;
  color: var(--color-text-muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 14px;
  max-width: 100%;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px var(--page-gutter) 40px;
  box-sizing: content-box;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Scroll reveal: only hidden when scripts run, so the page still shows without JavaScript. */

.scripts-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out),
    filter 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.scripts-enabled [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

@media (max-width: 760px) {
  /* Blurring the animated background behind the header every frame is too costly on phones. */
  .header-bar {
    background: rgba(14, 15, 18, 0.94);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .bento,
  .card-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-icon {
    margin-bottom: 32px;
  }

  .code-sample {
    padding: 16px;
    font-size: 11.5px;
  }
}

@media (max-width: 560px) {
  .site-nav a:not(.nav-cta) {
    display: none;
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .glow-orb {
    animation: none;
  }

  .scripts-enabled [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
