:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #000000;
  --muted: rgba(0, 0, 0, 0.58);
  --line: rgba(0, 0, 0, 0.14);
  --wash: rgba(0, 0, 0, 0.035);
  --max: 1240px;
}

html[data-theme="dark"] {
  --bg: #000000;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.64);
  --line: rgba(255, 255, 255, 0.2);
  --wash: rgba(255, 255, 255, 0.075);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--fg);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
  transition:
    background 160ms ease,
    color 160ms ease;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a {
  color: inherit;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

a:hover {
  text-decoration-style: dotted;
}

button,
summary {
  font: inherit;
}

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

.page-shell {
  width: min(calc(100vw - 32px), 980px);
  margin: 0 auto;
}

.wordmark {
  margin: 0;
  color: var(--fg);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1.05;
}

.top-nav,
.clean-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.top-nav a,
.clean-links a {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.top-nav a:hover,
.clean-links a:hover {
  color: var(--fg);
}

.reddit-links {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.reddit-links a {
  display: grid;
  gap: 2px;
  color: var(--fg);
  text-decoration: none;
}

.reddit-links a:hover span {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-style: dotted;
}

.reddit-links span {
  font-size: 12px;
  line-height: 1.35;
}

.reddit-links small {
  margin: 0;
}

.theme-toggle {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--muted);
}

.icon-moon {
  display: none;
}

html[data-theme="dark"] .icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: block;
}

.page-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 36px;
  padding: max(44px, calc((100dvh - 680px) / 2)) 0 44px;
}

.intro {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.eyebrow,
small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.25;
  text-transform: uppercase;
}

p {
  margin-top: 0;
}

.bio {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.accordion-grid {
  width: 100%;
  max-width: 980px;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 6px;
}

.panel-head .eyebrow {
  margin: 0;
}

.drop-row {
  flex: 0 0 auto;
}

.drop-row summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0;
  cursor: pointer;
  list-style: none;
}

.drop-row summary::-webkit-details-marker {
  display: none;
}

.drop-row summary::after {
  content: "+";
  flex: 0 0 auto;
  width: auto;
  height: auto;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--fg);
  font-size: 16px;
  line-height: 1;
}

.drop-row[open] summary::after {
  content: "-";
}

.drop-row summary:hover {
  color: var(--muted);
}

.drop-row strong {
  display: block;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.drop-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
}

.drop-content {
  padding: 2px 0 16px;
}

.drop-content p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.project-copy {
  display: grid;
  gap: 14px;
}

.project-story {
  max-width: 520px;
}

.note-list {
  display: grid;
  gap: 6px;
}

.note-list p {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
}

.note-list p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 4px;
  height: 4px;
  background: var(--fg);
}

.summary-with-logo {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.theme-logo,
.summary-with-logo > img {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
}

.theme-logo img,
.summary-with-logo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-logo-lapsa img {
  transform: scale(1.16);
}

.logo-dark {
  display: none;
}

html[data-theme="dark"] .logo-light {
  display: none;
}

html[data-theme="dark"] .logo-dark {
  display: block;
}

.project-content {
  display: grid;
  grid-template-columns: minmax(240px, 0.46fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 28px;
}

.carousel {
  min-width: 0;
  width: min(100%, 620px);
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  clip-path: inset(0 round 10px);
  object-fit: contain;
  object-position: center;
  scroll-snap-align: start;
}

.oneglanse-carousel .carousel-track img {
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  clip-path: inset(0 round 14px);
  object-fit: contain;
}

.lapsa-carousel .carousel-track img {
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  clip-path: inset(0 round 14px);
  object-fit: contain;
}

.carousel-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.carousel-controls button {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  font-size: 20px;
  line-height: 0;
  opacity: 0.86;
  pointer-events: auto;
  transform: translateY(-50%);
  z-index: 2;
}

.carousel-controls [data-carousel-prev] {
  left: 8px;
}

.carousel-controls [data-carousel-next] {
  right: 8px;
}

.carousel-controls button:hover {
  background: var(--bg);
  color: var(--fg);
  opacity: 1;
}

.carousel-controls button.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .page-shell {
    height: auto;
    min-height: 100dvh;
  }

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

  .project-content {
    grid-template-columns: 1fr;
    align-items: start;
  }

}

@media (max-width: 620px) {
  .page-shell {
    width: min(calc(100vw - 32px), var(--max));
  }

  .top-nav {
    width: 100%;
    justify-content: center;
    gap: 14px;
  }

  .page-shell {
    gap: 44px;
    padding: 40px 0 56px;
  }

  .intro {
    gap: 20px;
  }

  .wordmark {
    font-size: clamp(24px, 8vw, 32px);
  }

  .bio {
    font-size: 12px;
    line-height: 1.65;
  }

  .accordion-grid {
    gap: 40px;
  }

  .panel {
    gap: 14px;
  }

  .panel-head {
    padding-bottom: 10px;
  }

  .project-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 16px;
    padding-bottom: 28px;
  }

  .drop-row strong {
    font-size: 13px;
  }

  .drop-row small,
  .drop-content p,
  .note-list p {
    font-size: 11px;
  }

  .drop-row summary {
    min-height: 54px;
    padding: 2px 0;
  }

  .drop-content {
    padding: 6px 0 20px;
  }

  .carousel {
    width: 100%;
  }

  .carousel-track img {
    border-radius: 8px;
    clip-path: inset(0 round 8px);
  }

  .oneglanse-carousel .carousel-track img {
    height: auto;
    border-radius: 12px;
    clip-path: inset(0 round 12px);
  }

  .lapsa-carousel .carousel-track img {
    height: auto;
    border-radius: 12px;
    clip-path: inset(0 round 12px);
  }

  .carousel-controls button {
    width: 24px;
    height: 38px;
    font-size: 18px;
  }
}
