:root {
  --cream: #FFFAF3;
  --red: #F62440;
  --red-text: #C41C33;
  --teal: #152D35;
  --parchment: #EAE0C4;
  --shadow-sm: 0 2px 8px rgba(21, 45, 53, 0.06);
  --shadow-md: 0 6px 20px rgba(21, 45, 53, 0.10);
  --shadow-lift: 0 12px 28px rgba(21, 45, 53, 0.14);
  --hard-shadow: 6px 6px 0 var(--teal);
  --hard-shadow-red: 6px 6px 0 var(--red);
  --hard-shadow-lift: 9px 9px 0 var(--teal);
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(12px);
  --header-height: 64px;
}

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

@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/SpaceGrotesk-Variable.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(21, 45, 53, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 45, 53, 0.045) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  background-repeat: repeat, repeat;
  color: var(--teal);
  margin: 0;
  padding: 0;
  padding-top: var(--header-height);
  line-height: 1.6;
  font-size: 1rem;
}

.bg-parallax {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.bg-parallax-image {
  position: absolute;
  top: 50%;
  left: -30%;
  width: 160%;
  max-width: none;
  height: auto;
  opacity: 0.09;
  transform: translateY(-50%);
  will-change: transform;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.reveal {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.18s; }
.reveal-3 { animation-delay: 0.30s; }
.reveal-4 { animation-delay: 0.44s; }
.reveal-5 { animation-delay: 0.56s; }
.reveal-6 { animation-delay: 0.68s; }
.reveal-7 { animation-delay: 0.80s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-1, .reveal-2, .reveal-3, .reveal-4, .reveal-5, .reveal-6, .reveal-7 {
    animation: none;
    opacity: 1;
  }
}

footer {
  padding: 1.5rem 2rem;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

header.header--hidden {
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
  header {
    transition: none;
  }
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

article > section, .back-link {
  max-width: 700px;
  margin: 0 auto;
}

article h1 {
  max-width: 700px;
  margin: 2rem auto 0.5rem;
}

article .meta, .back-link {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

article figure {
  max-width: 700px;
  margin: 2rem auto;
}

.stat-card-live {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: var(--hard-shadow);
  padding: 3rem 2rem;
  text-align: center;
}

.stat-card-live__top {
  font-size: 1rem;
  color: var(--teal);
  margin: 0 0 1rem;
}

.stat-card-live__number {
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--teal);
  margin: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-card-live__label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--red);
  margin: 1rem 0 1.5rem;
}

.stat-card-live::after {
  content: "";
  display: block;
  width: 400px;
  max-width: 60%;
  height: 4px;
  margin: 0 auto;
  background-color: var(--parchment);
}

@media (max-width: 768px) {
  .stat-card-live__number {
    font-size: 2.75rem;
  }

  .stat-card-live__label {
    font-size: 1rem;
  }
}

article figure img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
}

article figcaption {
  font-size: 0.85rem;
  color: var(--teal);
  opacity: 0.7;
  margin-top: 0.5rem;
  text-align: center;
}

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

article th, article td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--parchment);
}

article th {
  color: var(--teal);
  font-weight: 700;
}

article h2, .latest-posts h2 {
  letter-spacing: -0.01em;
}

article table {
  border-radius: 0.25rem;
  overflow: hidden;
  border: 2px solid var(--teal);
  box-shadow: var(--hard-shadow);
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

article .lede {
  font-size: 1.2rem;
  font-weight: 600;
}

article .callout {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--red);
  border-left: 6px solid var(--red);
  border-radius: 0.25rem;
  padding: 0.5rem 1.5rem;
  max-width: 700px;
  margin: 2rem auto;
  box-shadow: var(--hard-shadow-red);
}

article ul {
  padding-left: 0;
}

article ul li {
  list-style: none;
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.5rem;
}

article ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--red);
}

article .sources a[target="_blank"]::after {
  content: ' \2197';
}

article .callout h2 {
  margin-top: 1rem;
}

article .sources a {
  color: var(--red-text);
  font-weight: 600;
}

article .sources a.placeholder-link {
  color: var(--teal);
  opacity: 0.5;
  font-weight: 400;
  font-style: italic;
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

nav {
  text-align: center;
  background-color: rgba(234, 224, 196, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1rem 2rem;
  border-bottom: 3px solid var(--teal);
  box-shadow: none;
}

nav a {
  color: var(--teal);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wordmark-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--red);
  flex-shrink: 0;
}

.pill-icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--red);
  flex-shrink: 0;
  vertical-align: -0.15em;
  margin-right: 0.2rem;
}

.back-link {
  display: block;
  padding-top: 1.5rem;
}

.back-link a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

.hero {
  padding: 3rem 0 2rem;
}

.hero-text {
  max-width: 640px;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: 4px 4px 0 var(--teal);
  padding: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-headline {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 4rem;
  line-height: 1.05;
  margin: 0 0 1.25rem;
}

.hero-subhead {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--teal);
  margin: 0;
  max-width: 32ch;
}

.stat-row {
  display: flex;
  justify-content: flex-start;
  gap: 3rem;
  padding: 1.75rem 2rem;
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: var(--hard-shadow);
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.stat-row__item {
  display: flex;
  flex-direction: column;
  position: relative;
}

.stat-row__item:not(:first-child) {
  border-left: 1px dashed var(--parchment);
  padding-left: 2rem;
}

.stat-row__number {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-pin-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--red);
}

.stat-row__number--first {
  color: var(--red);
}

.stat-row__label {
  font-size: 0.85rem;
  color: var(--teal);
  opacity: 0.75;
}

.latest-posts h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.latest-posts {
  margin-bottom: 3rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.rig-card {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: var(--hard-shadow);
  padding: 1.5rem;
  max-width: 700px;
  margin: 2rem auto;
}

.rig-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 0.4rem;
}

.rig-card__intro {
  font-size: 0.85rem;
  color: var(--teal);
  opacity: 0.75;
  margin: 0 0 1.25rem;
  line-height: 1.4;
}

.rig-card__specs {
  margin: 0;
}

.rig-card__spec {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px dashed var(--parchment);
}

.rig-card__spec:first-child {
  border-top: none;
  padding-top: 0;
}

.rig-card__spec dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rig-card__spec dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--teal);
  text-align: right;
}

.post-card {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--hard-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translate(-3px, -3px) scale(1.015);
  box-shadow: var(--hard-shadow-lift);
  z-index: 2;
}

.post-card__thumbnail {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-card__thumbnail,
.post-card:focus-visible .post-card__thumbnail {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .post-card__thumbnail,
  .live-chart__bar,
  .live-chart__value {
    transition: none;
  }
}

.post-card__thumbnail {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background-color: #fff;
  display: block;
}

.post-card__body {
  padding: 1.25rem;
}

.post-card__title {
  font-weight: bold;
  margin: 0 0 0.5rem;
  color: var(--teal);
}

.post-card__excerpt {
  font-size: 0.95rem;
  color: var(--teal);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.post-card__meta {
  font-size: 0.8rem;
  color: var(--red-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

footer {
  text-align: center;
  background-color: rgba(234, 224, 196, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--teal);
  font-size: 0.9rem;
  border-top: 3px solid var(--teal);
  box-shadow: none;
  position: relative;
}

footer p {
  margin: 0.35rem 0;
}

footer .footer-note {
  font-size: 0.8rem;
  opacity: 0.65;
}

footer a {
  color: var(--red-text);
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.live-chart-figure {
  margin: 2rem auto;
}

.live-chart {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: var(--hard-shadow);
  padding: 1.75rem 2rem 1.25rem;
}

.live-chart__title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 1.5rem;
}

.live-chart__body {
  display: flex;
  gap: 0.75rem;
}

.live-chart__yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 260px;
  font-size: 0.75rem;
  color: var(--teal);
  opacity: 0.75;
  text-align: right;
  padding-bottom: 0;
}

.live-chart__plot {
  position: relative;
  flex: 1;
}

.live-chart__gridlines {
  position: absolute;
  inset: 0;
  height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.live-chart__gridlines span {
  display: block;
  border-top: 1px solid var(--parchment);
}

.live-chart__bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 260px;
  gap: 1rem;
}

.live-chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.live-chart__bar-track {
  position: relative;
  width: 60%;
  height: 100%;
}

.live-chart__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background-color: var(--teal);
  border-radius: 0.2rem 0.2rem 0 0;
  transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-chart__bar--accent {
  background-color: var(--red);
}

.live-chart__value {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.live-chart__col:nth-child(1) .live-chart__bar { transition-delay: 0s; }
.live-chart__col:nth-child(2) .live-chart__bar { transition-delay: 0.12s; }
.live-chart__col:nth-child(3) .live-chart__bar { transition-delay: 0.24s; }
.live-chart__col:nth-child(4) .live-chart__bar { transition-delay: 0.36s; }
.live-chart__col:nth-child(1) .live-chart__value { transition-delay: 0.9s; }
.live-chart__col:nth-child(2) .live-chart__value { transition-delay: 1.02s; }
.live-chart__col:nth-child(3) .live-chart__value { transition-delay: 1.14s; }
.live-chart__col:nth-child(4) .live-chart__value { transition-delay: 1.26s; }

.live-chart__value--empty {
  bottom: 10px;
  color: var(--teal);
  opacity: 0;
  font-style: italic;
  font-weight: 600;
}

.live-chart.is-visible .live-chart__bar {
  height: calc(var(--pct) * 100%);
}

.live-chart.is-visible .live-chart__value {
  opacity: 1;
}

.live-chart.is-visible .live-chart__value--empty {
  opacity: 0.75;
}

.live-chart__label {
  font-size: 0.8rem;
  color: var(--teal);
  margin-top: 0.6rem;
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .hero-headline {
    font-size: 2.75rem;
  }

  .rig-card {
    padding: 1.25rem;
  }

  .live-chart {
    padding: 1.25rem 1rem 1rem;
  }

  .live-chart__yaxis {
    font-size: 0.65rem;
  }

  .live-chart__label {
    font-size: 0.7rem;
  }

  .stat-row {
    gap: 1.25rem;
  }

  .stat-row__item:not(:first-child) {
    border-left: none;
    border-top: 1px dashed var(--parchment);
    padding-left: 0;
    padding-top: 1.25rem;
  }
}

.enigma-widget {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: var(--hard-shadow);
  overflow: hidden;
  padding: 1.5rem;
  margin: 2rem 0;
}

.enigma-widget--simple {
  max-width: 500px;
}

.enigma-widget__rotors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.enigma-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}

.enigma-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.enigma-field select,
.enigma-field input,
.enigma-field textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--teal);
  background-color: var(--cream);
  border: 2px solid var(--teal);
  border-radius: 0.2rem;
  padding: 0.5rem 0.6rem;
  width: 100%;
  min-width: 0;
}

.enigma-widget textarea {
  resize: vertical;
}

.enigma-subfields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-top: 0.4rem;
  min-width: 0;
}

.enigma-subfields label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--teal);
  text-transform: none;
  min-width: 0;
}

.enigma-subfields input {
  width: 3.5rem;
  flex-shrink: 0;
  padding: 0.3rem 0.4rem;
  text-transform: uppercase;
}

.enigma-btn {
  display: inline-block;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cream);
  background-color: var(--red);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  padding: 0.65rem 1.5rem;
  box-shadow: var(--hard-shadow);
  cursor: pointer;
  margin: 0.25rem 0 1.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.enigma-btn:hover,
.enigma-btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--teal);
}

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

.enigma-widget__hint {
  font-size: 0.85rem;
  color: var(--teal);
  opacity: 0.75;
  margin-top: 1rem;
}

.enigma-widget__error {
  color: var(--red-text);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.project-badge {
  display: inline-block;
  background-color: var(--teal);
  color: var(--cream);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 0.2rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  .enigma-btn {
    transition: none;
  }
}

.about-card {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--teal);
  border-radius: 0.25rem;
  box-shadow: var(--hard-shadow);
  padding: 1.5rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.about-card__name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--teal);
  margin: 0 0 0.5rem;
}

.about-card__bio {
  font-size: 0.95rem;
  color: var(--teal);
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.about-card__link {
  margin: 0;
}

@media (max-width: 560px) {
  .enigma-widget__rotors {
    grid-template-columns: 1fr;
  }
}
