:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --bg: #101813;
  --bg-soft: #151f18;
  --panel: #18231b;
  --text: #eeeade;
  --muted: #a3ab9f;
  --sage: #c5cdae;
  --accent: #d2b57a;
  --border: rgba(226, 231, 210, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  isolation: isolate;
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 14%, rgba(65, 103, 64, 0.18), transparent 38rem),
    radial-gradient(ellipse at 88% 48%, rgba(85, 100, 56, 0.1), transparent 36rem),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(196, 205, 174, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 205, 174, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--accent);
  color: #172018;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 24, 19, 0.82);
}

.header-inner,
.hero-inner,
.section-inner,
.site-footer {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-name,
.footer-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.brand-byline {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.header-link {
  color: var(--sage);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.header-link span,
.hero-link span {
  padding-left: 5px;
  color: var(--accent);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 96px) 0 72px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 76% 8%, rgba(71, 112, 68, 0.18), transparent 34rem),
    linear-gradient(150deg, rgba(25, 37, 28, 0.78), rgba(16, 24, 19, 0.55));
}

.hero::after {
  position: absolute;
  right: -16%;
  bottom: -50%;
  width: 48rem;
  aspect-ratio: 1;
  border: 1px solid rgba(196, 205, 174, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(196, 205, 174, 0.025), 0 0 0 76px rgba(196, 205, 174, 0.02);
  content: "";
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow,
.activity-card__eyebrow,
.format-card__label {
  color: var(--sage);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
.format-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(3.1rem, 8vw, 6.5rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

h1 span,
.section-heading h2 span {
  color: var(--sage);
}

.hero-description {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.hero-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.hero-link:hover,
.header-link:hover,
.footer-brand:hover {
  color: var(--accent);
}

.activity-card {
  overflow: hidden;
  padding: 20px clamp(14px, 3vw, 34px) 17px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(94, 126, 76, 0.12), transparent 60%),
    rgba(13, 20, 16, 0.68);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.2);
}

.activity-card__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.activity-illustration {
  display: block;
  width: 100%;
  height: auto;
  margin: 3px auto 0;
  border-radius: 8px;
  background: #fff;
}

.activity-labels {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  color: var(--sage);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  list-style: none;
  text-align: center;
  text-transform: uppercase;
}

.activity-labels li {
  flex: 1;
}

.format-section {
  padding: clamp(64px, 9vw, 104px) 0 88px;
}

.section-heading {
  max-width: 670px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-heading h2 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-heading > p:last-child {
  max-width: 590px;
  margin: 0 auto;
  color: var(--muted);
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.format-card {
  position: relative;
  min-height: 240px;
  padding: 26px 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(101, 132, 79, 0.11), transparent 60%),
    linear-gradient(150deg, rgba(28, 41, 31, 0.94), rgba(20, 30, 23, 0.92));
  transition: border-color 180ms ease, transform 180ms ease;
}

.format-card:hover {
  transform: translateY(-3px);
  border-color: rgba(210, 181, 122, 0.48);
}

.format-card__number {
  display: block;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.format-card__label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.64rem;
}

.format-card h3 {
  margin-bottom: 8px;
  font-size: 1.65rem;
  line-height: 1.2;
}

.format-card > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.format-note {
  margin: 22px 0 0;
  color: var(--sage);
  font-size: 0.9rem;
  text-align: center;
}

.calculator-section {
  padding: 0 0 clamp(72px, 9vw, 104px);
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(101, 132, 79, 0.1), transparent 50%),
    linear-gradient(150deg, rgba(28, 41, 31, 0.94), rgba(20, 30, 23, 0.92));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.calculator-form__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.calculator-form__heading h3 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.calculator-form__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.preset-buttons {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 20, 16, 0.72);
}

.preset-button {
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.preset-button:hover,
.preset-button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--text);
}

.preset-button:focus-visible,
.number-field input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.calculator-fields {
  display: grid;
  gap: 22px;
  padding-top: 24px;
}

.calculator-field {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--sage);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calculator-field legend {
  margin-bottom: 9px;
  padding: 0;
}

.field-hint {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.time-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.number-field {
  position: relative;
  display: block;
}

.number-field input {
  width: 100%;
  min-height: 50px;
  padding: 10px 68px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 20, 16, 0.78);
  color: var(--text);
  font: 1.05rem/1.4 "Courier New", monospace;
  letter-spacing: normal;
}

.number-field input:focus {
  border-color: var(--accent);
}

.number-field > span:last-child {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  font: 0.63rem "Courier New", monospace;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.calculator-error {
  margin: 16px 0 0;
  color: #f0a29a;
  font-size: 0.82rem;
}

.score-result {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(13, 20, 16, 0.74);
}

.score-result__eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.score-result__time {
  display: block;
  padding: 4px 0;
  color: var(--sage);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.score-result__total {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font: 0.72rem "Courier New", monospace;
}

.score-breakdown {
  display: grid;
  gap: 13px;
  margin: 20px 0 0;
}

.score-breakdown > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.score-breakdown dt {
  color: var(--muted);
  font-size: 0.77rem;
}

.score-breakdown dd {
  margin: 0;
  color: var(--text);
  font: 0.82rem "Courier New", monospace;
  text-align: right;
  white-space: nowrap;
}

.score-breakdown dd.is-penalty {
  color: #f0a29a;
}

.score-breakdown dd.is-bonus {
  color: #a9d1a2;
}

.competitor-note {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.site-footer {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-brand {
  color: var(--text);
  font-size: 1.35rem;
  text-decoration: none;
}

@media (max-width: 700px) {
  .hero {
    padding-top: 58px;
  }

  .hero-copy {
    margin-bottom: 32px;
  }

  .activity-card {
    padding-inline: 10px;
  }

  .activity-card__eyebrow {
    padding-inline: 8px;
  }

  .activity-labels {
    font-size: 0.68rem;
  }

  .format-grid {
    grid-template-columns: 1fr;
  }

  .calculator {
    grid-template-columns: 1fr;
  }

  .format-card {
    min-height: 0;
  }

  .format-card__number {
    margin-bottom: 12px;
  }
}

@media (max-width: 420px) {
  .header-inner,
  .hero-inner,
  .section-inner,
  .site-footer {
    width: min(100% - 28px, 1100px);
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .brand-byline {
    font-size: 0.49rem;
  }

  .header-link {
    font-size: 0.82rem;
  }

  .header-nav {
    gap: 12px;
  }

  .header-nav .header-link:first-child {
    display: none;
  }

  .calculator-form__heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
