@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-display: "Inter Tight", Arial, sans-serif;
  --font-body: "Geist", Arial, sans-serif;
  --font-mono: "Geist Mono", Consolas, monospace;
  --page-bg: #070707;
  --text: #f2f2ee;
  --line: #303030;
  --muted: #9d9d98;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --frame-edge: 0.875rem;
  --frame-top: var(--frame-edge);
  --frame-right: var(--frame-edge);
  --frame-bottom: var(--frame-edge);
  --frame-left: 1.75rem;
  --border: 1px solid var(--line);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --page-bg: #f4f4f0;
  --text: #090909;
  --line: #c8c8c2;
  --muted: #60605b;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --page-bg: #070707;
  --text: #f2f2ee;
  --line: #303030;
  --muted: #9d9d98;
  color-scheme: dark;
}

:root[data-font="monospaced"] {
  --font-display: var(--font-mono);
  --font-body: var(--font-mono);
}

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

html {
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  overscroll-behavior-y: none;
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  overscroll-behavior-y: none;
  background: var(--page-bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  transition: background-color 160ms ease, color 160ms ease;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  font: inherit;
}

.page-frame {
  position: fixed;
  z-index: 20;
  inset: var(--frame-top) var(--frame-right) var(--frame-bottom) var(--frame-left);
  border: var(--border);
  pointer-events: none;
}

.frame-mask {
  position: fixed;
  z-index: 19;
  display: block;
  background: var(--page-bg);
  pointer-events: none;
}

.frame-mask--top {
  inset: 0 0 auto;
  height: var(--frame-top);
}

.frame-mask--right {
  inset: var(--frame-top) 0 var(--frame-bottom) auto;
  width: var(--frame-right);
}

.frame-mask--bottom {
  inset: auto 0 0;
  height: var(--frame-bottom);
}

.frame-mask--left {
  inset: var(--frame-top) auto var(--frame-bottom) 0;
  width: var(--frame-left);
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 1rem;
  padding: 0.65rem 0.9rem;
  background: var(--text);
  color: var(--page-bg);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: 100%;
  min-height: 100svh;
  padding: clamp(2rem, 4vw, 3.75rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.wordmark:hover,
.wordmark:focus-visible,
.contact-links a:hover,
.contact-links a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 400;
}

.nav-link:hover,
.nav-link:focus-visible {
  opacity: 0.65;
}

.nav-link.is-active {
  font-weight: 600;
}

.nav-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
}

.home {
  display: flex;
  align-items: center;
  padding-block: clamp(4.5rem, 10vh, 8rem);
}

.hero {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(16rem, 1.5fr) minmax(16rem, 0.9fr);
  grid-template-areas:
    "heading copy"
    "heading meta";
  gap: clamp(2.25rem, 7vw, 7rem);
  align-items: end;
}

.hero-heading {
  grid-area: heading;
}

.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

h1 {
  max-width: 8ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 4.5vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.hero-copy {
  grid-area: copy;
  max-width: 35rem;
  padding-top: var(--space-6);
  border-top: var(--border);
}

.hero-copy p {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.55;
}

.hero-meta {
  grid-area: meta;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  margin: 0;
}

.hero-meta div {
  padding-top: var(--space-3);
  border-top: var(--border);
}

.hero-meta dt,
.hero-meta dd {
  margin: 0;
}

.hero-meta dt {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.hero-meta dd {
  font-size: 0.9rem;
  font-weight: 400;
}

.site-footer {
  position: relative;
  min-height: 5.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-top: var(--space-4);
}

.preset-panel {
  position: fixed;
  z-index: 30;
  left: var(--frame-left);
  bottom: calc(var(--frame-bottom) + 0.6rem);
}

.preset-controls {
  display: flex;
  gap: 1rem;
  white-space: nowrap;
  transform: rotate(-90deg);
  transform-origin: left bottom;
}

.preset-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.preset-button:hover,
.preset-button:focus-visible {
  color: var(--text);
}

.preset-button[aria-pressed="true"] {
  color: var(--text);
  font-weight: 600;
}

.preset-square {
  width: 0.48rem;
  height: 0.48rem;
  border: 1px solid currentColor;
}

.preset-button[aria-pressed="true"] .preset-square {
  background: currentColor;
}

.copyright {
  position: fixed;
  z-index: 30;
  left: var(--frame-left);
  bottom: max(0.12rem, env(safe-area-inset-bottom));
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
}

.contact-links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  font-size: 0.8rem;
}

.projects-main {
  width: min(100%, 45rem);
  margin-inline: auto;
  padding-block: clamp(5rem, 11vh, 8.5rem);
}

.projects-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-5);
  padding-bottom: var(--space-6);
  border-bottom: var(--border);
}

.projects-header h1 {
  max-width: none;
}

.projects-count {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.project-group {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: var(--space-5);
  padding-block: var(--space-6);
}

.project-group-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-item {
  position: relative;
  padding: 0 0 var(--space-5) 1.2rem;
}

.project-item + .project-item {
  padding-top: var(--space-5);
  border-top: var(--border);
}

.project-item::before {
  content: "";
  position: absolute;
  top: 0.62rem;
  left: 0;
  width: 0.32rem;
  height: 0.32rem;
  background: currentColor;
}

.project-item + .project-item::before {
  top: calc(var(--space-5) + 0.62rem);
}

.project-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.project-item h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.25;
}

.project-item h2 a {
  display: inline-block;
  transition: transform 140ms ease;
}

.project-item h2 a:hover,
.project-item h2 a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transform: translateX(0.2rem);
}

.project-demo {
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
}

.project-demo:hover,
.project-demo:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.project-description {
  max-width: 38rem;
  margin: var(--space-3) 0 0;
  font-size: 1rem;
}

.project-stack {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.3rem;
}

@media (max-width: 720px) {
  :root {
    --frame-edge: 0.875rem;
    --frame-top: var(--frame-edge);
    --frame-right: var(--frame-edge);
    --frame-bottom: calc(var(--frame-edge) + env(safe-area-inset-bottom));
    --frame-left: 1.75rem;
  }

  .site-shell {
    padding: 1.5rem 1.5rem calc(3.5rem + env(safe-area-inset-bottom)) 3.15rem;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "copy"
      "meta";
    gap: var(--space-6);
  }

  .hero-copy {
    padding-top: var(--space-4);
  }

  .site-footer {
    min-height: 0;
    display: grid;
    justify-items: start;
    gap: var(--space-5);
    padding-top: var(--space-6);
    border-top: var(--border);
  }

  .preset-panel {
    left: var(--frame-left);
    bottom: calc(var(--frame-bottom) + 0.55rem);
  }

  .preset-controls {
    gap: 0.75rem;
  }

  .preset-button,
  .copyright {
    font-size: 0.68rem;
  }

  .contact-links {
    order: 1;
  }

  .projects-main {
    padding-block: 5rem;
  }

  .projects-header {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .project-group {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

@media (max-width: 430px) {
  .site-header {
    align-items: center;
  }

  .wordmark {
    max-width: 5rem;
    line-height: 1.15;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .project-title-row {
    display: block;
  }

  .project-demo {
    display: inline-block;
    margin-top: var(--space-2);
  }
}

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