:root {
  --accent: #4C6F8C;
  --accent-dark: #3C5A72;
  --cta: #B35A33;
  --cta-dark: #9A4A2A;
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --text: #33322E;
  --text-soft: #5C5A51;
  --accent-soft: #DCE7EC;
  --cta-soft: #F6DFD2;
  --border: #DAD5C8;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(51,50,46,0.04);
  --shadow-md: 0 1px 2px rgba(51,50,46,0.04), 0 8px 24px -8px rgba(51,50,46,0.1);
  --shadow-lg: 0 1px 2px rgba(51,50,46,0.05), 0 20px 48px -12px rgba(51,50,46,0.18);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@keyframes storycue-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

body {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  animation: storycue-page-in 0.35s var(--ease) both;
  position: relative;
}

/* Faint paper texture — adds depth without adding colour */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { text-wrap: balance; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

::selection { background: var(--accent); color: #fff; }

/* Themed scrollbar (WebKit) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.topbar {
  width: 100%;
  border-bottom: 1px solid #E7E3D9;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 6px;
  margin-right: auto;
}
.logo svg { color: var(--accent); flex: 0 0 auto; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) {
  font-size: 15px;
  color: var(--text-soft);
  padding: 10px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links a.active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover { border-color: var(--text-soft); }

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 4px 24px 14px;
    gap: 0;
  }
  .nav-links.open a:not(.btn) {
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .nav-links.open a:not(.btn):last-of-type { border-bottom: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--cta); color: #fff; box-shadow: 0 1px 2px rgba(201,104,63,0.25); }
.btn-primary:hover:not(:disabled) { background: var(--cta-dark); }

.btn-secondary { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text-soft); background: var(--surface); }

.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(60,90,114,0.25); }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

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

.pill {
  border-radius: 999px;
  padding: 11px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s var(--ease);
}
.pill:hover:not(.selected) { border-color: var(--text-soft); }
.pill.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

input[type="text"].search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background-color: var(--surface);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-input:hover { border-color: #C7C0B0; }
.search-input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6960' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

input[type="text"], select, textarea {
  font-family: inherit;
  padding: 11px 13px;
  border-radius: 10px;
  border: 2px solid var(--border);
  font-size: 15px;
  color: var(--text);
  background-color: #fff;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
select { padding-right: 38px; }
input[type="text"]:hover, select:hover, textarea:hover { border-color: #C7C0B0; }
input[type="text"]:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.symbol-badge {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.symbol-badge.proud { background: var(--cta-soft); color: var(--cta); }

.result-card {
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
  border: 1px solid transparent;
}
.result-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}
.result-card:hover .result-arrow { transform: translateX(3px); color: var(--accent); }
.result-arrow { transition: transform 0.18s var(--ease), color 0.18s var(--ease); display: inline-flex; }

/* The one authored motion: a story beat settling into place */
@keyframes storycue-settle {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.settle-in { animation: storycue-settle 0.45s var(--ease) both; }

/* Below the width where 3 feature cards fit in one row, stack to 1 column
   instead of orphaning a lone card onto its own row at 2-up tablet widths. */
@media (max-width: 919px) {
  .feature-grid > * { flex-basis: 100% !important; }
}

.creator-form { flex: 1 1 360px; max-width: 420px; }
.creator-preview { flex: 999 1 480px; }

/* The creator's two columns (basis 360 + 480 + gap) need ~930px to sit
   side by side — including iPad portrait, a primary target device. Below
   that the preview wraps onto its own row, but the form's 420px cap used
   to stay in force, leaving a tall dead gap beside it instead of the form
   simply filling the row it's now alone on. */
@media (max-width: 960px) {
  .creator-form { max-width: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .settle-in, body { animation: none; }
  .btn, .pill, input, select, textarea, .search-input, .nav-links a { transition: none; }
}
