* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f6f4ef;
  --text: #121212;
  --muted: #72706b;
  --border: #dfdbd2;
  --grid: rgba(120, 114, 104, 0.16);
  --accent: #6e87b5;
  --panel-padding-y: 24px;
  --panel-padding-x: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #f3efe7;
    --muted: #a49f96;
    --border: #2e2a25;
    --grid: rgba(210, 200, 186, 0.1);
    --accent: #6e87b5;
  }
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

.grid-bg,
.frame-lines {
  inset: 0;
  pointer-events: none;
  position: fixed;
}

.grid-bg {
  overflow: hidden;
  z-index: 0;
}

.grid-line {
  position: absolute;
  background: var(--grid);
  transition: opacity 0.2s ease;
}

.grid-line.vertical {
  bottom: 0;
  top: 0;
  width: 1px;
}

.grid-line.horizontal {
  height: 1px;
  left: 0;
  right: 0;
}

.frame-lines {
  opacity: 0;
  z-index: 2;
}

.frame-lines.is-aligned {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.line {
  background: var(--border);
  position: absolute;
}

.line-v {
  bottom: 0;
  top: 0;
  width: 1px;
}

.line-h {
  height: 1px;
  left: 0;
  right: 0;
}

.viewport {
  inset: 0;
  pointer-events: none;
  position: fixed;
}

@media (min-width: 769px) {
  .viewport {
    align-items: center;
    display: flex;
    justify-content: center;
  }

  .panel {
    max-width: 624px;
    width: 100%;
  }
}

.panel {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: center;
  padding: var(--panel-padding-y) var(--panel-padding-x);
  pointer-events: auto;
  z-index: 3;
}

.brand {
  display: flex;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
}

.brand-title {
  align-items: center;
  cursor: default;
  display: flex;
  gap: 10px;
}

.brand-icon-scene {
  display: inline-flex;
  flex-shrink: 0;
  height: 1.1em;
  perspective: 700px;
  width: 1.1em;
}

.brand-icon-wrap {
  display: inline-flex;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  width: 100%;
  will-change: transform;
}

.brand-icon {
  display: block;
  height: 100%;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .brand-icon:not(.is-entered) {
    animation: brand-icon-enter 0.65s cubic-bezier(0.34, 1.25, 0.64, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-icon:not(.is-entered) {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  .brand-icon:not(.is-entered) {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@keyframes brand-icon-enter {
  from {
    opacity: 0;
    transform: scale(0.78);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.eyebrow,
.hero-lead,
.section p,
.links a,
.footer,
.quote,
.quote cite {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-lead {
  color: var(--text);
  font-size: 1.12rem;
  letter-spacing: -0.025em;
  line-height: 1.35;
  margin-top: 10px;
  max-width: 28ch;
}

.eyebrow {
  margin-top: 5px;
}

.works {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding-top: 20px;
}

.works-panel > .works {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.works-heading {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.work-row {
  align-items: baseline;
  color: inherit;
  display: grid;
  gap: 10px 12px;
  grid-template-columns: 1.4rem 1fr auto;
  padding: 6px 0;
  text-decoration: none;
}

a.work-row:hover .work-name {
  color: var(--accent);
}

.work-row--static {
  color: inherit;
}

.work-index {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.work-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.work-name {
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.work-desc {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-tag {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
}

.work-tag--progress,
.work-tag--in-progress {
  color: #7fc58a;
}

.work-tag--experiment {
  color: #d6ad62;
}

.work-tag--archived {
  color: var(--muted);
}

.works-more {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.works-more a {
  color: var(--muted);
  text-decoration: none;
}

.works-more a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ——— Works page ——— */

.works-page {
  --grid: rgba(120, 114, 104, 0.055);
  min-height: 100vh;
  position: relative;
}

@media (prefers-color-scheme: dark) {
  .works-page {
    --grid: rgba(210, 200, 186, 0.035);
  }
}

.works-page .grid-bg {
  height: 100%;
  opacity: 0.85;
  position: absolute;
  top: 0;
  width: 100%;
}

.works-viewport {
  margin: 0 auto;
  max-width: min(672px, 92vw);
  padding: 56px 24px 120px;
  position: relative;
  z-index: 3;
}

.works-panel {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.works-hero {
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 28px;
  position: relative;
}

.works-page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.works-back {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  width: fit-content;
}

.works-back:hover {
  color: var(--accent);
}

.works-page-title {
  align-items: center;
  display: flex;
  font-size: 2rem;
  font-weight: 600;
  gap: 10px;
  letter-spacing: -0.03em;
}

.works-page-lead {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 36ch;
}

.works-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
}

.works-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.works-stat dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.works-stat dd {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.works-toolbar {
  align-items: center;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: space-between;
  padding: 10px 14px;
  position: sticky;
  top: 16px;
  z-index: 4;
}

.works-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.works-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  text-transform: lowercase;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.works-filter-btn:hover {
  border-color: var(--border);
  color: var(--text);
}

.works-filter-btn.is-active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--accent);
  font-weight: 500;
}

.works-count {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.works-catalog {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.works-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.works-group-head {
  align-items: baseline;
  display: flex;
  gap: 8px;
}

.works-group-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.works-group-count {
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.works-list--full {
  list-style: none;
}

.works-list--full .work-item {
  --reveal-delay: 0ms;
  border-bottom: 1px solid var(--border);
}

.works-list--full .work-item--archived {
  opacity: 0.72;
}

@media (prefers-reduced-motion: no-preference) {
  .works-list--full .work-item.is-revealed {
    animation: work-item-reveal 0.45s ease both;
    animation-delay: var(--reveal-delay);
  }

  .works-list--full .work-item--archived.is-revealed {
    animation-name: work-item-reveal-muted;
  }
}

@keyframes work-item-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes work-item-reveal-muted {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 0.72;
    transform: translateY(0);
  }
}

.work-row--full {
  align-items: center;
  gap: 10px 14px;
  grid-template-columns: 1.5rem 6px 1fr auto 1rem;
  margin: 0 -8px;
  padding: 14px 8px;
  position: relative;
  transition: background 0.18s ease;
}

.work-row--full::before {
  background: var(--accent);
  border-radius: 1px;
  content: "";
  height: 0;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: height 0.18s ease;
  width: 2px;
}

a.work-row--full:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

a.work-row--full:hover::before {
  height: 60%;
}

a.work-row--full:hover .work-name {
  color: var(--accent);
}

.work-status-dot {
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.work-status-dot--progress {
  background: #7fc58a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #7fc58a 18%, transparent);
}

.work-status-dot--experiment {
  background: #d6ad62;
  box-shadow: 0 0 0 3px color-mix(in srgb, #d6ad62 14%, transparent);
}

.work-status-dot--archived {
  background: transparent;
  border: 1px solid var(--border);
}

.work-row--full .work-desc {
  white-space: normal;
}

.work-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.work-arrow {
  color: var(--muted);
  font-size: 0.82rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

a.work-row--full:hover .work-arrow {
  color: var(--accent);
  opacity: 1;
  transform: translateX(0);
}

.works-page-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 20px;
}

.works-page-footer a {
  color: var(--muted);
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-heading {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-block p {
  color: var(--text);
  font-size: 0.92rem;
  max-width: 52ch;
}

.about-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.about-contact a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.about-contact a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer p {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .works-list--full .work-item.is-revealed {
    animation: none;
  }

  .work-arrow {
    opacity: 1;
    transform: none;
  }
}

.section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collaboration-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.contact-cta {
  align-items: flex-end;
  border: 1px solid var(--border);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px;
}

.contact-label {
  font-size: 0.86rem;
  font-weight: 600;
}

.contact-copy {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.contact-link,
.project-link {
  color: var(--text);
  flex-shrink: 0;
  font-size: 0.78rem;
  text-decoration: none;
}

.contact-link:hover,
.project-link:hover {
  color: #7fc58a;
}

.contact-link span,
.project-link span {
  color: #7fc58a;
}

.section h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.links {
  list-style: none;
}

.links li + li {
  margin-top: 6px;
}

.quote {
  border-left: 2px solid var(--border);
  font-style: italic;
  padding-left: 12px;
}

.quote cite {
  display: block;
  font-style: normal;
  margin-top: 4px;
  opacity: 0.8;
}

/* Project detail page */
.project-page .works-panel {
  gap: 36px;
}

.project-hero {
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 32px;
}

.project-kicker {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  gap: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-chip {
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 3px 8px;
}

.status-chip--in-progress {
  color: #7fc58a;
}

.status-chip--experiment {
  color: #d6ad62;
}

.status-chip--archived {
  color: var(--muted);
}

.project-title {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.project-lead {
  color: var(--muted);
  font-size: 1rem;
  max-width: 40ch;
}

.project-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.project-story {
  display: grid;
  gap: 20px;
  grid-template-columns: 100px 1fr;
}

.project-story-label,
.project-meta-grid dt {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-story-copy {
  font-size: 1.12rem;
  letter-spacing: -0.025em;
  line-height: 1.45;
  max-width: 42ch;
}

.project-meta-grid {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 16px;
}

.project-meta-grid dd {
  font-size: 0.8rem;
  margin-top: 5px;
}

.project-actions {
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 20px;
}

.project-link--muted {
  color: var(--muted);
}

.footer {
  bottom: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  left: 50%;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  width: min(720px, 90vw);
  z-index: 3;
}

.works-page .footer {
  bottom: auto;
  left: auto;
  margin: -72px auto 32px;
  max-width: min(672px, 92vw);
  padding: 0 24px;
  position: relative;
  text-align: left;
  transform: none;
  width: auto;
  z-index: 4;
}

@media (max-width: 768px) {
  body {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .grid-bg,
  .frame-lines {
    display: none;
  }

  .viewport {
    display: block;
    inset: auto;
    pointer-events: auto;
    position: static;
  }

  .panel {
    gap: 28px;
    left: auto !important;
    max-width: none !important;
    min-height: auto;
    padding: 48px 0 120px;
    position: static !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
  }

  .hero-lead {
    font-size: 1.05rem;
  }

  .contact-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .works-viewport {
    padding: 40px 0 100px;
  }

  .work-row {
    gap: 8px 10px;
    grid-template-columns: 1.2rem 1fr;
  }

  .work-tag {
    grid-column: 2;
    text-align: left;
  }

  .works-toolbar {
    top: 8px;
  }

  .work-row--full {
    gap: 8px 10px;
    grid-template-columns: 1.3rem 6px 1fr;
    margin: 0;
    padding: 12px 0;
  }

  .work-meta,
  .work-arrow {
    display: none;
  }

  .footer {
    bottom: 24px;
    left: 24px;
    position: fixed;
    right: 24px;
    text-align: left;
    transform: none;
    width: auto;
  }

  .works-page .footer {
    position: relative;
    z-index: 4;
  }

  .project-story {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .project-meta-grid {
    gap: 16px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .works-viewport {
    padding: 40px 0 100px;
  }
}
