:root {
  --bg: #0b1020;
  --paper: rgba(16, 22, 39, 0.9);
  --paper-strong: rgba(10, 15, 29, 0.96);
  --ink: #f4efe7;
  --muted: #b7bfd3;
  --line: rgba(204, 214, 255, 0.12);
  --accent: #7be0c3;
  --accent-soft: rgba(123, 224, 195, 0.14);
  --highlight: #ffad87;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

html[data-theme="light"] {
  --bg: #c9c2b8;
  --paper: rgba(210, 204, 196, 0.92);
  --paper-strong: rgba(206, 200, 192, 0.97);
  --ink: #1a1816;
  --muted: #565049;
  --line: rgba(26, 24, 22, 0.15);
  --accent: #0d6b5d;
  --accent-soft: #c4d8d4;
  --highlight: #bf5b3d;
  --shadow: 0 24px 60px rgba(50, 38, 23, 0.2);
}

* {
  box-sizing: border-box;
}

/* Scrollbar */
html {
  background: var(--bg);
}

html,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(204, 214, 255, 0.2) transparent;
}

html[data-theme="light"],
html[data-theme="light"] body {
  scrollbar-color: rgba(26, 24, 22, 0.2) transparent;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(204, 214, 255, 0.2);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(204, 214, 255, 0.35);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(26, 24, 22, 0.2);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 24, 22, 0.35);
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 173, 135, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(123, 224, 195, 0.16), transparent 24%),
    linear-gradient(180deg, #070b16 0%, #0b1020 48%, #121a2f 100%);
  min-height: 100dvh;
}

body {
  transition: opacity 320ms ease, background 320ms ease;
}

.page {
  transition: opacity 320ms ease, transform 320ms ease, filter 320ms ease;
}

html[data-page-state="enter"] body,
html[data-page-state="exit"] body {
  opacity: 0;
}

html[data-page-state="enter"] .page,
html[data-page-state="exit"] .page {
  transform: translateY(26px) scale(0.985);
  filter: blur(12px);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(191, 91, 61, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(13, 107, 93, 0.1), transparent 28%),
    linear-gradient(180deg, #c1bab0 0%, #cac3b9 48%, #c6bfb5 100%);
}

a {
  color: inherit;
}

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 88px 0 72px;
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 10;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 15, 29, 0.72);
  color: var(--ink);
  box-shadow: var(--shadow);
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

html[data-theme="light"] .theme-toggle {
  background: rgba(255, 252, 247, 0.88);
}

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

.theme-toggle:focus-visible {
  transform: translateY(-2px);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -4% -24% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(13, 107, 93, 0.09);
  filter: blur(2px);
}

.eyebrow,
.section-label {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--highlight);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 9ch;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.06em;
}

h2 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: end;
  z-index: 1;
}

.intro {
  margin-top: 18px;
  max-width: 28rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.meta-card {
  width: 100%;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

html[data-theme="light"] .meta-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(26, 24, 22, 0.08);
}

.meta-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.meta-card p {
  color: var(--muted);
  line-height: 1.6;
}

.links,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.links {
  margin-top: 26px;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.button {
  background: var(--ink);
  color: #07111f;
}

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

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

html[data-theme="light"] .button-secondary {
  background: transparent;
}

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

.button:focus-visible,
.button-secondary:focus-visible {
  transform: translateY(-2px);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.section {
  margin-top: 48px;
  padding: 36px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.section-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 32px;
}

.section-header p {
  max-width: 44rem;
  color: var(--muted);
  line-height: 1.65;
}

.summary-card {
  margin-top: 0;
  padding: 24px;
}

.summary-top {
  display: block;
}

.summary-description,
.text-link,
.summary-chip,
.footer p {
  color: var(--muted);
}

.summary-description {
  margin-top: 10px;
  max-width: 22rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.summary-meta-item {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-feature {
  margin-top: 18px;
}

.summary-feature p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.summary-project-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.summary-project-item {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

html[data-theme="light"] .summary-project-item {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(26, 24, 22, 0.09);
}

.summary-project-copy p {
  margin-top: 8px;
}

.summary-project-item p {
  color: var(--muted);
  line-height: 1.55;
}

.summary-project-link {
  justify-self: start;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  padding-left: 0;
}

.summary-project-muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.summary-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

html[data-theme="light"] .summary-chip {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(26, 24, 22, 0.08);
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
}

.text-link {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.project-card {
  grid-column: span 6;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(22, 31, 54, 0.9), rgba(11, 17, 32, 0.98));
  border: 1px solid var(--line);
}

.project-card.featured {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: end;
  background: linear-gradient(135deg, rgba(123, 224, 195, 0.12), rgba(18, 26, 47, 0.96));
}

html[data-theme="light"] .project-card {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(26, 24, 22, 0.09);
}

html[data-theme="light"] .project-card.featured {
  background: linear-gradient(135deg, rgba(13, 107, 93, 0.1), rgba(255, 255, 255, 0.42));
}

.project-type {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card p,
.featured-note,
.footer p {
  color: var(--muted);
  line-height: 1.65;
}

.project-links {
  margin-top: 18px;
  gap: 10px;
}

.project-links a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.detail-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.detail-list-item + .detail-list-item {
  margin-top: 12px;
}

.project-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 8, 16, 0.5);
  opacity: 0;
  transition: opacity 260ms ease;
  backdrop-filter: blur(10px);
}

.project-panel {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 21;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 260ms ease, transform 260ms ease;
  backdrop-filter: blur(16px);
}

.project-panel-backdrop.is-visible {
  opacity: 1;
}

.project-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-panel-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.project-panel-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.project-panel-title {
  max-width: 14ch;
}

.project-panel-intro {
  margin-top: 12px;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.6;
}

.project-panel-close {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.project-panel-close:hover {
  transform: translateY(-2px);
}

.project-panel-close:focus-visible {
  transform: translateY(-2px);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-panel-section {
  margin-top: 20px;
}

.project-panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

body.project-panel-open {
  overflow: hidden;
}

.featured-note {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.hero-project h1 {
  max-width: 14ch;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 0.98;
}

.hero-project .intro {
  max-width: 40rem;
}

html[data-theme="light"] .featured-note {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(26, 24, 22, 0.08);
}

.footer {
  margin-top: 28px;
  padding: 24px 28px 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .hero-grid,
  .project-card.featured,
  .section-header {
    grid-template-columns: 1fr;
  }

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

  .project-panel-top {
    grid-template-columns: 1fr;
  }

  .project-card,
  .project-card.featured {
    grid-column: span 12;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .page,
  .theme-toggle,
  .button,
  .button-secondary,
  .project-panel-close,
  .project-panel-backdrop,
  .project-panel {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 1120px);
    padding-top: 76px;
  }

  .hero,
  .section {
    padding: 22px;
    border-radius: 24px;
  }

  .project-panel {
    inset: auto 12px 12px;
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 24px;
  }

  h1 {
    max-width: none;
  }
}
