/* jugabetwinar.com — base styles (soft-brutalism) */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0 0 0.75em;
}

h1:last-child,
h2:last-child,
h3:last-child,
p:last-child {
  margin-bottom: 0;
}

/* --- Design tokens --- */
:root {
  --bg: #f4f0ea;
  --bg-elevated: #ffffff;
  --border: #d9d2c6;
  --text: #1a1d24;
  --muted: #5c6370;
  --accent: #ff4d3d;
  --accent-h: 6;
  --accent-strong: #d93b2e;
  --gold: #2aab9b;
  --gold-h: 168;
  --pitch: #1a1d24;
  --link: #0d6e8c;
  --link-hover: #095a73;
  --link-on-dark: #7edce8;
  --link-on-dark-hover: #a8e8f4;
  --on-accent: #ffffff;
  --on-pitch-muted: #b8bcc6;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-meta: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 6px;
  --max: 1120px;
  --shadow: 6px 6px 0 rgba(26, 29, 36, 0.12);
  --shadow-sm: 3px 3px 0 rgba(26, 29, 36, 0.1);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --header-h: 4rem;
  --ease-snappy: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.page--anchor-offset {
  scroll-padding-top: calc(var(--header-h) + var(--space-md));
}

/* --- Typography --- */
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.125rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 65ch;
}

small,
.cta-disclaimer {
  font-size: 0.875rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --- */
.container {
  width: min(100% - var(--space-lg) * 2, var(--max));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-2xl);
}

.section--hero {
  padding-block: var(--space-xl) var(--space-2xl);
  background: var(--pitch);
  color: var(--on-accent);
}

.section--hero a {
  color: var(--link-on-dark);
}

.section--hero a:hover {
  color: var(--link-on-dark-hover);
}

.section--hero .lead {
  color: var(--on-pitch-muted);
}

.section--cta-band {
  background: var(--bg-elevated);
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  text-align: center;
}

.band-celeste {
  height: 4px;
  background: linear-gradient(
    90deg,
    hsl(var(--gold-h) 55% 42%) 0%,
    hsl(var(--gold-h) 65% 52%) 50%,
    hsl(var(--accent-h) 85% 58%) 100%
  );
}

.breadcrumb {
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  font-family: var(--font-meta);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  list-style: none;
}

.breadcrumb__list li:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-sm);
  opacity: 0.5;
}

.section--hero .breadcrumb a {
  color: var(--on-pitch-muted);
}

.section--hero .breadcrumb a:hover {
  color: var(--on-accent);
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 10000;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* --- Scroll progress --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.scroll-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--scroll-progress, 0%);
  background: var(--accent);
  transition: width 0.1s linear;
}

.reading-progress {
  position: fixed;
  top: 3px;
  left: 0;
  z-index: 9998;
  width: 100%;
  height: 2px;
  background: transparent;
  pointer-events: none;
}

.reading-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--reading-progress, 0%);
  background: var(--gold);
}

/* --- RG ticker --- */
.rg-ticker {
  background: var(--pitch);
  color: var(--on-pitch-muted);
  font-size: 0.8125rem;
  border-bottom: 2px solid var(--border);
  overflow: hidden;
}

.rg-ticker__inner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--space-xs) var(--space-lg);
}

.rg-ticker__badge {
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: var(--radius);
}

.rg-ticker__text {
  white-space: nowrap;
  animation: ticker-scroll 28s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .rg-ticker__text {
    animation: none;
    white-space: normal;
  }
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--space-sm) var(--space-lg);
  min-height: var(--header-h);
}

.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.site-logo:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  padding: var(--space-sm);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s var(--ease-snappy);
}

.site-nav {
  flex: 1;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-md);
  list-style: none;
}

.site-nav__list a {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s var(--ease-snappy), transform 0.15s var(--ease-snappy);
}

.site-nav__list a:hover {
  background: var(--bg);
  color: var(--accent-strong);
  transform: translate(-1px, -1px);
}

.site-header__cta {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--bg-elevated);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md) var(--space-lg);
  }

  .site-nav__list a {
    padding: var(--space-sm) var(--space-md);
  }

  .site-header__cta {
    display: none;
  }

  .site-header__inner:has(.site-nav.is-open) .site-header__cta {
    display: none;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid var(--pitch);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease-snappy), box-shadow 0.15s var(--ease-snappy), background 0.15s var(--ease-snappy);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(26, 29, 36, 0.14);
}

.btn:active {
  transform: translate(0, 0);
  box-shadow: var(--shadow-sm);
}

.btn--accent {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--pitch);
}

.btn--accent:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.btn--lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* --- Cards & callouts (base) --- */
.card-brutal {
  background: var(--bg-elevated);
  border: 2px solid var(--pitch);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-lg);
}

.callout {
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid var(--gold);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-block: var(--space-md);
}

.callout--muted {
  border-left-color: var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

.callout--warning {
  border-left-color: var(--accent);
}

/* --- Footer --- */
.site-footer {
  background: var(--pitch);
  color: var(--on-pitch-muted);
  margin-top: auto;
}

.site-footer a {
  color: var(--link-on-dark);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--link-on-dark-hover);
  text-decoration: underline;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-xl);
  padding-block: var(--space-2xl);
}

.site-footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--on-accent);
  margin-bottom: var(--space-sm);
}

.site-footer__note {
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 28ch;
}

.site-footer__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--on-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}

.site-footer__links {
  list-style: none;
}

.site-footer__links li {
  margin-bottom: var(--space-sm);
}

.site-footer__links a {
  font-size: 0.875rem;
}

.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: var(--space-xl);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.site-footer__legal p {
  margin-bottom: var(--space-md);
  max-width: 75ch;
}

.site-footer__copy {
  font-family: var(--font-meta);
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: var(--space-lg);
}

@media (max-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .site-footer__col:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}
