/* ============================================
   RANDOM DECISION MAKER - Shared Styles
   Aesthetic: Editorial playful — warm cream, deep ink, electric coral
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,700;9..144,900&family=Geist+Mono:wght@400;500&family=Geist:wght@300;400;500;600;700&display=swap');

:root {
  --cream: #f5efe4;
  --cream-deep: #ece4d3;
  --ink: #1a1815;
  --ink-soft: #3a3530;
  --coral: #ff5436;
  --coral-soft: #ff7a5c;
  --mint: #b8d8c2;
  --butter: #f5d76e;
  --lavender: #c8b8e8;
  --paper: #fefcf7;
  --shadow-ink: 0 8px 0 var(--ink);
  --shadow-ink-sm: 0 4px 0 var(--ink);
  --shadow-ink-tight: 0 2px 0 var(--ink);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Geist', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26, 24, 21, 0.06) 1px, transparent 0);
  background-size: 24px 24px;
}

::selection {
  background: var(--coral);
  color: var(--paper);
}

/* ===== Typography ===== */
.serif { font-family: 'Fraunces', Georgia, serif; }
.mono { font-family: 'Geist Mono', monospace; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
  backdrop-filter: blur(10px);
}

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

.logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.logo-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--paper);
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

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

.nav-links a.active {
  background: var(--coral);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--paper);
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 2px solid var(--ink);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; text-align: left; }
  .nav-toggle { display: block; }
}

/* ===== Hero ===== */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  margin-bottom: 1.5rem;
}

.hero h1 .accent {
  font-style: italic;
  color: var(--coral);
}

.hero h1 .underline {
  position: relative;
  display: inline-block;
}

.hero h1 .underline::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.05em;
  height: 0.25em;
  background: var(--butter);
  z-index: -1;
  transform: skewY(-1deg);
}

.hero p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-ink-sm);
}

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

.btn:active {
  transform: translate(0, 2px);
  box-shadow: var(--shadow-ink-tight);
}

.btn-primary {
  background: var(--coral);
  color: var(--paper);
}

.btn-dark {
  background: var(--ink);
  color: var(--cream);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-ink-tight);
}

.btn-sm:hover {
  transform: translate(-1px, -1px);
  box-shadow: 0 3px 0 var(--ink);
}

/* ===== Tool Card Grid ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.tool-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 1.75rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-ink-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.tool-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 0 7px 0 var(--ink);
}

.tool-card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.tool-card:nth-child(1) .tool-card-icon { background: var(--coral); color: var(--paper); }
.tool-card:nth-child(2) .tool-card-icon { background: var(--butter); }
.tool-card:nth-child(3) .tool-card-icon { background: var(--mint); }
.tool-card:nth-child(4) .tool-card-icon { background: var(--lavender); }
.tool-card:nth-child(5) .tool-card-icon { background: var(--ink); color: var(--cream); }

.tool-card h3 {
  font-size: 1.5rem;
  margin: 0;
}

.tool-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex-grow: 1;
}

.tool-card-arrow {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  align-self: flex-end;
  font-size: 1rem;
}

/* ===== Tool Pages ===== */
.tool-page {
  padding: 2rem 0 4rem;
}

.tool-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tool-header .breadcrumb {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.tool-header .breadcrumb a {
  color: var(--coral);
  text-decoration: none;
}

.tool-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.75rem;
}

.tool-header p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 auto;
}

.tool-panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-ink);
  margin-bottom: 2rem;
}

@media (min-width: 720px) {
  .tool-panel { padding: 2.5rem; }
}

.tool-panel h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

label .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  font-family: 'Geist', sans-serif;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  transition: background 0.15s;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  background: var(--paper);
  box-shadow: 0 0 0 4px var(--butter);
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: 'Geist Mono', monospace;
  font-size: 0.95rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
}

.input-row > * { flex: 1; min-width: 0; }

.input-group {
  margin-bottom: 1.25rem;
}

.controls-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* ===== Result Display ===== */
.result-display {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.result-display::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(245, 239, 228, 0.08) 1px, transparent 0);
  background-size: 18px 18px;
  pointer-events: none;
}

.result-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral-soft);
  margin-bottom: 0.75rem;
  position: relative;
}

.result-value {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  position: relative;
  word-break: break-word;
  padding: 0 0.5rem;
}

.result-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}

.result-actions .btn {
  background: var(--cream);
  border-color: var(--cream);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  box-shadow: none;
}

.result-actions .btn:hover {
  background: var(--coral);
  color: var(--paper);
  transform: translateY(-2px);
  box-shadow: none;
}

/* ===== Animation utilities ===== */
.pop-in {
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.flash-cycle {
  animation: flashCycle 0.08s linear infinite;
}

@keyframes flashCycle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== Confetti ===== */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 14px;
  pointer-events: none;
  z-index: 9999;
  top: -20px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ===== FAQ / Content sections ===== */
.section {
  margin: 4rem 0;
}

.section-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.section h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 2rem;
  max-width: 600px;
}

.faq-item {
  border-bottom: 1.5px solid var(--ink);
  padding: 1.25rem 0;
  cursor: pointer;
}

.faq-item summary {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.15rem;
  list-style: none;
  position: relative;
  padding-right: 2rem;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding-top: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.use-case {
  padding: 1.25rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-ink-tight);
}

.use-case h4 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.use-case p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ===== Footer ===== */
footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  border-top: 2px solid var(--ink);
  background: var(--cream-deep);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-tagline {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 320px;
}

.footer h4 {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer ul { list-style: none; }
.footer li { margin-bottom: 0.5rem; }
.footer a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer a:hover { color: var(--coral); }

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ===== Wheel Specific ===== */
.wheel-container {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto 1.5rem;
  aspect-ratio: 1;
}

.wheel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(6px 8px 0 var(--ink));
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 32px solid var(--coral);
  filter: drop-shadow(0 2px 0 var(--ink));
  z-index: 5;
}

.wheel-pointer::after {
  content: "";
  position: absolute;
  top: -34px;
  left: -19px;
  width: 0; height: 0;
  border-left: 19px solid transparent;
  border-right: 19px solid transparent;
  border-top: 33px solid var(--ink);
  z-index: -1;
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.3rem;
}

/* ===== Yes/No specific ===== */
.yesno-display {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(4rem, 18vw, 9rem);
  text-align: center;
  line-height: 1;
  padding: 2rem 0;
  letter-spacing: -0.04em;
}

.yesno-yes { color: var(--coral); }
.yesno-no { color: var(--ink); }

/* ===== Teams ===== */
.teams-output {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.team-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--shadow-ink-tight);
}

.team-card.color-1 { background: var(--coral); color: var(--paper); }
.team-card.color-2 { background: var(--butter); }
.team-card.color-3 { background: var(--mint); }
.team-card.color-4 { background: var(--lavender); }
.team-card.color-5 { background: var(--ink); color: var(--cream); }
.team-card.color-6 { background: var(--paper); }

.team-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.team-card ul { list-style: none; }
.team-card li {
  padding: 0.4rem 0;
  border-bottom: 1px solid currentColor;
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.95;
}
.team-card li:last-child { border-bottom: none; }

/* ===== Number Display ===== */
.number-display {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(5rem, 20vw, 11rem);
  line-height: 1;
  text-align: center;
  padding: 1.5rem 0;
  font-feature-settings: "tnum";
  letter-spacing: -0.04em;
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.number-pill {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 1rem;
  border: 2px solid var(--cream);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: var(--ink);
  color: var(--cream);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== Decorative ===== */
.deco-star {
  display: inline-block;
  color: var(--coral);
  animation: spin 8s linear infinite;
  transform-origin: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.divider-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3rem 0;
  font-size: 1.5rem;
  color: var(--coral);
}

.divider-stars::before,
.divider-stars::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--ink);
  max-width: 100px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero { padding: 2.5rem 0 2rem; }
  .tool-panel { padding: 1.25rem; }
  .controls-row { flex-direction: column; }
  .controls-row .btn { width: 100%; }
}

/* ===== Picker Animation ===== */
.picker-cycle {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  word-break: break-word;
}
