:root {
  --bg: #fcf5ec;
  --surface: #fffaf4;
  --text: #24120a;
  --muted: #7a5641;
  --accent: #f28c3b;
  --accent-2: #ffb36b;
  --border: rgba(36, 18, 10, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: absolute;
  top: -0.8rem;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 1.2rem 2rem 0;
  pointer-events: none;
}

.site-header a {
  pointer-events: auto;
}

.site-home {
  color: #fffdf9;
  text-decoration: none;
  font-size: clamp(4.2rem, 7vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0;
  background: transparent;
  border: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.site-home:hover {
  transform: translateY(-1px);
}

.site-nav .site-home {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 0.4rem !important;
  box-shadow: none !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  margin: 0 0.05rem;
  transform-origin: center top;
  transform: translate(-0.7rem, 1.3rem) scale(0.9);
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
  margin: 0 auto;
  max-width: min(1280px, calc(100% - 2rem));
  padding-top: 0.6rem;
  transform: translate(-0.8rem, -0.45rem);
}

.site-nav a {
  color: #fffdf9;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.16);
  white-space: nowrap;
  flex: 1 1 0;
  text-align: center;
  max-width: 13.5rem;
}

.site-header--light .site-nav a {
  color: var(--accent);
  background: rgba(242, 140, 59, 0.12);
}

.site-header--light .site-home {
  color: var(--accent);
  flex-direction: column;
  gap: 0.15rem;
}

.site-header--light .site-nav .site-home {
  transform: translate(-0.7rem, 1.3rem) scale(0.8);
}

.site-home-subtext {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
  margin-top: 0.22rem;
}

.handwritten {
  font-family: "Caveat", cursive;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h2.handwritten {
  font-size: 2.6rem;
}

.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 3rem;
  background-color: var(--bg);
  color: #fffdf9;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: clamp(0.6rem, 1.8vw, 0.22in);
  right: clamp(1rem, 3vw, 0.4in);
  bottom: clamp(1rem, 3.2vw, 0.32in);
  left: clamp(1rem, 3vw, 0.4in);
  border: 7px solid var(--accent);
  border-radius: clamp(0.9rem, 3vw, 1.4rem);
  background:
    linear-gradient(90deg, rgba(20, 12, 7, 0.78) 0%, rgba(20, 12, 7, 0.34) 48%, rgba(20, 12, 7, 0.7) 100%),
    url("Juan.png") top/cover no-repeat;
  background-color: #f4e0c8;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: clamp(0.6rem, 1.8vw, 0.22in);
  right: clamp(1rem, 3vw, 0.4in);
  bottom: clamp(1rem, 3.2vw, 0.32in);
  left: clamp(1rem, 3vw, 0.4in);
  border-radius: clamp(0.9rem, 3vw, 1.4rem);
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.08), rgba(20, 12, 7, 0.08));
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  text-align: center;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 1rem;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 0.7rem;
}

h1,
h2,
h3 {
  line-height: 1.1;
  margin-top: 0;
}

h1 {
  font-size: clamp(4.4rem, 8.2vw, 7rem);
  margin-top: 4.5rem;
  margin-bottom: 2.2rem;
  letter-spacing: 0.02em;
}

.lead {
  color: rgba(255, 253, 249, 0.92);
  font-size: 1.55rem;
  max-width: none;
  margin: 0.25rem auto 2rem;
  line-height: 1.75;
  white-space: nowrap;
}

.btn {
  display: inline-block;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
  transition: transform 180ms ease;
  max-width: none;
  width: fit-content;
  white-space: nowrap;
  cursor: pointer;
}

.hero-content .btn {
  min-width: 312px;
  text-align: center;
  margin: 5.5rem auto 0;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rng-inputs input:disabled {
  opacity: 0.6;
}

.btn-primary {
  background: var(--accent);
  color: #2f1303;
}

.social-strip {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  text-align: center;
}

.social-strip a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.intro-section,
.posts-section {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.2rem 0 3.6rem;
}

.intro-section {
  border-bottom: 1px solid var(--border);
}

.page-hero {
  padding-top: 10rem;
}

.wheel-section {
  padding-top: 8.5rem;
  padding-bottom: 2rem;
}

@media (min-width: 701px) {
  .wheel-section {
    width: min(940px, calc(100% - 4rem));
    margin: 0 auto 0 3rem;
  }

  .spinner-section {
    width: min(700px, calc(100% - 4rem));
    margin: 0 auto 0 3rem;
  }

  .spinner-section .wheel-back-home {
    margin-left: calc((100% - 480px) / 2);
  }
}

.tool-box,
.wheel-app {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 1.5rem;
}

.tool-box {
  margin: 2rem 0;
  max-width: 420px;
}

.wheel-app {
  margin: 1rem auto 0;
  max-width: 940px;
  display: grid;
  grid-template-columns: minmax(280px, 640px) 1fr;
  gap: 2rem;
  align-items: stretch;
  text-align: left;
}

.wheel-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.wheel-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
}

#wheel-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(36, 18, 10, 0.35);
}

.wheel-pointer {
  position: absolute;
  top: -42px;
  left: 50%;
  width: 22px;
  height: 54px;
  margin-left: -11px;
  transform-origin: 50% 0%;
  clip-path: polygon(20% 0%, 80% 0%, 52% 100%, 48% 100%);
  background: var(--accent);
  filter: drop-shadow(0 4px 6px rgba(36, 18, 10, 0.35));
  z-index: 2;
}

.wheel-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  height: 100%;
}

.wheel-sidebar label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}

#wheel-entries {
  width: 100%;
  flex: 1;
  min-height: 0;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: none;
  line-height: 1.6;
}

.wheel-controls {
  display: flex;
  gap: 0.6rem;
}

.wheel-mini-btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.wheel-mini-btn:hover {
  background: var(--accent);
  color: #2f1303;
}

.wheel-mini-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wheel-count {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.wheel-winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(36, 18, 10, 0.55);
}

.wheel-winner-overlay:not([hidden]) {
  display: flex;
}

.wheel-winner-modal {
  width: min(92vw, 760px);
  max-height: min(85vh, 700px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 60px rgba(36, 18, 10, 0.4);
  animation: wheel-winner-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes wheel-winner-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.wheel-winner-banner {
  margin: 0;
  padding: 1.4rem 1rem;
  background: var(--accent);
  color: #2f1303;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1.4rem;
  font-weight: 700;
}

.wheel-winner-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.wheel-winner-name {
  margin: 0;
  font-size: 4.5rem;
  line-height: 1.1;
  color: var(--text);
  word-break: break-word;
}

.wheel-winner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.wheel-back-home {
  display: block;
  width: fit-content;
  margin: 1.75rem 0 0;
  font-size: 1rem;
  padding: 0.75rem 1.4rem;
}

.rng-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.rng-inputs label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.rng-inputs input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.rng-result {
  margin-top: 1.2rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  transform-origin: center;
}

.rng-result--pulse {
  animation: rng-pulse 2.4s;
}

@keyframes rng-pulse {
  0% {
    transform: scale(1);
    animation-timing-function: ease-out;
  }
  20% {
    transform: scale(1.7);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: scale(1);
  }
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti-piece {
  position: fixed;
  width: 5px;
  height: 9px;
  opacity: 1;
  animation: confetti-burst 1.7s ease-out forwards;
}

@keyframes confetti-burst {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

.intro-content {
  max-width: 760px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  box-shadow: 0 8px 24px rgba(36, 18, 10, 0.04);
}

.post-card p {
  color: var(--muted);
}

.madlib-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  max-width: 760px;
  margin: 1.6rem 0 2.2rem;
}

.madlib-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 1.4rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(36, 18, 10, 0.04);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

a.madlib-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(36, 18, 10, 0.1);
}

.madlib-card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.madlib-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
}

.madlib-card-cta {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.madlib-card--soon {
  border-color: var(--border);
  opacity: 0.6;
}

.madlib-card--soon .madlib-card-kicker,
.madlib-card--soon .madlib-card-cta {
  color: var(--muted);
}

@media (max-width: 700px) {
  .madlib-grid {
    grid-template-columns: 1fr;
  }
}

.madlib-form-box.spinner-tool {
  max-width: 480px;
  text-align: left;
}

.madlib-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.madlib-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.madlib-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}

.madlib-field input[type="text"],
.madlib-field select {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.madlib-field input[type="file"] {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
}

.madlib-photo-preview:not([hidden]) {
  margin: 0 0 1.2rem;
  display: flex;
  justify-content: center;
}

.madlib-photo-preview img {
  width: 160px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

#dq-generate-btn {
  width: 100%;
}

.madlib-result {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--border);
}

.madlib-result-label {
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.madlib-link-row {
  display: flex;
  gap: 0.6rem;
}

.madlib-link-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}

.madlib-copy-note {
  min-height: 1.2rem;
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0.5rem 0 0;
}

.madlib-preview-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

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

@media (max-width: 520px) {
  .madlib-field-row {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.spinner-mode-toggle {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 1.75rem;
}

.spinner-mode-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.spinner-mode-btn:hover {
  background: rgba(242, 140, 59, 0.14);
}

.spinner-mode-btn--active {
  background: var(--accent);
  color: #2f1303;
}

.spinner-mode-btn--active:hover {
  background: var(--accent);
}

.spinner-tool {
  text-align: center;
  max-width: 480px;
  margin: 2rem auto;
}

.arrow-bottle-box {
  margin-top: 0.75rem;
}

.spinner-section .intro-content {
  max-width: 480px;
  margin: 0 auto;
}

.spinner-section .intro-content > p {
  margin: 0.25rem 0;
}

.spinner-dial-wrap {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--bg);
  border: 6px solid var(--accent);
  box-shadow: 0 16px 32px rgba(36, 18, 10, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-needle {
  width: 78%;
  height: 78%;
  object-fit: contain;
  pointer-events: none;
}

.spinner-hint {
  margin: 1.1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.coin-toss-box {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
}

.coin-wrap {
  width: min(100%, 200px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  perspective: 1000px;
  cursor: pointer;
}

@keyframes coin-press {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(2.1);
  }
  100% {
    transform: scale(1);
  }
}

.coin {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid #7a3f10;
  box-shadow: 0 16px 32px rgba(36, 18, 10, 0.3);
  backface-visibility: hidden;
  overflow: hidden;
}

.coin-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.coin-portrait {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

.coin-portrait--heads {
  width: 74%;
  height: 82%;
  top: 48.5%;
}

.coin-portrait--tails {
  width: 95%;
  height: 44.6%;
}

.coin-face--heads,
.coin-face--tails {
  background: radial-gradient(circle at 35% 30%, #e8c766 0%, #d4af37 55%, #b8911f 100%);
}

.coin-face--tails {
  transform: rotateX(180deg);
}

@media (max-width: 900px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 1279px) {
  .site-nav {
    justify-content: center;
    row-gap: 0.9rem;
  }

  .site-nav .site-home {
    order: 10;
    flex: 0 0 100% !important;
  }

  .site-header--light .site-nav .site-home {
    margin: 0.4rem auto 0;
    transform: none;
  }

  .page-hero {
    padding-top: 14rem;
  }
}

@media (max-width: 700px) {
  .site-header {
    padding: 2.25rem 1rem 0;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 0.9rem;
    column-gap: 0.35rem;
    transform: none;
  }

  .site-nav a {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1.25;
    white-space: normal;
    max-width: none;
  }

  .site-nav .site-home {
    grid-column: 1 / -1;
    justify-self: center;
    order: 10;
    font-size: 2.6rem;
    margin: 0.35rem 0 0;
    transform: none;
  }

  .site-header--light .site-nav .site-home {
    font-size: 2.6rem;
    margin-top: -1.5rem;
  }

  .site-header--light .site-home-subtext {
    font-size: 1.05rem;
  }

  .hero-section {
    min-height: 100svh;
    padding: 7rem 1rem 2rem;
  }

  .hero-section::before,
  .hero-overlay {
    inset: 0.5rem;
    border-radius: 1rem;
  }

  .hero-content {
    min-width: 0;
    margin-top: 0;
    padding-top: 12.6rem;
    justify-content: flex-start;
  }

  h1 {
    font-size: clamp(2.3rem, 11.5vw, 3.7rem);
    margin-top: 1.5rem;
  }

  .lead {
    white-space: normal;
    font-size: 1.15rem;
    margin: 1rem auto 0;
  }

  .btn {
    min-width: 0;
    white-space: normal;
  }

  .hero-content .btn {
    margin-top: 5rem;
  }

  .page-hero {
    padding-top: 11.25rem;
  }

  .page-hero .intro-content > p {
    margin: 0.4rem 0;
  }

  .tool-box {
    max-width: 100%;
    margin-top: 0.75rem;
  }

  .rng-inputs {
    margin-bottom: 0.5rem;
  }

  .page-hero h2.handwritten {
    font-size: 2rem;
  }

  .wheel-app {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .wheel-canvas-wrap {
    max-width: 560px;
  }

  .wheel-sidebar {
    width: 100%;
  }
}
