@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14181b;
  --ink-muted: #545f5e;
  --paper: #f5f3ee;
  --surface: #ffffff;
  --surface-sunken: #edeae1;
  --rule: #e2ddd0;
  --accent: #0f5c73;
  --accent-warm: #b25e18;
  --shadow: 220 25% 10%;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0ede4;
    --ink-muted: #a7b0af;
    --paper: #14181a;
    --surface: #1b2123;
    --surface-sunken: #101415;
    --rule: #2a3234;
    --accent: #74c6db;
    --accent-warm: #e79a53;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f0ede4;
  --ink-muted: #a7b0af;
  --paper: #14181a;
  --surface: #1b2123;
  --surface-sunken: #101415;
  --rule: #2a3234;
  --accent: #74c6db;
  --accent-warm: #e79a53;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ink: #14181b;
  --ink-muted: #545f5e;
  --paper: #f5f3ee;
  --surface: #ffffff;
  --surface-sunken: #edeae1;
  --rule: #e2ddd0;
  --accent: #0f5c73;
  --accent-warm: #b25e18;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: 4rem; }

h1, h2, h3 { font-family: var(--sans); font-weight: 700; color: var(--ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 150ms ease;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Topbar / breadcrumb */
.topbar {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 1.25rem;
}
.breadcrumb {
  max-width: 760px;
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb li:not(:last-child)::after {
  content: "/";
  color: var(--rule);
}
.breadcrumb a { color: var(--ink-muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
main.main-wide {
  max-width: 960px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Project header */
.app-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 2rem;
  animation: rise 400ms ease-out both;
}
.app-icon {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px hsl(var(--shadow) / 0.06);
}
.app-icon img { width: 60px; height: 60px; }

.app-title {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}
.app-summary {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 0.6rem;
  max-width: 46ch;
  line-height: 1.45;
}
.app-byline {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin: 0;
}
.app-byline a { color: var(--ink-muted); font-weight: 600; }
.app-byline a:hover { color: var(--accent); }

hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.25rem 0;
}

section { margin-bottom: 3rem; }
section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
}

/* Screenshot carousel */
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .carousel-track { scroll-behavior: smooth; }
}
.carousel-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.carousel-slide {
  margin: 0;
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.carousel-frame {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--surface-sunken);
  box-shadow: 0 1px 3px hsl(var(--shadow) / 0.08);
}
.carousel-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}
.carousel-slide figcaption {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-top: 0.7rem;
  line-height: 1.5;
}
.shot-source {
  font-size: 0.8125rem;
  margin-left: 0.5em;
  white-space: nowrap;
}
.shot-source:first-child {
  margin-left: 0;
}

.carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.6rem;
  pointer-events: none;
}
.carousel-btn {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(10 12 13 / 0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  transition: background 150ms ease;
}
.carousel-btn:hover {
  background: rgb(10 12 13 / 0.75);
  text-decoration: none;
}
.carousel-counter {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  background: rgb(10 12 13 / 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
}

.prose { max-width: 65ch; }
.prose p {
  line-height: 1.7;
  font-size: 1.0625rem;
  margin: 0 0 1.15rem;
}

ul.features {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  max-width: 60ch;
}
ul.features li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.85rem;
  line-height: 1.6;
  font-size: 1.0625rem;
}
ul.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

ul.links {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
ul.links li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}
ul.links .link-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  flex: 0 0 auto;
}
ul.links a {
  font-size: 0.9375rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.tags span {
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
}

/* Plain listing pages (home, archived sub-galleries) */
.page-title {
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.5rem;
}
.page-description {
  font-size: 1.0625rem;
  color: var(--ink-muted);
  max-width: 60ch;
  margin: 0 0 2rem;
}
ul.plain-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
ul.plain-list li {
  border-bottom: 1px solid var(--rule);
}
ul.plain-list a {
  display: block;
  padding: 0.9rem 0.25rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 1.0625rem;
}
ul.plain-list a:hover { color: var(--accent); text-decoration: none; }
ul.plain-list a.is-image {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 0.9375rem;
}

/* Home project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.project-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px hsl(var(--shadow) / 0.12);
  border-color: var(--accent);
  text-decoration: none;
}
.project-card:focus-visible {
  border-radius: 16px;
}
.project-card-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  overflow: hidden;
}
.project-card-icon img { width: 40px; height: 40px; }
.project-card-icon--placeholder {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}
.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.project-card-title {
  font-weight: 600;
  font-size: 1.0625rem;
}
.project-card-desc {
  font-size: 0.875rem;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

footer.page-foot {
  max-width: 760px;
  margin: 3rem auto 0;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.6;
}
footer.page-foot a { color: var(--ink-muted); font-weight: 600; }
footer.page-foot a:hover { color: var(--accent); }
footer.page-foot .source-link {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.not-found {
  max-width: 760px;
  margin: 4rem auto;
  padding: 0 1.25rem;
  text-align: center;
}
.not-found h1 {
  font-size: 3.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
}
