/* pendejo.com — shared styles */

:root {
  /* Dark olive base with pastel accents. One theme, no light variant. */
  --bg: #2E3523;
  --bg-dot: #3A4230;
  --surface: #39412D;
  --soft: #444D37;
  --ink: #F2EDDF;
  --muted: #B6BAA2;
  --line: #1B2013;
  --shadow-c: #1B2013;
  --butter: #EEDC9C;
  --blush: #F1BCB4;
  --sage: #C3D9A9;
  --mist: #B9D4DF;
  --lavender: #CCC4E6;
  --peach: #F3CBA5;
  --gray: #5B6449;
  --on-pastel: #232A19;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 4px 4px 0 var(--shadow-c);
  --shadow-lg: 6px 6px 0 var(--shadow-c);
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-optical-sizing: auto;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.3px, transparent 1.3px);
  background-size: 22px 22px;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

a { color: var(--butter); }

:focus-visible {
  outline: 3px solid var(--blush);
  outline-offset: 3px;
}

/* ---------- Header / footer ---------- */

.site-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--butter); }

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { border-color: var(--line); }
.nav a[aria-current="page"] { background: var(--butter); color: var(--on-pastel); border-color: var(--line); }

@media (max-width: 700px) {
  .nav {
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 2px 16px 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
}

.site-footer {
  text-align: center;
  padding: 32px 16px 44px;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 4px 0; }

/* ---------- Type ---------- */

h1, h2, h3 {
  margin: 0 0 0.4em;
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.display { font-size: clamp(2.8rem, 8.5vw, 5.4rem); }
.title { font-size: clamp(2.2rem, 6vw, 3.6rem); }

.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-pastel);
  background: var(--sage);
  border: 2px solid var(--line);
  border-radius: 999px;
}

.lede {
  font-size: clamp(1.08rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 42ch;
  margin: 0 0 1em;
}

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.page-head {
  text-align: center;
  padding: 20px 0 32px;
}
.page-head .lede { margin-inline: auto; }

/* ---------- Surfaces ---------- */

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 4vw, 32px);
}

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow-c); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow-c); }
.btn:disabled,
.btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.btn-primary { background: var(--butter); color: var(--on-pastel); }
.btn-blush { background: var(--blush); color: var(--on-pastel); }
.btn-sage { background: var(--sage); color: var(--on-pastel); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { box-shadow: none; transform: none; background: var(--soft); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }

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

/* ---------- Form fields ---------- */

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 700; font-size: 0.95rem; }

.input, .select {
  font: inherit;
  font-size: 1.05rem;
  width: 100%;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
}
.input::placeholder { color: var(--muted); }

input[type="range"] { width: 100%; accent-color: var(--butter); }

/* ---------- Icons ---------- */

.icon {
  width: 24px;
  height: 24px;
  flex: none;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  font-weight: 600;
  color: var(--on-pastel);
  background: var(--ink);
  border-radius: 999px;
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Shout ---------- */

.shout {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 16px;
  font-size: clamp(2.6rem, 9vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
  text-wrap: balance;
  color: var(--butter);
  text-shadow: 4px 4px 0 var(--shadow-c);
  pointer-events: none;
  opacity: 0;
}
.shout.show { animation: shout 2.4s ease forwards; }
@keyframes shout {
  0% { opacity: 0; transform: scale(0.6) rotate(-6deg); }
  12% { opacity: 1; transform: scale(1.05) rotate(2deg); }
  20%, 80% { opacity: 1; transform: scale(1) rotate(-2deg); }
  100% { opacity: 0; transform: scale(1) rotate(-2deg); }
}

.shake { animation: shake 0.4s ease; border-color: var(--blush); }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ---------- Confetti ---------- */

.confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 150;
}
.confetti span {
  position: absolute;
  top: -24px;
  border-radius: 2px;
}

/* ---------- Dialog ---------- */

dialog {
  width: min(440px, calc(100% - 32px));
  padding: clamp(20px, 5vw, 32px);
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgb(20 24 13 / 0.6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* The shout still needs to stay readable for a moment, just without moving. */
  .shout.show { animation: shout-still 2.4s linear forwards !important; }
  @keyframes shout-still {
    0%, 85% { opacity: 1; }
    100% { opacity: 0; }
  }
}
