:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-deep: #e8eef5;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --ink: #0f172a;
  --muted: #475569;
  --accent: #0f766e;
  --accent-strong: #0ea5a4;
  --accent-warm: #f59e0b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow: rgba(15, 23, 42, 0.08);
  --shadow-strong: rgba(15, 23, 42, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Fira Code", "Consolas", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
  line-height: 1.6;
  min-height: 100%;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% 0 0;
  background-image:
    radial-gradient(800px circle at 12% 10%, rgba(15, 118, 110, 0.2), transparent 55%),
    radial-gradient(700px circle at 88% 12%, rgba(245, 158, 11, 0.18), transparent 55%),
    radial-gradient(600px circle at 60% 30%, rgba(30, 64, 175, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.05) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.04) 0 1px, transparent 1px 26px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: rgba(15, 118, 110, 0.18);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

a:hover {
  color: #0b5f5a;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
  border-radius: 8px;
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  z-index: 2;
}

.skip-link:focus {
  left: 1rem;
}

.site-header {
  background: rgba(248, 250, 252, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #1e40af);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.16);
}

.logo-text {
  font-size: 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.nav-link {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.04);
  color: var(--ink);
}

.nav-link:hover {
  border-color: var(--border-strong);
  background: rgba(15, 23, 42, 0.06);
}

.site-nav a[aria-current="page"] {
  border-color: rgba(15, 118, 110, 0.4);
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
}

.site-main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.hero {
  padding: 2.5rem 0 1rem;
  display: grid;
  gap: 1.25rem;
  max-width: 70ch;
  position: relative;
  animation: rise-in 0.8s ease both;
}

.hero-art {
  position: absolute;
  top: 3.25rem;
  right: clamp(-30rem, -32vw, -14rem);
  width: clamp(360px, 44vw, 520px);
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  background: #fff;
}

.hero h1 {
  font-size: clamp(2.3rem, 3.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}

.lede {
  max-width: 52ch;
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px var(--shadow);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px var(--shadow-strong);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.5);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.meta-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: var(--ink);
}

.page-header {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.04);
  animation: rise-in 0.7s ease both;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
}

.filters {
  margin-top: -0.75rem;
  margin-bottom: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: rgba(15, 23, 42, 0.04);
  font-size: 0.9rem;
}

.home-section {
  margin-top: 2.75rem;
  animation: rise-in 0.8s ease both;
}

.home-section:nth-of-type(2) {
  animation-delay: 0.05s;
}

.home-section:nth-of-type(3) {
  animation-delay: 0.1s;
}

.home-section:nth-of-type(4) {
  animation-delay: 0.15s;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 1.1rem;
}

.card-grid-lg {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  padding: 1.35rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.8), rgba(245, 158, 11, 0.7));
  opacity: 0.5;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.card img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  display: block;
}

.photo-card a img {
  cursor: pointer;
}

.project-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--border);
  margin-bottom: 0.6rem;
  display: block;
}

.project-card h2,
.photo-card h2 {
  margin-top: 0;
}

.list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.85rem;
}

.list-cards {
  gap: 1rem;
}

.list-card {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 0.3rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.list-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  transform: translateY(-2px);
}

.download-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.download-hero {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
}

.download-hero img {
  width: min(100%, 960px);
  height: auto;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  display: block;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.download-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.download-card-contents {
  display: grid;
  gap: 0.35rem;
}

.download-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.download-caption {
  color: var(--muted);
}

.download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.85rem;
}

.download-filename {
  font-family: var(--font-mono);
  color: var(--text);
}

.download-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f8fafc;
  flex-shrink: 0;
}

.download-icon svg {
  width: 24px;
  height: 24px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.detail {
  display: grid;
  gap: 2rem;
}

.detail-header {
  display: grid;
  gap: 0.75rem;
}

.prose {
  display: grid;
  gap: 1rem;
  max-width: 70ch;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.2;
  margin: 1.5rem 0 0.5rem;
}

.prose h2 {
  font-size: 1.6rem;
}

.prose h3 {
  font-size: 1.25rem;
}

.prose p {
  margin: 0;
  color: var(--ink);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
}

.prose li {
  line-height: 1.6;
}

.prose blockquote {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border-strong);
  background: #f8fafc;
  color: var(--muted);
}

.prose code {
  font-family: var(--font-mono);
  background: #f0f4f8;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}

.prose pre code {
  background: transparent;
  padding: 0;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background: #f5f7fb;
}

.prose img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.code-block,
pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.photo-gallery .photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.photo-gallery {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.photo img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  cursor: zoom-in;
}

.video-embed {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.video-embed video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0f172a;
}

.prose img,
.detail-cover,
.card img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(92vw, 1200px);
  max-height: 90vh;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-open {
  overflow: hidden;
}

.link-group {
  margin-top: 2rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.photo-thumb {
  height: 160px;
  background: linear-gradient(135deg, #dfe7e9, #cbd5db);
  border-radius: 12px;
}

.lightbox-placeholder {
  border: 1px dashed var(--border-strong);
  padding: 1.25rem;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-cover {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1.2fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.admin-sidebar {
  display: grid;
  gap: 1rem;
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-post {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  display: grid;
  gap: 0.2rem;
  color: var(--ink);
}

.admin-post:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 23, 42, 0.04);
}

.admin-editor {
  display: grid;
  gap: 1.25rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-span {
  grid-column: 1 / -1;
}

.admin-editor label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.admin-editor input,
.admin-editor textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--font);
}

.admin-textarea {
  font-family: var(--font-mono);
}

.admin-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.admin-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-preview {
  display: grid;
  gap: 0.75rem;
}

.admin-alert {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
}

.admin-alert.error {
  border-color: rgba(220, 38, 38, 0.5);
  color: #991b1b;
}

.admin-alert.success {
  border-color: rgba(16, 185, 129, 0.5);
  color: #065f46;
}

.admin-login {
  display: grid;
  gap: 1rem;
  max-width: 420px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .hero-art {
    display: none;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    padding: 1.1rem;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .download-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-icon {
    align-self: flex-end;
  }
}
