:root {
  --ink: #1b1b1b;
  --paper: #f7f1e8;
  --accent: #d9563c;
  --accent-dark: #b84530;
  --sand: #e7d9c9;
  --charcoal: #2f2a28;
  --mist: #f2e9df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fdf8f2 0%, var(--paper) 45%, #efe2d5 100%);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 24px 56px;
  border-bottom: 1px solid rgba(27, 27, 27, 0.12);
  background: rgba(247, 241, 232, 0.9);
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  transition: transform 0.25s ease, opacity 0.25s ease;
  will-change: transform;
}

.has-fixed-header {
  padding-top: 96px;
}

.nav-hidden .site-header {
  transform: translateY(-110%);
  opacity: 0;
}

.is-editor {
  height: 100vh;
  overflow: hidden;
}

.header-toggle {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  border: 1px solid rgba(27, 27, 27, 0.25);
  background: rgba(255, 255, 255, 0.9);
  color: var(--charcoal);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  display: none;
}

.is-editor .header-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.is-editor.nav-hidden .header-toggle {
  top: 8px;
}

.is-editor.has-fixed-header {
  padding-top: 0;
}

.brand {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}

.site-nav a.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.nav-muted {
  opacity: 0.5;
}

.nav-badge {
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home {
  padding: 48px 64px 80px;
}

.intro-lock {
  overflow: hidden;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, #fff6eb 0%, #f3e6d6 45%, #ead8c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.intro-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.intro-overlay.is-fading {
  opacity: 0;
}

.intro-shell {
  width: min(720px, 100%);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  padding: 36px 40px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  box-shadow: 0 30px 60px rgba(27, 27, 27, 0.12);
  display: grid;
  gap: 24px;
}

.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: 24px;
  align-items: center;
}

.intro-copy h1 {
  margin-top: 8px;
}

.intro-visual {
  display: grid;
  justify-items: end;
}

.intro-screen {
  width: 100%;
  max-width: 260px;
  background: #101010;
  color: #f5ede2;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(27, 27, 27, 0.2);
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.intro-screen.split {
  max-width: 240px;
  max-height: 220px;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.screen-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.screen-title {
  margin-left: auto;
}

.screen-body {
  display: grid;
  gap: 8px;
  font-size: 0.72rem;
}

.intro-visual.is-boot .boot-line {
  opacity: 0.2;
  transform: translateY(6px);
  animation: boot-line 2.6s ease infinite;
}

.intro-visual.is-boot .boot-line:nth-child(2) {
  animation-delay: 0.4s;
}

.intro-visual.is-boot .boot-line:nth-child(3) {
  animation-delay: 0.8s;
}

.intro-visual.is-boot .boot-line:nth-child(4) {
  animation-delay: 1.2s;
}

.intro-visual.is-project .file-line {
  position: relative;
  padding-left: 14px;
  opacity: 0.2;
  animation: file-pop 3s ease infinite;
}

.intro-visual.is-project .file-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.intro-visual.is-project .file-line:nth-child(2) {
  animation-delay: 0.3s;
}

.intro-visual.is-project .file-line:nth-child(3) {
  animation-delay: 0.6s;
}

.intro-visual.is-project .file-line:nth-child(4) {
  animation-delay: 0.9s;
}

.intro-visual.is-project .file-line:nth-child(5) {
  animation-delay: 1.2s;
}

.split-body {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 8px;
}

.code-pane {
  display: grid;
  gap: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.85);
}

.code-line {
  opacity: 0.15;
  animation: code-glow 3.2s ease infinite;
}

.code-line:nth-child(2) {
  animation-delay: 0.4s;
}

.code-line:nth-child(3) {
  animation-delay: 0.8s;
}

.code-line:nth-child(4) {
  animation-delay: 1.2s;
}

.code-line:nth-child(5) {
  animation-delay: 1.6s;
}

.code-caret {
  width: 12px;
  height: 2px;
  background: var(--accent);
  animation: caret-blink 1s steps(2, start) infinite;
}

.preview-pane {
  display: grid;
  gap: 8px;
}

.preview-page {
  background: #f6efe4;
  border-radius: 8px;
  padding: 6px;
  display: grid;
  gap: 6px;
  color: #1d1d1d;
}

.preview-page.small {
  height: 28px;
  opacity: 0.5;
}

.preview-title {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.preview-block {
  height: 12px;
  background: rgba(27, 27, 27, 0.18);
  border-radius: 4px;
}

.preview-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.preview-columns span {
  height: 12px;
  background: rgba(27, 27, 27, 0.12);
  border-radius: 3px;
  animation: preview-pulse 2.4s ease infinite;
}

.preview-columns span:nth-child(2) {
  animation-delay: 0.4s;
}

.preview-columns span:nth-child(3) {
  animation-delay: 0.8s;
}

.intro-visual.is-policy .policy-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.intro-visual.is-policy .policy-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: policy-scan 2.6s ease infinite;
}

.intro-visual.is-policy .policy-bar:nth-child(2)::after {
  animation-delay: 0.4s;
}

.intro-visual.is-policy .policy-bar:nth-child(3)::after {
  animation-delay: 0.8s;
}

.intro-visual.is-policy .policy-bar:nth-child(4)::after {
  animation-delay: 1.2s;
}

.intro-visual.is-welcome .welcome-mark {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  text-align: center;
  animation: welcome-glow 2.8s ease infinite;
}

.intro-visual.is-welcome .welcome-tag {
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.5);
}

.intro-progress {
  display: flex;
  gap: 10px;
}

.intro-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(27, 27, 27, 0.14);
  transition: transform 0.3s ease, background 0.3s ease;
}

.intro-dot.is-active {
  background: var(--accent);
  transform: scale(1.1);
}

.intro-dot.is-complete {
  background: rgba(27, 27, 27, 0.45);
}

.intro-steps {
  min-height: 220px;
}

.intro-step {
  display: none;
  animation: fade-rise 0.5s ease both;
}

.intro-step.is-active {
  display: block;
}

.intro-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 560px;
}

.policy-card {
  margin-top: 16px;
  background: rgba(247, 241, 232, 0.75);
  border: 1px solid rgba(27, 27, 27, 0.1);
  border-radius: 18px;
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.policy-page {
  margin-top: 16px;
  background: rgba(247, 241, 232, 0.72);
  border: 1px solid rgba(27, 27, 27, 0.1);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.policy-page h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
}

.policy-page ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
  font-size: 0.92rem;
}

.policy-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 600;
}

.policy-links a {
  color: var(--accent-dark);
  text-decoration: none;
}

.policy-links a:hover {
  text-decoration: underline;
}

.policy-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-top: 12px;
}

.intro-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.intro-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.intro-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(217, 86, 60, 0.25);
}

.intro-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.intro-btn.ghost {
  background: rgba(27, 27, 27, 0.08);
  color: var(--ink);
  border: 1px solid rgba(27, 27, 27, 0.15);
}

.intro-welcome h1 {
  font-family: "Playfair Display", serif;
}

.phiona-portal {
  padding: 56px 64px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
  align-items: start;
}

.phiona-stage {
  display: grid;
  gap: 24px;
}

.phiona-hero {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  display: grid;
  gap: 16px;
  animation: fade-rise 0.6s ease both;
}

.phiona-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.phiona-section {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  padding: 22px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  display: grid;
  gap: 12px;
}

.phiona-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phiona-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.08);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.phiona-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.phiona-label {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(27, 27, 27, 0.6);
}

.phiona-value {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: 2rem;
}

.phiona-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phiona-tags span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.08);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phiona-studio {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}

.phiona-studio-code {
  background: #1d1a18;
  color: #f7f1e8;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(27, 27, 27, 0.4);
}

.phiona-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.phiona-studio-code pre {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.phiona-studio-panel {
  background: rgba(246, 240, 232, 0.9);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  display: grid;
  gap: 12px;
  align-content: start;
}

.phiona-studio-panel h3 {
  margin: 0;
}

.phiona-studio-panel ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(27, 27, 27, 0.7);
  display: grid;
  gap: 6px;
}

.phiona-steps {
  display: grid;
  gap: 16px;
}

.phiona-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  background: rgba(246, 240, 232, 0.8);
  border-radius: 18px;
  padding: 18px;
}

.phiona-step-index {
  font-family: "DM Serif Display", serif;
  font-size: 1.6rem;
  color: var(--accent-dark);
}

.phiona-step h3 {
  margin: 0 0 6px;
}

.phiona-step p {
  margin: 0;
  color: rgba(27, 27, 27, 0.7);
}

.phiona-nav {
  position: sticky;
  top: 110px;
  align-self: start;
  background: rgba(47, 42, 40, 0.95);
  color: #f7f1e8;
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(47, 42, 40, 0.4);
  display: grid;
  gap: 18px;
  min-height: 360px;
}

.phiona-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.phiona-nav-links {
  display: grid;
  gap: 10px;
}

.phiona-nav-links a {
  color: #f7f1e8;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 500;
}

.phiona-nav-links a.is-active {
  background: rgba(217, 86, 60, 0.45);
  color: #fff;
}

.phiona-nav-footer {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(247, 241, 232, 0.75);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent-dark);
  margin-bottom: 16px;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.6rem, 3vw, 3.6rem);
  margin: 0 0 16px;
}

.lead {
  font-size: 1.1rem;
  max-width: 540px;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(217, 86, 60, 0.25);
}

.btn.is-active {
  background: var(--accent-dark);
  box-shadow: 0 12px 22px rgba(217, 86, 60, 0.28);
}

.btn.is-disabled {
  pointer-events: none;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

.usage-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 24px 72px;
}

.usage-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.usage-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 26px 26px 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

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

.usage-stat {
  background: rgba(16, 16, 18, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.usage-label {
  color: rgba(247, 241, 232, 0.7);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.usage-value {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  font-weight: 700;
  margin-top: 10px;
}

.usage-pill {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 241, 232, 0.82);
}

.usage-pill.is-warn {
  background: rgba(255, 169, 64, 0.14);
  color: #ffb25c;
}

.usage-pill.is-good {
  background: rgba(118, 201, 137, 0.16);
  color: #8ce6a6;
}

.usage-meta {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  color: rgba(247, 241, 232, 0.92);
}

.usage-muted {
  color: rgba(247, 241, 232, 0.68);
}

.usage-chip {
  align-self: end;
  justify-self: end;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.usage-empty {
  text-align: center;
  padding: 32px 12px;
}

.usage-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.usage-empty-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.btn.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.btn.small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.hero-art {
  display: grid;
  gap: 24px;
  position: relative;
}

.cover-card {
  background: var(--charcoal);
  color: #fef6ea;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.2);
}

.cover-title {
  font-family: "Playfair Display", serif;
  font-size: 2.4rem;
  letter-spacing: 0.22em;
}

.cover-subtitle {
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  opacity: 0.7;
}

.cover-quotes {
  margin-top: 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(254, 246, 234, 0.08);
  border: 1px solid rgba(254, 246, 234, 0.18);
  overflow: hidden;
}

.cover-quote {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(254, 246, 234, 0.86);
}

.cover-quote.is-animating {
  animation: quoteScroll 0.8s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .cover-quote {
    transform: none;
    opacity: 1;
  }

  .cover-quote.is-animating {
    animation: none;
  }
}

.preview-card {
  background: var(--mist);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(27, 27, 27, 0.1);
}

.preview-header {
  font-weight: 600;
  margin-bottom: 12px;
}

.demo-gallery .preview-header {
  margin-bottom: 16px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.demo-image {
  height: 110px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.demo-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(217, 86, 60, 0.15), transparent 55%);
  opacity: 0.9;
}

.demo-image.is-cover {
  background-image: linear-gradient(140deg, #fdf8f2 0%, #efe2d5 100%);
}

.demo-image.is-spread {
  background-image: linear-gradient(160deg, #f0e6d9 0%, #d9c4b2 100%);
}

.demo-image.is-portrait {
  background-image: linear-gradient(170deg, #f7efe2 0%, #e2d2c0 100%);
}

.demo-image.is-column {
  background-image: linear-gradient(130deg, #f6eee0 0%, #ddc7b5 100%);
}

.features {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.feature {
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(27, 27, 27, 0.08);
}

.feature h3 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
}

.intro-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(27, 27, 27, 0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.intro-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.intro-footer-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.intro-footer-links a:hover {
  color: var(--accent-dark);
}

.intro-footer-meta {
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.6);
}

.legal {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 64px 80px;
}

.legal-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.legal-page {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  padding: 24px 26px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  box-shadow: 0 18px 36px rgba(27, 27, 27, 0.08);
}

.legal h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin-bottom: 12px;
}

.legal .meta {
  font-size: 0.95rem;
  color: rgba(27, 27, 27, 0.6);
  margin-bottom: 24px;
}

.legal h2 {
  margin-top: 32px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
}

.legal p,
.legal li {
  line-height: 1.6;
}

.legal ul {
  padding-left: 18px;
}

.projects {
  padding: 40px 56px 80px;
  display: grid;
  gap: 32px;
}

.projects-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.projects-hero-copy,
.projects-hero-panel {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  padding: 24px;
  display: grid;
  gap: 16px;
}

.projects-hero-copy {
  align-content: start;
}

.projects-hero h1 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 2rem;
}

.projects-lead {
  margin: 0;
  color: rgba(27, 27, 27, 0.7);
}

.project-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.project-form input {
  flex: 1;
  min-width: 220px;
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px 16px;
  font-family: "Space Grotesk", sans-serif;
}

.project-form select {
  min-width: 200px;
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px 16px;
  font-family: "Space Grotesk", sans-serif;
  background: #fff;
}

.project-form button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.form-error {
  color: #a1342c;
  font-size: 0.9rem;
}

.projects-hero-panel h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
}

.projects-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: rgba(27, 27, 27, 0.72);
}

.projects-hint {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(27, 27, 27, 0.6);
}

.projects-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.projects-count {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: rgba(27, 27, 27, 0.6);
}

.projects-list h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.project-card {
  display: block;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  color: var(--ink);
}

.project-name {
  font-weight: 600;
  margin-bottom: 6px;
}

.project-meta {
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.6);
}

.empty-state {
  font-size: 0.95rem;
  color: rgba(27, 27, 27, 0.6);
}

.templates {
  padding: 40px 56px 96px;
  display: grid;
  gap: 32px;
}

.templates-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  animation: fade-rise 0.6s ease both;
}

.templates-hero-panel {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
}

.templates-hero-panel::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 220px;
  background: radial-gradient(circle at top, rgba(217, 86, 60, 0.18), transparent 70%);
  opacity: 0.8;
}

.templates-hero-title {
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.templates-hero-panel p {
  position: relative;
  z-index: 1;
}

.templates-hero-metrics {
  display: flex;
  gap: 24px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.templates-hero-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
}

.templates-hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(27, 27, 27, 0.6);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.template-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade-rise 0.5s ease both;
}

.template-card:nth-child(2) {
  animation-delay: 0.08s;
}

.template-card:nth-child(3) {
  animation-delay: 0.16s;
}

.template-card:nth-child(4) {
  animation-delay: 0.24s;
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.template-card h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
}

.template-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-dark);
}

.template-tag {
  background: rgba(47, 42, 40, 0.1);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.template-summary {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(27, 27, 27, 0.7);
}

.template-preview {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(27, 27, 27, 0.1);
  background: linear-gradient(135deg, rgba(254, 250, 245, 0.9), rgba(246, 232, 219, 0.7));
  display: grid;
  gap: 10px;
}

.pricing {
  padding: 48px 64px 96px;
  display: grid;
  gap: 48px;
}

.pricing-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  animation: fade-rise 0.6s ease both;
}

.pricing-hero-copy h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  margin: 0 0 16px;
}

.currency-toggle {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.08);
  margin-top: 16px;
}

.currency-button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
}

.currency-button.is-active {
  background: var(--charcoal);
  color: #fff;
  box-shadow: 0 10px 18px rgba(47, 42, 40, 0.2);
}

.pricing-note {
  margin-top: 16px;
  font-size: 0.95rem;
  color: rgba(27, 27, 27, 0.7);
}

.pricing-hero-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 231, 218, 0.9));
  border-radius: 24px;
  padding: 28px;
  border: 1px solid rgba(27, 27, 27, 0.1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.08);
}

.pricing-hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 220px;
  background: radial-gradient(circle, rgba(217, 86, 60, 0.22), transparent 70%);
}

.pricing-hero-badge {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--accent-dark);
}

.pricing-hero-figure {
  font-family: "DM Serif Display", serif;
  font-size: 2.4rem;
  margin: 12px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.pricing-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(27, 27, 27, 0.1);
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.pricing-card.featured {
  background: linear-gradient(135deg, rgba(217, 86, 60, 0.15), rgba(255, 255, 255, 0.92));
  border-color: rgba(217, 86, 60, 0.35);
  box-shadow: 0 24px 46px rgba(217, 86, 60, 0.16);
}

.pricing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.pricing-card h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
}

.pricing-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.1);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.pricing-status {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(36, 107, 63, 0.15);
  color: #246b3f;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 2.4rem;
  font-weight: 600;
}

.price-period {
  font-size: 1rem;
  color: rgba(27, 27, 27, 0.7);
}

.pricing-tagline {
  margin: 0;
  color: rgba(27, 27, 27, 0.7);
}

.pricing-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: rgba(27, 27, 27, 0.85);
}

.pricing-action {
  margin-top: 6px;
}

.pricing-footnote {
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.6);
}

.pricing-faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.pricing-faq-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(27, 27, 27, 0.08);
}

.pricing-faq-card h3 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
}

.arcana {
  padding: 48px 64px 96px;
  display: grid;
  gap: 48px;
}

.arcana-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  animation: fade-rise 0.6s ease both;
}

.arcana-hero-copy h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  margin: 0 0 16px;
}

.arcana-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
}

.arcana-meta-block {
  display: grid;
  gap: 6px;
  min-width: 140px;
}

.arcana-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.65rem;
  color: rgba(27, 27, 27, 0.6);
  font-weight: 600;
}

.arcana-meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
}

.arcana-hero-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 228, 212, 0.95));
  border-radius: 24px;
  padding: 28px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  position: relative;
  overflow: hidden;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.08);
}

.arcana-hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 200px;
  background: radial-gradient(circle, rgba(217, 86, 60, 0.22), transparent 70%);
}

.arcana-hero-badge {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--accent-dark);
}

.arcana-hero-panel ul {
  margin: 18px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: rgba(27, 27, 27, 0.78);
}

.arcana-story {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.arcana-story-card {
  background: rgba(255, 255, 255, 0.84);
  border-radius: 22px;
  padding: 24px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  display: grid;
  gap: 14px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.06);
}

.arcana-story-card h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
}

.arcana-story-card p {
  margin: 0;
  color: rgba(27, 27, 27, 0.7);
}

.arcana-story-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: rgba(27, 27, 27, 0.7);
}

.arcana-team {
  display: grid;
  gap: 24px;
}

.arcana-team-header h2 {
  margin: 8px 0 10px;
  font-family: "Playfair Display", serif;
  font-size: 2rem;
}

.arcana-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.arcana-card {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  padding: 22px;
  border: 1px solid rgba(27, 27, 27, 0.1);
  display: grid;
  gap: 16px;
  position: relative;
}

.arcana-card.leader {
  background: linear-gradient(135deg, rgba(217, 86, 60, 0.18), rgba(255, 255, 255, 0.95));
  border-color: rgba(217, 86, 60, 0.3);
  box-shadow: 0 20px 34px rgba(217, 86, 60, 0.15);
}

.arcana-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.arcana-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(47, 42, 40, 0.12);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--charcoal);
}

.arcana-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.arcana-role {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: rgba(27, 27, 27, 0.65);
}

.arcana-pill {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.08);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--charcoal);
}

.arcana-card p {
  margin: 0;
  color: rgba(27, 27, 27, 0.7);
}

.arcana-details {
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.65);
}

.arcana-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.arcana-detail span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(27, 27, 27, 0.55);
}

.checkout {
  padding: 48px 64px 96px;
  display: grid;
  gap: 40px;
}

.checkout-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  align-items: center;
  animation: fade-rise 0.6s ease both;
}

.checkout-summary {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  display: grid;
  gap: 12px;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.08);
}

.checkout-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.checkout-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 2.2rem;
  font-weight: 600;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
}

.checkout-form {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  display: grid;
  gap: 24px;
}

.checkout-section h3 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
}

.checkout-fields {
  display: grid;
  gap: 14px;
}

.checkout-fields label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: rgba(27, 27, 27, 0.8);
}

.checkout-fields input,
.checkout-fields select {
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  background: #fff;
}

.checkout-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkout-panel {
  display: grid;
  gap: 20px;
}

.checkout-panel-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  display: grid;
  gap: 12px;
}

.checkout-panel-card.subtle {
  background: rgba(246, 240, 232, 0.85);
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.checkout-summary-row.total {
  border-top: 1px solid rgba(27, 27, 27, 0.12);
  padding-top: 12px;
}

.checkout-help {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.65);
}

.checkout-message {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: rgba(27, 27, 27, 0.7);
}

.checkout-message.is-success {
  color: #246b3f;
  font-weight: 600;
}

.checkout-message.is-error {
  color: #a1342c;
  font-weight: 600;
}

.verify {
  padding: 64px 64px 120px;
  display: grid;
  place-items: center;
}

.verify-card {
  max-width: 520px;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 36px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.12);
  display: grid;
  gap: 18px;
  text-align: center;
  animation: fade-rise 0.6s ease both;
}

.verify-email {
  font-weight: 600;
  color: rgba(27, 27, 27, 0.8);
}

.verify-form {
  display: grid;
  gap: 18px;
}

.verify-form input {
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 14px 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.3rem;
  background: #fff;
}

.verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.verify-message {
  min-height: 1.2rem;
  font-size: 0.95rem;
  color: rgba(27, 27, 27, 0.7);
}

.verify-message.is-success {
  color: #246b3f;
  font-weight: 600;
}

.verify-message.is-error {
  color: #a1342c;
  font-weight: 600;
}

.is-hidden {
  display: none;
}

@media (max-width: 720px) {
  .site-header {
    padding: 18px 24px;
  }

  .home,
  .projects,
  .templates,
  .pricing,
  .checkout,
  .legal,
  .phiona-portal {
    padding: 32px 24px 64px;
  }

  .legal-pages {
    grid-template-columns: 1fr;
  }

  .phiona-portal {
    grid-template-columns: 1fr;
  }

  .phiona-studio {
    grid-template-columns: 1fr;
  }

  .phiona-nav {
    position: static;
    order: -1;
  }

  .verify {
    padding: 32px 24px 64px;
  }

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

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

.template-preview .preview-title {
  height: 12px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.18);
  width: 60%;
}

.template-preview .preview-hero {
  height: 80px;
  border-radius: 12px;
  background: rgba(217, 86, 60, 0.18);
}

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

.template-preview .preview-columns span {
  height: 36px;
  border-radius: 10px;
  background: rgba(47, 42, 40, 0.08);
}

.template-preview .preview-footer {
  height: 10px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.12);
  width: 45%;
}

.template-preview.is-photo-essay .preview-hero {
  height: 110px;
  background: linear-gradient(120deg, rgba(217, 86, 60, 0.25), rgba(47, 42, 40, 0.12));
}

.template-preview.is-photo-essay .preview-columns {
  grid-template-columns: 1fr;
}

.template-preview.is-photo-essay .preview-columns span {
  height: 26px;
}

.template-preview.is-interview .preview-hero {
  height: 60px;
  background: rgba(47, 42, 40, 0.12);
}

.template-preview.is-interview .preview-columns span {
  height: 28px;
}

.template-features {
  margin: 0;
  padding-left: 18px;
  color: rgba(27, 27, 27, 0.7);
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.template-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.template-form input {
  flex: 1;
  min-width: 200px;
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px 16px;
  font-family: "Space Grotesk", sans-serif;
}

.template-form button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.templates-error {
  margin-top: -16px;
}

.editor {
  padding: 36px 48px 80px;
}

.is-editor .editor {
  height: calc(100vh - 96px);
  margin-top: 96px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.is-editor.nav-hidden .editor {
  height: 100vh;
  margin-top: 0;
}

.alert {
  margin: 0 48px 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(217, 86, 60, 0.12);
  color: #8e2f23;
  border: 1px solid rgba(217, 86, 60, 0.3);
  font-size: 0.9rem;
}

.is-editor .alert {
  margin: 0;
}

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

.editor-header h1 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 2.2rem;
}

.editor-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(217, 86, 60, 0.1);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.8rem;
}

.chip-button {
  border: 1px solid rgba(217, 86, 60, 0.4);
  background: rgba(217, 86, 60, 0.18);
  cursor: pointer;
}

.chip-button.is-active {
  background: var(--accent);
  color: #fff;
}

.history-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.12);
  padding: 18px;
  display: none;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.history-panel.is-open {
  display: flex;
}

.history-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.history-panel-header h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
}

.history-panel-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-entry {
  display: grid;
  grid-template-columns: 22px auto;
  gap: 12px;
  align-items: start;
  position: relative;
}

.history-entry.is-active {
  --history-accent: rgba(217, 86, 60, 0.85);
}

.history-entry::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 13px;
  bottom: -16px;
  width: 2px;
  background: rgba(27, 27, 27, 0.12);
  z-index: 0;
}

.history-entry:last-child::before {
  bottom: 13px;
}

.history-entry-node {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(27, 27, 27, 0.25);
  margin-top: 6px;
  z-index: 1;
}

.history-entry.is-branch .history-entry-node {
  background: rgba(217, 86, 60, 0.5);
}

.history-entry-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: calc(var(--branch-depth, 0) * 18px);
  height: 2px;
  background: rgba(27, 27, 27, 0.12);
  transform: translateY(-50%);
}

.history-entry.is-root .history-entry-node::before {
  display: none;
}

.history-entry.is-active .history-entry-node {
  background: var(--history-accent, rgba(217, 86, 60, 0.85));
  box-shadow: 0 0 0 6px rgba(217, 86, 60, 0.12);
}

.history-entry-card {
  width: min(300px, 100%);
  min-height: 120px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(246, 240, 232, 0.75);
  border: 1px solid rgba(27, 27, 27, 0.08);
  display: grid;
  gap: 6px;
  margin-left: calc(var(--branch-depth, 0) * 18px);
}

.history-entry.is-active .history-entry-card {
  border-color: rgba(217, 86, 60, 0.5);
  box-shadow: 0 10px 24px rgba(217, 86, 60, 0.12);
}

.history-entry-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 0.95rem;
}

.history-entry-meta {
  font-size: 0.8rem;
  color: rgba(27, 27, 27, 0.6);
}

.history-entry-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(27, 27, 27, 0.12);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.history-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-entry-action {
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.18);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.history-entry-action.is-primary {
  background: rgba(217, 86, 60, 0.15);
  border-color: rgba(217, 86, 60, 0.4);
  color: var(--accent-dark);
}

.version-shell {
  display: none;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  height: 100%;
}

.version-shell.is-active {
  display: flex;
}

.version-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.version-title {
  font-weight: 700;
  font-size: 1rem;
}

.version-meta {
  font-size: 0.8rem;
  color: rgba(27, 27, 27, 0.6);
}

.version-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  min-height: 0;
}

.version-column {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.version-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(27, 27, 27, 0.5);
}

.version-preview {
  --live-scale: 0.58;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  overflow: auto;
  padding-bottom: 12px;
}

.version-preview .live-page {
  align-self: center;
}

.version-shell .fyona-block.version-add {
  --block-bg: rgba(84, 155, 85, 0.14);
  border-color: rgba(84, 155, 85, 0.35);
}

.version-shell .fyona-block.version-del {
  --block-bg: rgba(217, 86, 60, 0.18);
  border-color: rgba(217, 86, 60, 0.4);
  text-decoration: line-through;
}

.version-shell .fyona-block.version-del * {
  text-decoration: line-through;
}

.version-shell .fyona-block.version-add {
  --block-bg: rgba(84, 155, 85, 0.2);
  border-color: rgba(84, 155, 85, 0.45);
}
.editor-workspace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  position: relative;
}

.is-editor .editor-workspace {
  flex: 1;
  min-height: 0;
}

.editor-pane,
.preview-pane {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.editor-drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 27, 27, 0.35);
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.editor-workspace.is-dragging .editor-drop-overlay {
  opacity: 1;
}

.editor-drop-card {
  background: rgba(245, 240, 232, 0.95);
  border: 1px dashed rgba(27, 27, 27, 0.4);
  border-radius: 16px;
  padding: 18px 22px;
  text-align: center;
  box-shadow: 0 16px 32px rgba(27, 27, 27, 0.18);
  max-width: 360px;
}

.editor-drop-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.editor-drop-meta {
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.7);
}

.is-editor .editor-pane,
.is-editor .preview-pane {
  min-height: 0;
}

.code-pane,
.agent-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.is-editor .code-pane,
.is-editor .agent-pane {
  min-height: 0;
}

.agent-pane {
  display: none;
  gap: 16px;
}

.editor-workspace.agent-mode .code-pane {
  display: none;
}

.editor-workspace.agent-mode .agent-pane {
  display: flex;
}

.pane-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.file-list {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(246, 240, 232, 0.7);
  border: 1px solid rgba(27, 27, 27, 0.08);
}

.file-list-title {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.file-list ul {
  margin: 0;
  padding-left: 18px;
}

.file-list li {
  display: flex;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.file-list-item {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.file-list-item:hover {
  text-decoration: underline;
}

.file-list-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.file-list li.active {
  font-weight: 600;
}

.file-list li.is-preview .file-list-item {
  font-weight: 600;
  color: var(--accent-dark);
}

.file-upload-status {
  margin-top: 8px;
  min-height: 1em;
  font-size: 0.8rem;
  color: rgba(27, 27, 27, 0.7);
}

.file-upload-status.is-error {
  color: #8d2b2b;
}

#latex-input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.save-status {
  font-size: 0.85rem;
  color: rgba(27, 27, 27, 0.7);
}

.agent-stream {
  flex: 1;
  min-height: 200px;
  background: rgba(246, 240, 232, 0.9);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(27, 27, 27, 0.08);
  overflow-y: auto;
}

.is-editor .agent-stream {
  min-height: 0;
}

.agent-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-alert-panel {
  display: none;
  border-radius: 14px;
  border: 1px dashed rgba(27, 27, 27, 0.35);
  background: rgba(27, 27, 27, 0.04);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.agent-alert-panel.is-visible {
  display: block;
}

.agent-alert-message {
  white-space: pre-line;
  font-size: 0.84rem;
  color: var(--charcoal);
}

.agent-alert-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.agent-alert {
  display: none;
  position: relative;
  width: 18px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  margin-left: 4px;
  cursor: pointer;
}

.agent-alert.is-visible {
  display: inline-flex;
}

.agent-alert::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0 auto;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 16px solid #f5c04f;
}

.agent-alert::after {
  content: "!";
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  color: #2b2724;
}

.agent-tab-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(27, 27, 27, 0.12);
}

.agent-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.agent-tab.is-active {
  background: rgba(27, 27, 27, 0.08);
  color: var(--charcoal);
}

.agent-tab-meta {
  font-size: 0.72rem;
  opacity: 0.65;
  white-space: nowrap;
}

.agent-tab-close {
  border: none;
  background: rgba(27, 27, 27, 0.08);
  color: var(--charcoal);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.agent-tab.is-active + .agent-tab-close {
  background: rgba(27, 27, 27, 0.35);
  color: #fff;
}

.agent-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(217, 86, 60, 0.12);
  color: var(--accent-dark);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.agent-bubble p {
  margin: 0 0 0.65rem;
}

.agent-bubble p:last-child {
  margin-bottom: 0;
}

.agent-bubble h1,
.agent-bubble h2,
.agent-bubble h3,
.agent-bubble h4,
.agent-bubble h5,
.agent-bubble h6 {
  margin: 0 0 0.65rem;
  font-weight: 600;
}

.agent-bubble h1 {
  font-size: 1.1rem;
}

.agent-bubble h2 {
  font-size: 1.05rem;
}

.agent-bubble h3 {
  font-size: 1rem;
}

.agent-bubble h4 {
  font-size: 0.95rem;
}

.agent-bubble h5 {
  font-size: 0.9rem;
}

.agent-bubble h6 {
  font-size: 0.85rem;
}

.agent-bubble ul,
.agent-bubble ol {
  margin: 0 0 0.65rem 1.2rem;
  padding: 0;
}

.agent-bubble li {
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.agent-bubble li:last-child {
  margin-bottom: 0;
}

.agent-bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.agent-bubble code {
  font-family: "Space Grotesk", monospace;
  background: rgba(27, 27, 27, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.9em;
}

.agent-bubble pre {
  margin: 0 0 0.65rem;
  padding: 10px 12px;
  background: rgba(27, 27, 27, 0.08);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.4;
}

.agent-bubble pre code {
  background: transparent;
  padding: 0;
  font-size: 1em;
}

.agent-bubble.is-confirm {
  background: rgba(27, 27, 27, 0.08);
  border: 1px dashed rgba(27, 27, 27, 0.35);
  color: var(--charcoal);
}

.agent-bubble.is-actions {
  background: rgba(27, 27, 27, 0.06);
  color: var(--charcoal);
}

.agent-actions {
  margin: 0;
}

.agent-actions summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.agent-actions summary::-webkit-details-marker {
  display: none;
}

.agent-actions ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.agent-actions li {
  margin-bottom: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.agent-bubble.is-user {
  background: rgba(27, 27, 27, 0.08);
  color: var(--charcoal);
}

.agent-input {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-input select {
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px 16px;
  font-family: "Space Grotesk", sans-serif;
  background: #fff;
}

.agent-input input {
  flex: 1;
  min-width: 220px;
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px 16px;
  font-family: "Space Grotesk", sans-serif;
}

.agent-input button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.agent-input button.is-hidden {
  display: none;
}

.agent-input button.is-stop {
  background: #8b2f2f;
}

.preview-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f6f0e8;
  border-radius: 12px;
  border: 1px dashed rgba(27, 27, 27, 0.2);
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-pill.is-live {
  background: rgba(104, 181, 255, 0.2);
  color: #2b5f8b;
}

.status-pill.is-rendered {
  background: rgba(124, 195, 140, 0.2);
  color: #2e6b3a;
}

.status-pill.is-error {
  background: rgba(220, 86, 86, 0.2);
  color: #8d2b2b;
}

.status-pill.is-pending {
  background: rgba(235, 199, 90, 0.25);
  color: #7a5a16;
}

.status-pill.is-file {
  background: rgba(150, 140, 230, 0.22);
  color: #40327b;
}

.pdf-viewer {
  flex: 1;
  display: grid;
  gap: 12px;
  min-height: 60vh;
  height: calc(100vh - 260px);
}

.is-editor .preview-pane {
  overflow: hidden;
}

.is-editor .pdf-viewer {
  min-height: 0;
  height: 100%;
}

.live-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  min-height: 60vh;
  height: 100%;
  align-items: stretch;
}

.live-shell.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.live-shell.is-single .live-thumbs {
  display: none;
}

.file-shell {
  display: none;
  grid-template-rows: auto 1fr;
  gap: 12px;
  height: 100%;
}

.file-shell.is-active {
  display: grid;
}

.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-preview-title {
  font-weight: 600;
}

.file-preview-meta {
  font-size: 0.8rem;
  color: rgba(27, 27, 27, 0.65);
}

.file-preview-body {
  background: #f6f0e8;
  border-radius: 12px;
  border: 1px dashed rgba(27, 27, 27, 0.2);
  padding: 12px;
  overflow: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.file-preview-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  padding: 16px;
  margin: 0;
}

.file-preview-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  align-self: center;
}

.file-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.file-preview-fallback {
  display: grid;
  gap: 8px;
  color: rgba(27, 27, 27, 0.75);
}

.file-preview-link {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.file-preview-link:hover {
  text-decoration: underline;
}

.live-main {
  --fyona-body-font: "Playfair Display", serif;
  --fyona-heading-font: "Playfair Display", serif;
  --fyona-ink: #2b2724;
  --fyona-muted: #7a6b61;
  --fyona-accent: var(--accent);
  --fyona-page-bg: #fff;
  --fyona-surface: radial-gradient(circle at 12% 10%, rgba(245, 238, 228, 0.55), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(247, 234, 220, 0.5), transparent 30%), #fff;
  --fyona-shell: radial-gradient(circle at 30% 20%, #fdf8f3 0%, #f2e6d9 36%, #efe2d5 85%);
  background: var(--fyona-shell);
  border-radius: 14px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  padding: 16px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  grid-column: 1;
}

.live-main.is-html {
  padding: 12px;
}

.html-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #f6f0e8;
  display: block;
}

.version-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.live-page.is-html {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.live-page-surface.is-html {
  padding: 0;
  background: transparent;
}

.live-page-surface.is-html .html-preview-frame {
  border-radius: 0;
  background: #f7f3ea;
}

.live-main.live-theme-cobalt,
.version-preview.live-theme-cobalt {
  --fyona-body-font: "Manrope", sans-serif;
  --fyona-heading-font: "DM Serif Display", serif;
  --fyona-ink: #1e2a3b;
  --fyona-muted: #5a6d86;
  --fyona-accent: #3a6ea5;
  --fyona-page-bg: #f7fbff;
  --fyona-surface: radial-gradient(circle at 14% 12%, rgba(220, 234, 250, 0.7), transparent 40%),
    radial-gradient(circle at 84% 16%, rgba(218, 232, 249, 0.6), transparent 38%), #f7fbff;
  --fyona-shell: radial-gradient(circle at 30% 20%, #f7fbff 0%, #e8f0f8 50%, #dfe9f4 100%);
}

.live-main.live-theme-petal,
.version-preview.live-theme-petal {
  --fyona-body-font: "Playfair Display", serif;
  --fyona-heading-font: "DM Serif Display", serif;
  --fyona-ink: #3b2b2f;
  --fyona-muted: #7a5b64;
  --fyona-accent: #c95d7b;
  --fyona-page-bg: #fff7f9;
  --fyona-surface: radial-gradient(circle at 16% 14%, rgba(253, 231, 239, 0.7), transparent 40%),
    radial-gradient(circle at 86% 12%, rgba(250, 221, 232, 0.6), transparent 40%), #fff7f9;
  --fyona-shell: radial-gradient(circle at 30% 20%, #fff7f9 0%, #f7e8ee 50%, #f2dfe7 100%);
}

.live-main.live-theme-ink,
.version-preview.live-theme-ink {
  --fyona-body-font: "Manrope", sans-serif;
  --fyona-heading-font: "DM Serif Display", serif;
  --fyona-ink: #1f1f24;
  --fyona-muted: #5c5f69;
  --fyona-accent: #c29b5b;
  --fyona-page-bg: #fbfaf7;
  --fyona-surface: radial-gradient(circle at 18% 14%, rgba(243, 239, 228, 0.7), transparent 40%),
    radial-gradient(circle at 84% 14%, rgba(242, 235, 222, 0.6), transparent 40%), #fbfaf7;
  --fyona-shell: radial-gradient(circle at 28% 18%, #fbfaf7 0%, #eee8dc 52%, #e1d8c8 100%);
}

.live-main.live-theme-sand,
.version-preview.live-theme-sand {
  --fyona-body-font: "Playfair Display", serif;
  --fyona-heading-font: "Playfair Display", serif;
  --fyona-ink: #2b2724;
  --fyona-muted: #7a6b61;
  --fyona-accent: #d9563c;
  --fyona-page-bg: #fffaf4;
  --fyona-surface: radial-gradient(circle at 12% 10%, rgba(248, 236, 224, 0.65), transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(245, 232, 219, 0.6), transparent 40%), #fffaf4;
  --fyona-shell: radial-gradient(circle at 30% 20%, #fff9f1 0%, #f3e5d6 50%, #edddcc 100%);
}

.live-page {
  --page-width: 794px;
  --page-height: 1123px;
  width: calc(var(--page-width) * var(--live-scale, 1));
  min-width: calc(var(--page-width) * var(--live-scale, 1));
  max-width: calc(var(--page-width) * var(--live-scale, 1));
  height: calc(var(--page-height) * var(--live-scale, 1));
  min-height: calc(var(--page-height) * var(--live-scale, 1));
  max-height: calc(var(--page-height) * var(--live-scale, 1));
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.live-page.is-active {
  box-shadow: 0 0 0 2px rgba(217, 86, 60, 0.35), 0 16px 36px rgba(0, 0, 0, 0.16),
    0 2px 10px rgba(0, 0, 0, 0.06);
}

.live-page-surface {
  width: var(--page-width);
  min-width: var(--page-width);
  max-width: var(--page-width);
  height: var(--page-height);
  min-height: var(--page-height);
  max-height: var(--page-height);
  background: var(--fyona-surface);
  padding: 64px 72px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  transform: scale(var(--live-scale, 1));
  transform-origin: top center;
}

.live-page-content {
  width: 100%;
  height: 100%;
  max-width: 660px;
  margin: 0 auto;
  overflow: hidden;
  font-family: var(--fyona-body-font, "Playfair Display", serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--fyona-ink, #2b2724);
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  word-break: break-word;
}

.live-page-content h1,
.live-page-content h2,
.live-page-content h3,
.live-page-content h4 {
  font-family: var(--fyona-heading-font, "Playfair Display", serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 1.2em 0 0.5em;
}

.live-page-content h1 {
  font-size: 2.1em;
  margin-top: 0;
}

.live-page-content h2 {
  font-size: 1.55em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-page-content h3 {
  font-size: 1.2em;
  font-weight: 600;
}

.live-page-content p {
  margin: 0 0 0.9em;
}

.live-page-content ul,
.live-page-content ol {
  margin: 0.2em 0 1em;
  padding-left: 0;
  list-style: none;
}

.live-page-content li {
  margin: 0.2em 0;
}

.live-page-content li > p {
  display: inline;
  margin: 0;
}

.live-page-content .title {
  font-size: 2.4em;
  margin: 0 0 0.2em;
}

.live-page-content .author,
.live-page-content .date {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fyona-muted, #7a6b61);
  margin: 0 0 0.6em;
}

.live-page-content .center,
.live-page-content center {
  text-align: center;
}

.live-page-content blockquote {
  margin: 1.2em 0;
  padding: 0.2em 1.4em;
  border-left: 4px solid var(--fyona-accent, var(--accent));
  color: #4c423d;
  font-style: italic;
  background: linear-gradient(90deg, rgba(217, 86, 60, 0.08), transparent);
}

.live-page-content hr {
  border: none;
  border-top: 1px solid rgba(27, 27, 27, 0.14);
  margin: 1.4em 0;
}

.live-page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}

.live-page-content th,
.live-page-content td {
  border: 1px solid rgba(27, 27, 27, 0.16);
  padding: 8px 10px;
  text-align: left;
}

.live-page-content th {
  background: rgba(217, 86, 60, 0.08);
  font-weight: 600;
}

.live-page-content code {
  font-family: "Space Grotesk", monospace;
  background: rgba(27, 27, 27, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

.live-page-content img {
  max-width: 100%;
  display: block;
  margin: 0.8em auto;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.live-page-content figure {
  margin: 1em auto;
  text-align: center;
}

.live-page-content figcaption {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85em;
  color: #6a5b54;
  margin-top: 0.4em;
}

.live-page-content sup {
  font-size: 0.7em;
  vertical-align: super;
}

.live-page-content .fyona-vspace {
  display: block;
  width: 100%;
}

.live-page-content .fyona-vspace.is-fill {
  min-height: 2em;
}

.live-page::after {
  content: attr(data-page);
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(27, 27, 27, 0.55);
}

.fyona-block {
  margin: 1.2em 0;
  padding: 1.1em 1.4em;
  border-radius: 12px;
  background: var(--block-bg, rgba(217, 86, 60, 0.08));
  border: 1px solid rgba(27, 27, 27, 0.12);
  color: var(--block-color, var(--fyona-ink, #2b2724));
  font-family: var(--block-font, var(--fyona-body-font, "Playfair Display", serif));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.fyona-block h1,
.fyona-block h2,
.fyona-block h3,
.fyona-block h4 {
  font-family: var(--block-heading-font, var(--fyona-heading-font, "Playfair Display", serif));
}

.fyona-block.hero {
  --block-bg: rgba(58, 110, 165, 0.1);
  --block-color: #1e2a3b;
}

.fyona-block.sidebar {
  --block-bg: rgba(123, 93, 120, 0.12);
  --block-color: #3b2b2f;
}

.fyona-block.highlight {
  --block-bg: rgba(201, 93, 123, 0.12);
  --block-color: #3b2b2f;
}

.fyona-box {
  position: absolute;
  left: 0;
  top: 0;
  width: 240px;
  min-height: 80px;
  padding: 14px 16px;
  background: var(--box-bg, rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(27, 27, 27, 0.14);
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
  color: var(--box-color, var(--fyona-ink, #2b2724));
  font-family: var(--box-font, var(--fyona-body-font, "Playfair Display", serif));
  overflow: hidden;
}

.fyona-box h1,
.fyona-box h2,
.fyona-box h3,
.fyona-box h4 {
  font-family: var(--box-heading-font, var(--fyona-heading-font, "Playfair Display", serif));
}

.fyona-box.is-outline {
  background: transparent;
  border: 2px solid var(--box-accent, var(--fyona-accent, var(--accent)));
  box-shadow: none;
}

.gui-mode .fyona-box {
  cursor: grab;
}

.gui-mode .fyona-box:hover,
.gui-mode .fyona-block:hover {
  outline: 1px dashed rgba(217, 86, 60, 0.35);
  outline-offset: 2px;
}

.gui-mode .fyona-box.is-active {
  outline: 2px solid #d9563c;
  outline-offset: 2px;
}

.gui-mode .fyona-box.is-dragging {
  cursor: grabbing;
}

.fyona-box .fyona-box-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fffaf4;
  border: 2px solid #d9563c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  touch-action: none;
  display: none;
  z-index: 2;
}

.gui-mode .fyona-box.is-active .fyona-box-handle {
  display: block;
}

.fyona-box .fyona-box-handle[data-dir="nw"] {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.fyona-box .fyona-box-handle[data-dir="ne"] {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.fyona-box .fyona-box-handle[data-dir="sw"] {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.fyona-box .fyona-box-handle[data-dir="se"] {
  bottom: -7px;
  right: -7px;
  cursor: nwse-resize;
}

.fyona-text-editor {
  position: fixed;
  z-index: 30;
  background: #fffaf4;
  border: 1px solid rgba(27, 27, 27, 0.18);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
}

.fyona-text-editor textarea {
  width: 100%;
  min-height: 140px;
  border-radius: 10px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  padding: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

.fyona-text-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.fyona-main-debug {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;
  background: rgba(20, 18, 16, 0.75);
  color: #fffaf4;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  pointer-events: none;
  white-space: pre-line;
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fyona-main-debug.is-visible {
  opacity: 1;
}

.fyona-html-placeholder {
  background: rgba(120, 120, 120, 0.15);
  border: 1px dashed rgba(80, 80, 80, 0.5);
  border-radius: 4px;
  min-height: 8px;
  box-sizing: border-box;
}

.fyona-context-menu {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  min-width: 140px;
  background: #1f1c18;
  color: #fffaf4;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fyona-context-menu-item {
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.fyona-context-menu-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.fyona-context-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.live-thumbs {
  background: rgba(246, 240, 232, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  padding: 10px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  height: 100%;
  grid-column: 2;
}

.live-thumb {
  width: 100%;
  border-radius: 6px;
  background: #fff;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  padding: 6px 4px 10px;
  position: relative;
}

.live-thumb.is-active {
  border-color: var(--accent);
}

.live-thumb .live-page {
  --live-scale: 0.18;
  box-shadow: none;
}

.live-thumb::after {
  content: attr(data-page);
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(27, 27, 27, 0.55);
}

.pdf-shell {
  display: none;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  min-height: 60vh;
  height: 100%;
  align-items: stretch;
}

.pdf-shell.is-active {
  display: grid;
}

.pdf-main {
  background: #f6f0e8;
  border-radius: 12px;
  border: 1px dashed rgba(27, 27, 27, 0.2);
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  height: 100%;
  grid-column: 1;
}

.pdf-main canvas {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  background: #fff;
}

.pdf-thumbs {
  background: rgba(246, 240, 232, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  padding: 10px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  height: 100%;
  grid-column: 2;
}

.pdf-thumbs .thumb {
  width: 100%;
  border-radius: 6px;
  background: #fff;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.pdf-thumbs .thumb.is-active {
  border-color: var(--accent);
}

.preview-canvas .page {
  background: #fff;
  margin: 0 auto 18px;
  padding: 32px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  width: min(100%, 620px);
  border-radius: 6px;
}

.preview-placeholder,
.preview-error {
  font-size: 0.9rem;
  color: rgba(27, 27, 27, 0.7);
}

.preview-error {
  color: #a1342c;
}

@media (max-width: 760px) {
  .site-header {
    padding: 20px 24px;
  }

  .home,
  .editor,
  .templates,
  .arcana {
    padding: 32px 24px 64px;
  }

  .alert {
    margin: 0 24px 24px;
  }

  .pdf-viewer {
    grid-template-columns: 1fr;
    height: auto;
  }

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

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

  .live-main,
  .live-thumbs,
  .pdf-main,
  .pdf-thumbs {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .intro-shell {
    padding: 28px 22px;
  }

  .intro-layout {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .intro-visual {
    width: 100%;
    justify-items: start;
  }

  .intro-screen {
    max-width: 100%;
  }

  .intro-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .intro-btn {
    width: 100%;
    justify-content: center;
  }
}

@keyframes boot-line {
  0% {
    opacity: 0.2;
    transform: translateY(6px);
  }
  40% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0.2;
    transform: translateY(-4px);
  }
}

@keyframes file-pop {
  0% {
    opacity: 0.2;
    transform: translateX(6px);
  }
  40% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0.2;
    transform: translateX(-6px);
  }
}

@keyframes code-glow {
  0% {
    opacity: 0.15;
  }
  45% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.2;
  }
}

@keyframes caret-blink {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

@keyframes preview-pulse {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

@keyframes policy-scan {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes welcome-glow {
  0% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
}

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