/* =========================================================
   FACING FLOW STUDIO — Style Sheet
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Light palette */
  --bg: #f0ebe3;
  --surface: rgba(255, 252, 248, 0.88);
  --surface-2: rgba(255, 255, 255, 0.6);
  --ink: #1a1512;
  --ink-muted: #7a6f65;
  --line: rgba(60, 40, 18, 0.1);
  --accent: #e06320;
  --shadow-sm: 0 4px 18px rgba(80, 50, 20, 0.08);
  --shadow-md: 0 14px 50px rgba(80, 50, 20, 0.12);
  --shadow-lg: 0 28px 80px rgba(80, 50, 20, 0.16);
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --radius-xl: 38px;
  --font: "Inter", system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #131110;
  --surface: rgba(28, 24, 20, 0.92);
  --surface-2: rgba(40, 34, 28, 0.7);
  --ink: #f5f0eb;
  --ink-muted: #9c9087;
  --line: rgba(255, 220, 190, 0.08);
  --accent: #f07030;
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 50px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 15% 5%, rgba(240, 120, 40, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 88% 12%, rgba(250, 190, 160, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(200, 160, 120, 0.15) 0%, transparent 60%);
  transition: background-color 0.35s ease, color 0.35s ease;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 55% 45% at 10% 5%, rgba(220, 80, 20, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 88% 10%, rgba(180, 100, 40, 0.12) 0%, transparent 50%);
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

h1, h2, h3, h4, p, ul, fieldset {
  margin: 0;
  padding: 0;
}

fieldset {
  border: none;
}

ul {
  list-style: none;
}

/* ---------- Shared Layout ---------- */
.page-shell {
  width: min(1300px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .topbar {
  border-color: rgba(255, 255, 255, 0.06);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1f1712, #bf5618);
  color: #fff8f0;
  box-shadow: 0 6px 20px rgba(200, 80, 20, 0.35);
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Pill Buttons ---------- */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pill-primary {
  background: linear-gradient(135deg, #1f1712, #d8601e);
  color: #fff8f0;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(200, 80, 20, 0.28);
}

.pill-primary:hover {
  box-shadow: 0 12px 36px rgba(200, 80, 20, 0.38);
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
  padding: 0;
}

[data-theme="dark"] .hero {
  border-color: rgba(255, 255, 255, 0.07);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 56px 52px;
}

.hero-eyebrow {
  margin-bottom: 14px;
}

.hero-headline {
  font-size: clamp(2.6rem, 5.5vw, 5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

.hero-headline em {
  font-style: italic;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  background: linear-gradient(120deg, #d8601e, #f7a670);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 52ch;
  margin-bottom: 30px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #1f1712, #d8601e);
  color: #fff8f0;
  box-shadow: 0 10px 28px rgba(200, 80, 20, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 16px 40px rgba(200, 80, 20, 0.44);
}

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chips li {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--ink-muted);
}

[data-theme="dark"] .feature-chips li {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Hero stat card */
.hero-stat-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(250, 240, 228, 0.9));
  border: 1px solid rgba(160, 110, 60, 0.1);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 10px 36px rgba(120, 70, 20, 0.1);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .hero-stat-card {
  background: linear-gradient(160deg, rgba(50, 40, 30, 0.9), rgba(35, 28, 20, 0.95));
  border-color: rgba(255, 180, 100, 0.08);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.live-badge {
  font-size: 0.78rem;
  color: #22c55e;
  font-weight: 600;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}

.stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-key {
  color: var(--ink-muted);
}

.stat-row strong {
  font-weight: 600;
}

/* Hero shelf mini-preview */
.hero-shelf-bg {
  position: absolute;
  right: -20px;
  bottom: -10px;
  width: 55%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
}

[data-theme="dark"] .hero-shelf-bg {
  opacity: 0.04;
}

.shelf-strip-outer {
  position: relative;
}

.shelf-strip {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: rgba(30, 20, 10, 0.5);
  border-radius: 12px;
}

.shelf-ledge {
  height: 8px;
  background: rgba(100, 70, 40, 0.4);
  border-radius: 4px;
  margin-top: 4px;
}

/* ---------- Studio (main 2-col) ---------- */
.studio {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* ---------- Panel ---------- */
.panel {
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

[data-theme="dark"] .panel {
  border-color: rgba(255, 255, 255, 0.06);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

/* ---------- Icon / small buttons ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: transform var(--transition), color var(--transition);
}

.icon-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

/* ---------- Section Labels ---------- */
.section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

/* ---------- Preset buttons ---------- */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.preset {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  transition: all var(--transition);
}

.preset:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.preset.active {
  background: linear-gradient(135deg, #1f1712, #cf5c1a);
  color: #fff8f0;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(200, 80, 20, 0.28);
}

/* ---------- Design Form ---------- */
.design-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-muted);
  grid-column: auto;
}

.field.full {
  grid-column: 1 / -1;
}

.field.color-field {
  grid-column: auto;
}

.field span {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

input[type="text"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 99, 32, 0.15);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] select {
  background: rgba(40, 32, 24, 0.8);
}

input[type="color"] {
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 5px;
  cursor: pointer;
  transition: transform var(--transition);
}

input[type="color"]:hover {
  transform: scale(1.03);
}

input[type="range"] {
  width: 100%;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.range-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Export Buttons ---------- */
.export-actions {
  display: flex;
  gap: 8px;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  color: var(--ink-muted);
  transition: all var(--transition);
}

.export-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.export-btn-primary {
  background: linear-gradient(135deg, #1f1712, #d8601e);
  color: #fff8f0;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(200, 80, 20, 0.28);
}

.export-btn-primary:hover {
  box-shadow: 0 10px 30px rgba(200, 80, 20, 0.42);
  color: #fff8f0;
}

/* ---------- Score Strip ---------- */
.score-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.score-card {
  flex: 1;
  min-width: 80px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-key {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.score-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Preview Stage ---------- */
.preview-stage {
  min-height: 480px;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.8) 0%, rgba(240, 228, 214, 0.95) 100%);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .preview-stage {
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 28, 20, 0.9) 0%, rgba(20, 16, 12, 0.98) 100%);
}

/* subtle grid lines */
.preview-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(160, 130, 100, 0.06) 0, rgba(160, 130, 100, 0.06) 1px, transparent 1px, transparent 60px),
    repeating-linear-gradient(0deg, rgba(160, 130, 100, 0.06) 0, rgba(160, 130, 100, 0.06) 1px, transparent 1px, transparent 60px);
  pointer-events: none;
}

.preview-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
}

.preview-canvas svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.15));
}

/* ---------- Brief Summary ---------- */
.brief-summary {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-muted);
  padding-top: 8px;
}

/* ---------- Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.hero {
  animation: fadeSlideUp 0.5s ease both;
}

.controls-panel {
  animation-delay: 0.05s;
}

.preview-panel {
  animation-delay: 0.1s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 36px;
  }

  .hero-stat-card {
    max-width: 480px;
  }

  .hero-shelf-bg {
    display: none;
  }

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

@media (max-width: 700px) {
  .page-shell {
    width: calc(100% - 24px);
    gap: 14px;
  }

  .topbar {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
  }

  .brand-name {
    display: none;
  }

  .hero-inner {
    padding: 28px 22px;
  }

  .hero-headline {
    font-size: 2.4rem;
  }

  .panel {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .form-group {
    grid-template-columns: 1fr;
  }

  .field.full,
  .field.color-field {
    grid-column: auto;
  }

  .score-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .export-actions {
    flex-direction: column;
  }

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

  .preview-stage {
    min-height: 320px;
    padding: 16px 12px;
  }
}
