/* ------------------------------
   Base
------------------------------ */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f5f2;
  --surface-strong: #ededeb;
  --surface-gradient-end: #dededa;
  --text: #171717;
  --muted: #666666;
  --border: #d9d9d4;
  --accent: #1d4ed8;
  --header-bg: rgb(255 255 255 / 92%);
  --inverse-text: #ffffff;
  --max-width: 1120px;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1a1c1f;
    --surface-strong: #24272b;
    --surface-gradient-end: #30343a;
    --text: #f2f3f5;
    --muted: #a9adb5;
    --border: #34383e;
    --accent: #8ab4ff;
    --header-bg: rgb(17 18 20 / 92%);
    --inverse-text: #111214;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

code {
  padding: 0.1rem 0.3rem;
  background: var(--surface-strong);
  border-radius: 4px;
  font-size: 0.9em;
}

/* ------------------------------
   Layout
------------------------------ */

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

.narrow {
  max-width: 760px;
}

.section {
  padding: 7rem 0;
}

.section-muted {
  background: var(--surface);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 4rem;
}

/* ------------------------------
   Accessibility
------------------------------ */

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--inverse-text);
  border-radius: 8px;
  transform: translateY(-200%);
}

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

/* ------------------------------
   Header / Navigation
------------------------------ */

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

.header-inner,
.footer-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-name {
  font-weight: 750;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-nav a,
.footer-inner a,
.contact-links a,
.text-link {
  text-underline-offset: 0.2em;
}

/* ------------------------------
   Typography
------------------------------ */

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 8vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.1;
}

h4 {
  margin-top: 2rem;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.eyebrow,
.project-number {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ------------------------------
   Hero
------------------------------ */

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: end;
}

.hero-copy {
  max-width: 750px;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.15rem;
  background: var(--text);
  color: var(--inverse-text);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.summary-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.summary-card h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

.summary-card ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

/* ------------------------------
   Projects
------------------------------ */

.project {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 88px;
}

.project:last-child {
  border-bottom: 1px solid var(--border);
}

.project:target {
  outline: 3px solid var(--accent);
  outline-offset: 12px;
  border-radius: 4px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.75rem;
}

.project-summary {
  max-width: 730px;
  color: var(--muted);
}

.anchor-link {
  align-self: flex-start;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  text-decoration: none;
}

.anchor-link:hover {
  color: var(--accent);
}

.project-content {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(3rem, 7vw, 6rem);
}

.project-content ul {
  padding-left: 1.2rem;
}

.screenshots {
  width: 100%;
  align-self: start;
}

/* For now, each project displays a single primary image. */
.screenshots > *:not(:first-child) {
  display: none;
}

.screenshots img,
.screenshot-placeholder {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
}

.screenshots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

.screenshots video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.screenshot-placeholder {
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
  min-height: 0;
  background:
    linear-gradient(135deg, var(--surface-strong), var(--surface-gradient-end));
  color: var(--muted);
  font-size: 0.9rem;
}

.technology-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin-top: 0.75rem;
  list-style: none;
}

.technology-list li {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Override the normal project list indentation */
.project-content .technology-list {
  padding-left: 0;
}

/* --------------------------------
   Text-only project
-------------------------------- */

.project--text-only .project-header {
  margin-bottom: 3rem;
}

.project--text-only .project-summary {
  max-width: 760px;
}

.project-meta {
  margin-top: 1.25rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-meta a {
  text-underline-offset: 0.2em;
}

.project-content--text {
  display: block;
  max-width: 920px;
}

.project-detail {
  margin-top: 2.75rem;
}

.project-detail:first-child {
  margin-top: 0;
}

.project-detail h4 {
  margin-top: 0;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 6vw, 5rem);
  margin-top: 3rem;
}

.project-detail-grid .project-detail {
  margin-top: 0;
}

.project-highlights {
  max-width: 700px;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 50em) {
  .project-detail-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .project-content--text {
    max-width: none;
  }
}

/* ------------------------------
   Contact / Footer
------------------------------ */

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  min-height: 90px;
}

.footer-inner p {
  margin-bottom: 0;
  color: var(--muted);
}

/* ------------------------------
   Responsive
------------------------------ */

@media (max-width: 800px) {
  .section {
    padding: 5rem 0;
  }

  .hero {
    min-height: auto;
    padding-top: 7rem;
  }

  .hero-grid,
  .project-content {
    grid-template-columns: 1fr;
  }

  .project-header {
    display: block;
  }

  .anchor-link {
    display: inline-block;
    margin-top: 1rem;
  }
}

@media (max-width: 560px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 0;
  }

  html {
    scroll-padding-top: 112px;
  }

  .project {
    scroll-margin-top: 112px;
  }

}

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

