:root {
  --bg: #f6f1e9;
  --surface: #fffdf9;
  --text: #1b1917;
  --muted: #5c554e;
  --accent: #d95338;
  --accent-2: #2f5d50;
  --border-color: #1b1917;
  --border-width: 2px;
  --radius: 14px;
  --shadow: 4px 4px 0px #1b1917;
  --shadow-hover: 6px 6px 0px #1b1917;
  --font-body: 'Georgia', 'Cambria', serif;
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'ui-monospace', 'SFMono-Regular', 'Consolas', monospace;
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.grid-bg {
  background-image:
    linear-gradient(to right, rgba(27, 25, 23, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 25, 23, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Top Studio Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: var(--border-width) solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fffdf9;
  border: var(--border-width) solid var(--border-color);
  border-radius: calc(var(--radius) * 0.5);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 2px 2px 0 var(--border-color);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  color: var(--text);
  border: var(--border-width) solid transparent;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--bg);
  border-color: var(--border-color);
  box-shadow: 2px 2px 0 var(--border-color);
}

.mode-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.2rem;
}

.mode-pill {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: calc(var(--radius) * 0.7);
  cursor: pointer;
}

.mode-pill.active {
  background: var(--text);
  color: var(--surface);
}

/* Container & Hero */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.hero {
  background: var(--surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 1.75rem;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: var(--border-width) solid var(--border-color);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--border-color);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.btn-primary {
  background: var(--accent);
  color: #fffdf9;
}

.hero-art-box {
  background: var(--bg);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-art-box.is-blank-slot {
  background: transparent;
  border: var(--border-width) dashed transparent;
  box-shadow: none;
  min-height: 220px;
}

/* Marquee Rotation in Hero Right Box */
.hero-marquee-viewport {
  overflow: hidden;
  border: var(--border-width) solid var(--border-color);
  border-radius: calc(var(--radius) * 0.7);
  background: var(--surface);
  position: relative;
}

.hero-marquee-track {
  display: flex;
  width: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-marquee-slide {
  min-width: 100%;
  flex: 0 0 100%;
  cursor: pointer;
}

.hero-marquee-slide .art-frame {
  border-bottom: none;
}

.hero-marquee-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.hero-marquee-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.hero-dot {
  border: 1.5px solid var(--border-color);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: calc(var(--radius) * 0.4);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--accent);
  color: #fffdf9;
}

/* Section Headers */
.section-block {
  margin-bottom: 4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: var(--border-width) solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--text);
  color: var(--surface);
  padding: 0.2rem 0.55rem;
  border-radius: calc(var(--radius) * 0.4);
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.tag-filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border: var(--border-width) solid var(--border-color);
  border-radius: calc(var(--radius) * 0.6);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.tag-chip.active {
  background: var(--accent-2);
  color: #fffdf9;
}

/* Cards & Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.art-frame {
  aspect-ratio: 5 / 4;
  background: var(--bg);
  border-bottom: var(--border-width) solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.art-frame img,
.art-frame svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 1rem;
  flex: 1;
}

.tag-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.mini-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg);
  border: 1.5px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: calc(var(--radius) * 0.4);
}

/* Color Swatches for Design Showcase */
.swatch-bar {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.swatch-dot {
  width: 24px;
  height: 24px;
  border-radius: calc(var(--radius) * 0.35);
  border: 1.5px solid var(--border-color);
}

/* Modal / Lightbox / Reader */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 25, 23, 0.72);
  backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  padding: 1.5rem;
  z-index: 100;
}

.modal-backdrop.open {
  display: grid;
}

.modal-window {
  background: var(--surface);
  color: var(--text);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: var(--border-width) solid var(--border-color);
  background: var(--bg);
  position: sticky;
  top: 0;
}

.modal-content {
  padding: 2rem;
}

.prose h3 {
  font-family: var(--font-heading);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose code {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.88em;
}

.footer {
  border-top: var(--border-width) solid var(--border-color);
  background: var(--surface);
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}
