/* ============================================
   SRCL Theme for dev.page
   Adapted from sacred.computer components
   ============================================ */

/* --------------------------------------------
   CSS Custom Properties
   -------------------------------------------- */
:root {
  /* Base colors */
  --color-black: rgba(0, 0, 0, 1);
  --color-white: rgba(255, 255, 255, 1);
  --color-gray-10: rgba(244, 244, 244, 1);
  --color-gray-20: rgba(224, 224, 224, 1);
  --color-gray-30: rgba(198, 198, 198, 1);
  --color-gray-40: rgba(168, 168, 168, 1);
  --color-gray-50: rgba(141, 141, 141, 1);
  --color-gray-60: rgba(111, 111, 111, 1);
  --color-gray-70: rgba(82, 82, 82, 1);
  --color-gray-80: rgba(57, 57, 57, 1);
  --color-gray-90: rgba(38, 38, 38, 1);

  /* Accent colors */
  --color-neon-green: rgba(92, 255, 59, 1);
  --color-neon-green-subdued: rgba(92, 255, 59, 0.5);
  --color-daybreak: rgba(239, 99, 0, 1);
  --color-daybreak-subdued: rgba(239, 99, 0, 0.5);

  /* Typography */
  --font-family-mono: 'SF Mono', 'Consolas', 'Monaco', 'Menlo', monospace;
  --font-size: 16px;
  --line-height: 1.5;
  --line-height-computed: calc(var(--line-height) * 1rem);

  /* Spacing */
  --spacing-unit: 1rem;
  --content-width: 88ch;

  /* Z-index scale */
  --z-index-grid: 0;
  --z-index-content: 1;
  --z-index-action-bar: 10;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --theme-background: var(--color-black);
  --theme-background-card: rgba(10, 10, 10, 1);
  --theme-text: var(--color-white);
  --theme-text-muted: var(--color-gray-50);
  --theme-border: var(--color-gray-80);
  --theme-border-subdued: rgba(82, 82, 82, 0.3);
  --theme-button: var(--color-white);
  --theme-button-text: var(--color-black);
  --theme-button-foreground: var(--color-gray-90);
  --theme-button-background: var(--color-gray-80);
  --theme-focused: var(--color-daybreak);
  --theme-focused-subdued: var(--color-daybreak-subdued);
}

/* Light theme */
[data-theme="light"] {
  --theme-background: var(--color-white);
  --theme-background-card: var(--color-gray-10);
  --theme-text: var(--color-black);
  --theme-text-muted: var(--color-gray-60);
  --theme-border: var(--color-gray-20);
  --theme-border-subdued: rgba(168, 168, 168, 0.2);
  --theme-button: var(--color-black);
  --theme-button-text: var(--color-white);
  --theme-button-foreground: var(--color-gray-30);
  --theme-button-background: var(--color-gray-20);
  --theme-focused: var(--color-neon-green);
  --theme-focused-subdued: var(--color-neon-green-subdued);
}

/* --------------------------------------------
   Reset & Base Styles
   -------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size);
  scroll-behavior: smooth;
}

body {
  background: var(--theme-background);
  color: var(--theme-text);
  font-family: var(--font-family-mono);
  font-size: 1rem;
  line-height: var(--line-height);
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 1ch;
  height: var(--line-height-computed);
}

::-webkit-scrollbar-track {
  background: var(--theme-background);
}

::-webkit-scrollbar-thumb {
  background: var(--theme-border);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-text-muted);
}

/* --------------------------------------------
   Typography
   -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  font-family: var(--font-family-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
h3 { font-size: 1rem; }

p {
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

a {
  color: var(--theme-text);
  text-decoration: none;
  background: var(--theme-border-subdued);
  transition: background 200ms ease;
}

a:hover,
a:focus {
  background: var(--theme-focused);
  outline: none;
}

/* --------------------------------------------
   Grid Overlay
   -------------------------------------------- */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: var(--z-index-grid);
  background-image:
    linear-gradient(to right, var(--theme-border-subdued) 1px, transparent 1px),
    linear-gradient(to bottom, var(--theme-border-subdued) 1px, transparent 1px);
  background-size: 1ch var(--line-height-computed);
  opacity: 0.5;
}

/* --------------------------------------------
   Action Bar
   -------------------------------------------- */
.srcl-action-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-index-action-bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--theme-background);
  border-bottom: 2px solid var(--theme-text);
  padding: 0 2ch;
  height: calc(var(--line-height-computed) * 2);
}

.srcl-action-bar .primary {
  display: flex;
  gap: 0;
}

.srcl-action-bar .primary a {
  background: transparent;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  padding: calc(var(--line-height-computed) * 0.25) 2ch;
  border: 1px solid var(--theme-border);
  border-right: none;
}

.srcl-action-bar .primary a:last-child {
  border-right: 1px solid var(--theme-border);
}

.srcl-action-bar .primary a:hover,
.srcl-action-bar .primary a.active {
  background: var(--theme-focused);
  border-color: var(--theme-focused);
}

.srcl-action-bar .secondary {
  display: flex;
  gap: 1ch;
}

.srcl-action-bar .hotkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  font-family: var(--font-family-mono);
  font-size: 0.875rem;
  padding: calc(var(--line-height-computed) * 0.25) 1.5ch;
  cursor: pointer;
  user-select: none;
  min-width: 4ch;
}

.srcl-action-bar .hotkey:hover {
  background: var(--theme-focused);
  border-color: var(--theme-focused);
}

.srcl-action-bar .hotkey .key {
  font-size: 0.75rem;
}

/* --------------------------------------------
   Main Content
   -------------------------------------------- */
.content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: calc(var(--line-height-computed) * 4) 2ch calc(var(--line-height-computed) * 2);
}

.section {
  margin-bottom: calc(var(--line-height-computed) * 2);
}

.section-title {
  margin-bottom: var(--line-height-computed);
  padding-bottom: calc(var(--line-height-computed) * 0.25);
  border-bottom: 2px solid var(--theme-text);
}

/* --------------------------------------------
   SRCL Card
   -------------------------------------------- */
.srcl-card {
  position: relative;
  background: var(--theme-background);
  margin-bottom: var(--line-height-computed);
}

.srcl-card .card-content {
  box-shadow:
    inset 2px 0 0 0 var(--theme-text),
    inset -2px 0 0 0 var(--theme-text),
    inset 0 -2px 0 0 var(--theme-text),
    inset 0 2px 0 0 var(--theme-text);
  padding: calc(var(--line-height-computed) * 0.5) 2ch var(--line-height-computed);
}

/* Card corners - MS-DOS style decorative borders */
.srcl-card .card-corner {
  position: absolute;
  width: 2ch;
  height: calc(var(--line-height-computed) * 0.5);
}

.srcl-card .card-corner.top-left {
  top: 0;
  left: 0;
  box-shadow:
    inset 2px 0 0 0 var(--theme-text),
    inset 0 2px 0 0 var(--theme-text);
}

.srcl-card .card-corner.top-right {
  top: 0;
  right: 0;
  box-shadow:
    inset -2px 0 0 0 var(--theme-text),
    inset 0 2px 0 0 var(--theme-text);
}

.srcl-card .card-corner.bottom-left {
  bottom: 0;
  left: 0;
  box-shadow:
    inset 2px 0 0 0 var(--theme-text),
    inset 0 -2px 0 0 var(--theme-text);
}

.srcl-card .card-corner.bottom-right {
  bottom: 0;
  right: 0;
  box-shadow:
    inset -2px 0 0 0 var(--theme-text),
    inset 0 -2px 0 0 var(--theme-text);
}

/* --------------------------------------------
   Hero Section
   -------------------------------------------- */
.hero-card {
  margin-bottom: calc(var(--line-height-computed) * 2);
}

.hero-card .name {
  font-size: 1.5rem;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.hero-card .title {
  color: var(--theme-text-muted);
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.hero-card .location {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--line-height-computed);
}

.hero-card .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2ch;
  margin-bottom: var(--line-height-computed);
}

.hero-card .contact-link {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-card .bio {
  white-space: pre-wrap;
  line-height: var(--line-height);
}

/* --------------------------------------------
   Accordion
   -------------------------------------------- */
.srcl-accordion {
  border: 2px solid var(--theme-text);
}

.accordion-item {
  border-bottom: 1px solid var(--theme-border);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: calc(var(--line-height-computed) * 0.5) 2ch;
  background: transparent;
  border: none;
  color: var(--theme-text);
  font-family: var(--font-family-mono);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background 200ms ease;
}

.accordion-header:hover {
  background: var(--theme-focused);
}

.accordion-header .company,
.accordion-header .institution {
  font-weight: 400;
  text-transform: uppercase;
}

.accordion-header .meta {
  display: flex;
  gap: 2ch;
  color: var(--theme-text-muted);
  font-size: 0.875rem;
}

.accordion-header .accordion-icon {
  flex-shrink: 0;
  width: 2ch;
  text-align: center;
  user-select: none;
}

.accordion-content {
  display: none;
  padding: 0 2ch var(--line-height-computed) 4ch;
}

.accordion-item[data-expanded="true"] .accordion-content {
  display: block;
}

.accordion-item[data-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content .location {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

/* --------------------------------------------
   SRCL List
   -------------------------------------------- */
.srcl-list {
  list-style: none;
  padding-left: 2ch;
}

.srcl-list li {
  position: relative;
  padding-left: 2ch;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.srcl-list li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--theme-text);
}

/* --------------------------------------------
   Project Grid
   -------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28ch, 1fr));
  gap: var(--line-height-computed);
}

.project-card {
  height: 100%;
}

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

.project-card.featured .card-content {
  background: var(--theme-background-card);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.project-name {
  text-transform: uppercase;
}

.project-link {
  font-size: 0.875rem;
  text-transform: uppercase;
}

.project-description {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1ch;
}

.tag {
  font-size: 0.75rem;
  padding: 0 1ch;
  background: var(--theme-border-subdued);
  text-transform: uppercase;
}

/* --------------------------------------------
   Data Table
   -------------------------------------------- */
.srcl-data-table {
  width: 100%;
  overflow-x: auto;
}

.srcl-data-table table {
  width: 100%;
  max-width: var(--content-width);
  border-collapse: collapse;
  border-spacing: 0;
}

.srcl-data-table thead tr {
  border-bottom: 2px solid var(--theme-text);
}

.srcl-data-table th {
  text-align: left;
  font-weight: 400;
  padding: calc(var(--line-height-computed) * 0.25) 2ch calc(var(--line-height-computed) * 0.25) 0;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.srcl-data-table td {
  padding: calc(var(--line-height-computed) * 0.25) 2ch calc(var(--line-height-computed) * 0.25) 0;
  vertical-align: top;
}

.srcl-data-table tbody tr {
  border-bottom: 1px solid var(--theme-border);
}

.srcl-data-table tbody tr:last-child {
  border-bottom: none;
}

.srcl-data-table tbody tr:hover {
  background: var(--theme-focused-subdued);
}

.srcl-data-table .category {
  text-transform: uppercase;
  font-size: 0.875rem;
  white-space: nowrap;
}

.srcl-data-table .skills {
  color: var(--theme-text-muted);
}

/* --------------------------------------------
   Writing List
   -------------------------------------------- */
.writing-list {
  padding-left: 0;
}

.writing-item {
  padding-left: 0;
  margin-bottom: var(--line-height-computed);
  border-bottom: 1px solid var(--theme-border);
  padding-bottom: var(--line-height-computed);
}

.writing-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.writing-item::before {
  display: none;
}

.writing-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1ch;
}

.writing-title {
  font-weight: 400;
}

.writing-date {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
}

.writing-description {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-top: calc(var(--line-height-computed) * 0.25);
  margin-bottom: 0;
}

/* --------------------------------------------
   Footer
   -------------------------------------------- */
.srcl-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--line-height-computed) 2ch calc(var(--line-height-computed) * 2);
  border-top: 1px solid var(--theme-border);
  text-align: center;
  color: var(--theme-text-muted);
  font-size: 0.875rem;
}

.srcl-footer a {
  color: var(--theme-text-muted);
}

/* --------------------------------------------
   Animations
   -------------------------------------------- */
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes flash {
  0% { background-color: var(--theme-focused-subdued); }
  100% { background-color: transparent; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Subtle scanline effect (optional) */
.srcl-theme::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--theme-focused-subdued),
    transparent
  );
  opacity: 0.1;
  pointer-events: none;
  animation: scanline 8s linear infinite;
  z-index: 9999;
}

/* Disable scanline animation if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .srcl-theme::after {
    animation: none;
    display: none;
  }
}

/* --------------------------------------------
   Responsive
   -------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --font-size: 14px;
  }

  .srcl-action-bar {
    flex-wrap: wrap;
    height: auto;
    padding: calc(var(--line-height-computed) * 0.5) 1ch;
    gap: calc(var(--line-height-computed) * 0.25);
  }

  .srcl-action-bar .primary {
    flex-wrap: wrap;
  }

  .srcl-action-bar .primary a {
    padding: calc(var(--line-height-computed) * 0.15) 1ch;
    font-size: 0.75rem;
  }

  .srcl-action-bar .secondary {
    display: none;
  }

  .content {
    padding: calc(var(--line-height-computed) * 3) 1ch calc(var(--line-height-computed) * 2);
  }

  .accordion-header {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--line-height-computed) * 0.25);
  }

  .accordion-header .meta {
    flex-direction: column;
    gap: 0;
  }

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

  .hero-card .contact-links {
    flex-direction: column;
    gap: calc(var(--line-height-computed) * 0.25);
  }

  .writing-header {
    flex-direction: column;
    gap: 0;
  }
}

/* --------------------------------------------
   SRCL Hero (Standalone)
   -------------------------------------------- */
.srcl-hero {
  margin-bottom: calc(var(--line-height-computed) * 3);
}

.srcl-hero .name {
  font-size: 1.5rem;
  text-transform: uppercase;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.srcl-hero .title {
  color: var(--theme-text-muted);
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.srcl-hero .location {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--line-height-computed);
}

.srcl-hero .timezone {
  opacity: 0.7;
}

.srcl-hero .bio {
  margin-bottom: var(--line-height-computed);
}

.srcl-hero .bio p {
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.srcl-hero .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2ch;
}

.srcl-hero .contact-link {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------
   SRCL Section (Generic)
   -------------------------------------------- */
.srcl-section {
  margin-bottom: calc(var(--line-height-computed) * 3);
}

.srcl-section .section-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--line-height-computed);
  padding-bottom: calc(var(--line-height-computed) * 0.25);
  border-bottom: 2px solid var(--theme-text);
}

.view-all {
  display: inline-block;
  margin-top: var(--line-height-computed);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------
   Projects Grid (Multi-page)
   -------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30ch, 1fr));
  gap: calc(var(--line-height-computed) * 1.5);
}

.projects-grid.full-width {
  grid-template-columns: repeat(auto-fit, minmax(35ch, 1fr));
}

.projects-grid .project-card {
  display: block;
  background: transparent;
  border: 2px solid var(--theme-border);
  transition: border-color 200ms ease, background 200ms ease;
}

.projects-grid .project-card:hover {
  border-color: var(--theme-focused);
  background: var(--theme-focused-subdued);
}

.projects-grid .project-card.featured {
  border-color: var(--theme-text);
}

.projects-grid .project-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--theme-border);
  background: var(--theme-background-card);
}

.projects-grid .project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: opacity 200ms ease;
}

.projects-grid .project-card:hover .project-thumbnail img {
  opacity: 1;
}

.projects-grid .project-info {
  padding: calc(var(--line-height-computed) * 0.75) 2ch;
}

.projects-grid .project-info h3 {
  text-transform: uppercase;
  font-size: 1rem;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.projects-grid .project-info .subtitle {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.projects-grid .project-meta {
  display: flex;
  gap: 2ch;
  color: var(--theme-text-muted);
  font-size: 0.75rem;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.projects-grid .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5ch;
}

.tech-tags .tag {
  font-size: 0.625rem;
  padding: 0 0.75ch;
  background: var(--theme-border-subdued);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* --------------------------------------------
   Experiments Grid
   -------------------------------------------- */
.experiments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28ch, 1fr));
  gap: var(--line-height-computed);
}

.experiment-card {
  border: 1px solid var(--theme-border);
  padding: calc(var(--line-height-computed) * 0.75) 2ch;
}

.experiment-card h3 {
  text-transform: uppercase;
  font-size: 0.875rem;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.experiment-card p {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.experiment-card .experiment-links {
  display: flex;
  gap: 2ch;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

/* --------------------------------------------
   Page Header
   -------------------------------------------- */
.page-header {
  margin-bottom: calc(var(--line-height-computed) * 2);
}

.page-header h1 {
  text-transform: uppercase;
  font-size: 1.5rem;
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.page-header .page-description {
  color: var(--theme-text-muted);
  font-size: 0.875rem;
}

/* --------------------------------------------
   Project Page
   -------------------------------------------- */
.project-page .project-header {
  display: block;
  margin-bottom: calc(var(--line-height-computed) * 2);
}

.project-page .project-hero {
  margin-bottom: var(--line-height-computed);
  border: 2px solid var(--theme-border);
}

.project-page .project-hero img {
  width: 100%;
  display: block;
}

.project-page .project-intro h1 {
  font-size: 1.5rem;
  text-transform: uppercase;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.project-page .project-intro .subtitle {
  color: var(--theme-text-muted);
  font-size: 1rem;
  margin-bottom: var(--line-height-computed);
}

.project-page .project-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12ch, 1fr));
  gap: var(--line-height-computed);
  margin-bottom: var(--line-height-computed);
  padding: var(--line-height-computed) 0;
  border-top: 1px solid var(--theme-border);
  border-bottom: 1px solid var(--theme-border);
}

.project-page .meta-item {
  display: flex;
  flex-direction: column;
  gap: calc(var(--line-height-computed) * 0.25);
}

.project-page .meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted);
}

.project-page .meta-value {
  font-size: 0.875rem;
}

.project-page .tech-stack {
  margin-bottom: var(--line-height-computed);
}

.project-page .tech-stack .tech-tags {
  margin-top: calc(var(--line-height-computed) * 0.25);
}

.project-page .project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2ch;
}

.project-page .project-link {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: calc(var(--line-height-computed) * 0.25) 1.5ch;
  border: 1px solid var(--theme-border);
}

.project-page .project-link:hover {
  border-color: var(--theme-focused);
}

/* Project Content */
.project-content {
  margin-bottom: calc(var(--line-height-computed) * 2);
}

/* Project Navigation */
.project-nav {
  padding-top: var(--line-height-computed);
  border-top: 1px solid var(--theme-border);
}

.project-nav .back-link {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------
   Content Sections
   -------------------------------------------- */
.content-section {
  margin-bottom: calc(var(--line-height-computed) * 2);
}

.content-section .section-subtitle {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--line-height-computed);
  color: var(--theme-text-muted);
}

/* Prose (markdown content) */
.prose {
  line-height: var(--line-height);
}

.prose h2 {
  font-size: 1rem;
  text-transform: uppercase;
  margin-top: calc(var(--line-height-computed) * 1.5);
  margin-bottom: calc(var(--line-height-computed) * 0.5);
}

.prose h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  margin-top: var(--line-height-computed);
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.prose p {
  margin-bottom: var(--line-height-computed);
}

.prose ul,
.prose ol {
  margin-bottom: var(--line-height-computed);
  padding-left: 3ch;
}

.prose li {
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font-family: var(--font-family-mono);
  background: var(--theme-border-subdued);
  padding: 0 0.5ch;
}

/* Metrics Section */
.section-metrics .metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12ch, 1fr));
  gap: var(--line-height-computed);
  padding: var(--line-height-computed);
  border: 2px solid var(--theme-text);
}

.section-metrics .metric {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.section-metrics .metric-value {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: calc(var(--line-height-computed) * 0.25);
}

.section-metrics .metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted);
}

/* Image Section */
.section-image {
  border: 2px solid var(--theme-border);
}

.section-image img {
  width: 100%;
  display: block;
}

.section-image figcaption {
  padding: calc(var(--line-height-computed) * 0.5) 2ch;
  font-size: 0.875rem;
  color: var(--theme-text-muted);
  border-top: 1px solid var(--theme-border);
}

/* Gallery Section */
.section-gallery .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(25ch, 1fr));
  gap: var(--line-height-computed);
}

.section-gallery .gallery-item {
  border: 1px solid var(--theme-border);
}

.section-gallery .gallery-item img {
  width: 100%;
  display: block;
}

.section-gallery .gallery-item figcaption {
  padding: calc(var(--line-height-computed) * 0.5) 1.5ch;
  font-size: 0.75rem;
  color: var(--theme-text-muted);
  border-top: 1px solid var(--theme-border);
}

/* Code Section */
.section-code .code-block {
  border: 2px solid var(--theme-border);
  overflow-x: auto;
}

.section-code pre {
  margin: 0;
  padding: var(--line-height-computed) 2ch;
  font-size: 0.875rem;
  line-height: 1.6;
}

.section-code code {
  font-family: var(--font-family-mono);
  background: transparent;
}

/* Demo Section */
.section-demo .demo-embed {
  border: 2px solid var(--theme-border);
}

.section-demo video,
.section-demo iframe {
  width: 100%;
  display: block;
}

/* Interactive Section */
.section-interactive .interactive-embed {
  border: 2px solid var(--theme-border);
  aspect-ratio: 16 / 9;
}

.section-interactive iframe {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------
   Responsive (Multi-page additions)
   -------------------------------------------- */
@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-page .project-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-metrics .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-gallery .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  .srcl-action-bar,
  .grid-overlay,
  .srcl-theme::after {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .content {
    padding-top: 0;
  }

  a {
    background: none;
    text-decoration: underline;
  }
}
