:root {
  color-scheme: light dark;
  --page: #faf8f4;
  --glow: rgb(249 124 61 / 0.14);
  --dots: rgb(20 18 16 / 0.09);
  --fg: rgb(20 18 16);
  --body: rgb(66 62 56);
  --muted: rgb(110 104 96);
  --line: rgb(229 224 215);
  --surface: rgb(255 255 255);
  --flame: #f97c3d;
  --flame-ink: rgb(168 70 11);
  --flame-tint: rgb(253 240 230);
  --sheet: #ffffff;
  --sheet-back: #f1ede6;
  --sheet-edge: #b3ab9e;
  --sheet-line: rgb(110 104 96 / 0.4);
  --on-fg: #faf8f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0d0b;
    --glow: rgb(249 124 61 / 0.13);
    --dots: rgb(246 243 238 / 0.08);
    --fg: rgb(246 243 238);
    --body: rgb(208 202 193);
    --muted: rgb(152 145 135);
    --line: rgb(48 45 41);
    --surface: rgb(24 22 20);
    --flame-ink: rgb(251 150 98);
    --flame-tint: rgb(46 28 18);
    --sheet: #24211d;
    --sheet-back: #1a1815;
    --sheet-edge: #4d4840;
    --sheet-line: rgb(208 202 193 / 0.4);
    --on-fg: #0e0d0b;
  }
}

* {
  box-sizing: border-box;
}

html[data-shown="es"] body [lang="en"],
html[data-shown="en"] body [lang="es"] {
  display: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--page);
  background-image:
    radial-gradient(60rem 36rem at 78% 18%, var(--glow), transparent 70%),
    radial-gradient(var(--dots) 1px, transparent 1px);
  background-size:
    auto,
    24px 24px;
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

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

.top,
.hero,
.facts,
.caveat,
.bottom {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand small {
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 400;
}

.languages {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

html:not([data-shown]) .languages {
  display: none;
}

.languages button {
  padding: 0.2rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
}

html[data-shown="es"] body .languages [lang="en"],
html[data-shown="en"] body .languages [lang="es"] {
  display: inline;
}

.languages button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--on-fg);
}

.hero {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2rem;
  align-items: center;
  padding-block: 2.5rem 3.5rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--flame-tint);
  color: var(--flame-ink);
  font-size: 0.875rem;
  font-weight: 500;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--flame);
  animation: breathe 2.4s ease-in-out infinite;
}

h1 {
  margin: 1.25rem 0 0;
  color: var(--fg);
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
}

.lead {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: 1.15rem;
}

.action {
  margin: 1.75rem 0 0;
}

.button {
  display: inline-flex;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--on-fg);
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}

.button:hover {
  opacity: 0.85;
}

.scene {
  position: relative;
  justify-self: center;
  width: min(100%, 20rem);
  margin: 0;
}

.scene svg {
  display: block;
  width: 100%;
  height: auto;
}

.back {
  fill: var(--sheet-back);
  stroke: var(--sheet-edge);
  stroke-width: 2;
}

.sheet {
  fill: var(--sheet);
  stroke: var(--sheet-edge);
  stroke-width: 2;
}

.fold {
  fill: var(--sheet-back);
  stroke: var(--sheet-edge);
  stroke-width: 2;
}

.line {
  fill: none;
  stroke: var(--sheet-line);
  stroke-width: 6;
  stroke-dasharray: 1;
  animation: write 7s ease-in-out infinite;
}

.second {
  animation-name: write-second;
}

.third {
  animation-name: write-third;
}

.last {
  stroke: var(--flame);
  animation-name: write-last;
}

.seal {
  transform-box: fill-box;
  transform-origin: center;
  animation: seal 7s ease-in-out infinite;
}

.seal circle {
  fill: var(--flame);
}

.seal path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 4.5;
}

.tisto {
  position: absolute;
  bottom: -1.75rem;
  left: -3.25rem;
  width: 38%;
  height: auto;
  filter: drop-shadow(0 8px 14px rgb(0 0 0 / 0.16));
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.fact {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.fact h2 {
  margin: 0;
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
}

.fact p {
  margin: 0.35rem 0 0;
  font-size: 0.925rem;
}

.caveat {
  margin-block: 1.25rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.lost {
  grid-template-columns: minmax(0, 1fr);
}

.bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-block: 1.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.bottom a {
  text-underline-offset: 0.2em;
}

@keyframes breathe {
  50% {
    opacity: 0.35;
  }
}

@keyframes write {
  0% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  12%,
  90% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
}

@keyframes write-second {
  0%,
  12% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  24%,
  90% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
}

@keyframes write-third {
  0%,
  24% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  34%,
  90% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
}

@keyframes write-last {
  0%,
  34% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  42%,
  90% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
}

@keyframes seal {
  0%,
  44% {
    opacity: 0;
    transform: scale(0.4);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
  54%,
  90% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot,
  .line,
  .seal {
    animation: none;
  }

  .line {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@media (max-width: 52rem) {
  .tisto {
    left: -1.5rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 1rem 2.5rem;
  }

  .scene {
    order: -1;
    width: min(52%, 11rem);
    margin-bottom: 0.75rem;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
}
