/* Sidequest Design System — Boutique Founder Labeling & Artifact Atelier
   Vanilla CSS following Puttsites shell conventions with warm archival paper,
   obsidian ink, raw brass details, and editorial serif/sans/mono typography. */

:root {
  --bg: #F6F3EC;
  --surface: #FDFBF7;
  --surface-alt: #EFECE4;
  --ink: #151513;
  --ink-soft: #2A2926;
  --muted: #65625A;
  --line: #DFDAD0;
  --line-strong: #C5BEB0;
  --brass: #9C712B;
  --brass-soft: #F3EAD8;
  --terracotta: #8C3B2B;
  --terracotta-soft: #FBEFEB;
  --cypress: #1D3B2A;
  --cypress-soft: #E8F0EB;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-subtle: 0 2px 8px rgba(21, 21, 19, 0.04);
  --shadow-elevated: 0 18px 42px rgba(21, 21, 19, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
}

.skip-link:focus {
  top: 12px;
}

/* Top header (public & unauthenticated views) */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 243, 236, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.brand-wordmark-title {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.brand-wordmark-dot {
  color: var(--brass);
}

.brand-wordmark-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Signed-in App Shell (matches Puttsites .with-shell sidebar layout) */
.with-shell {
  background: var(--bg);
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.app-sidebar .brand-wordmark {
  margin: 0 8px 36px;
}

.app-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar nav a:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.app-sidebar nav a[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brass);
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 12px 6px;
}

.sidebar-account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 16px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
}

.account-meta {
  min-width: 0;
  flex: 1;
}

.account-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-email {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.with-shell main {
  margin-left: 236px;
  padding: 32px 40px 80px;
  max-width: 1440px;
  min-height: 100vh;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* Buttons & Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font: 600 13.5px/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
  min-height: 42px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #282723;
}

.btn-brass {
  background: var(--brass);
  color: #fff;
  border-color: var(--brass);
}

.btn-brass:hover {
  background: #845e21;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-outline:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 10px;
  min-height: 32px;
}

.btn-ghost:hover {
  color: var(--ink);
}

.g-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--ink);
  margin: 14px 0;
  transition: background 0.15s ease;
}

.g-btn:hover {
  background: #282723;
}

/* Cards, Forms & Typography */
h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 4px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-block;
  margin-bottom: 10px;
}

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

.small {
  font-size: 12.5px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
}

.card.narrow {
  max-width: 440px;
  margin: 44px auto;
}

.flash {
  background: var(--brass-soft);
  border: 1px solid var(--brass);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  margin: 0 0 20px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 14px 0 5px;
}

input,
select,
textarea {
  width: 100%;
  font: 14px/1.4 var(--font-sans);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brass);
  outline: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

/* Landing Page Sections */
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0 64px;
  border-bottom: 1px solid var(--line);
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}

.hero-headline em {
  font-style: italic;
  color: var(--brass);
}

.hero-lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 54ch;
  margin: 0 0 28px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.spec-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.spec-ledger-item b {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

.spec-ledger-item span {
  font-size: 12px;
  color: var(--muted);
}

.hero-showcase-frame {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-elevated);
}

.showcase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.showcase-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mosaic-tile {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: #171715;
}

.mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.mosaic-tile:hover img {
  transform: scale(1.03);
}

.mosaic-caption {
  position: absolute;
  inset: auto 8px 8px 8px;
  background: rgba(21, 21, 19, 0.84);
  backdrop-filter: blur(6px);
  color: #F6F3EC;
  padding: 6px 10px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.mosaic-caption code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #E2B86B;
}

/* Catalog Grid */
.section-block {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.artifact-catalog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.artifact-catalog-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-elevated);
}

.artifact-catalog-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #181816;
  position: relative;
}

.artifact-catalog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artifact-code-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(21, 21, 19, 0.85);
  color: #F5F2EB;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 4px;
}

.artifact-catalog-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.artifact-spec-table {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 12px;
}

.artifact-spec-table div span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

.artifact-spec-table div b {
  font-weight: 600;
  color: var(--ink);
}

/* Studio Hello World Banner & Workbench */
.hello-banner {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--brass);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hello-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--cypress-soft);
  color: var(--cypress);
  font-weight: 600;
}

.studio-workbench {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 44px;
}

.category-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}

.cat-pill {
  border: 1px solid var(--line-strong);
  background: var(--surface-alt);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  font: 600 12.5px/1.2 var(--font-sans);
  transition: all 0.15s ease;
}

.cat-pill span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}

.cat-pill.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.cat-pill.active span {
  color: #D8C39A;
}

.colorway-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.cw-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
}

.cw-option.active {
  border-color: var(--brass);
  background: var(--brass-soft);
  font-weight: 600;
}

.cw-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* Live Artifact Preview Proof Card */
.proof-stage {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-elevated);
}

.proof-canvas {
  border-radius: var(--radius-md);
  padding: 24px;
  color: #F5F2EB;
  background: #151514;
  transition: background 0.25s ease, color 0.25s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.proof-photo-preview {
  width: 100%;
  height: 210px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
}

.proof-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.woven-label-mock {
  border: 1px dashed rgba(200, 157, 84, 0.65);
  padding: 16px 18px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
}

.woven-label-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}

.woven-label-brand {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}

.woven-label-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.proof-specs-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
}

.proof-specs-list div {
  padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.proof-specs-list span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Saved Artifacts Dossier Grid */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.dossier-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dossier-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-strong);
  background: var(--surface-alt);
  color: var(--ink-soft);
}

.tag.brass {
  border-color: var(--brass);
  background: var(--brass-soft);
  color: #6E4D19;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

footer.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 24px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .hero-grid,
  .studio-workbench,
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .with-shell main {
    margin-left: 0;
    padding: 20px 16px 72px;
  }
  .app-sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }
  .app-sidebar .brand-wordmark {
    margin-bottom: 12px;
  }
  .app-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-section-label {
    display: none;
  }
  .spec-ledger {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .category-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row-2,
  .colorway-selector {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}
