:root {
  --color-deep-navy: #0B1D3A;
  --color-faded-turquoise: #5B8A9A;
  --color-parchment-white: #F5F0E1;
  --color-safety-orange: #FF6B35;
  --color-ink-navy: #0B1D3A;
  --color-muted-turquoise: #A8C5D0;
  --color-polaroid-border: #D3C9B8;
  --color-white: #FFFFFF;
  --color-light-turquoise-tint: #E8F0F2;
  --color-safety-orange-dark: #E55A2B;

  --font-heading: Georgia, serif;
  --font-body: Arial, sans-serif;
  --font-mono: "Courier New", Courier, monospace;

  --text-display: clamp(2.5rem, 5vw, 3rem);
  --text-h1: clamp(2rem, 4vw, 2.25rem);
  --text-h2: clamp(1.5rem, 3vw, 1.75rem);
  --text-h3: clamp(1.25rem, 2.5vw, 1.375rem);
  --text-body: 1rem;
  --text-small: 0.875rem;

  --leading-display: 1.1;
  --leading-h1: 1.2;
  --leading-h2: 1.3;
  --leading-h3: 1.4;
  --leading-body: 1.6;
  --leading-small: 1.5;

  --space-4xs: 4px;
  --space-3xs: 8px;
  --space-2xs: 16px;
  --space-xs: 24px;
  --space-sm: 32px;
  --space-md: 48px;
  --space-lg: 64px;
  --space-xl: 96px;

  --container-max: 1200px;
  --container-padding: var(--space-xs);
  --card-padding: var(--space-xs);
  --section-spacing: var(--space-lg);
  --grid-gap-desktop: var(--space-xs);
  --grid-gap-mobile: var(--space-2xs);

  --surface-parchment: #F5F0E1;
  --surface-parchment-texture: linear-gradient(135deg, rgba(11, 29, 58, 0.02) 0%, rgba(11, 29, 58, 0) 50%, rgba(11, 29, 58, 0.02) 100%);
  --surface-navy: #0B1D3A;
  --surface-navy-texture: linear-gradient(180deg, #0B1D3A 0%, #0E2447 100%);

  --border-default: 1px solid var(--color-faded-turquoise);
  --border-polaroid: 1px solid var(--color-polaroid-border);

  --shadow-soft: 0 2px 8px rgba(11, 29, 58, 0.08);
  --shadow-hover: 0 6px 20px rgba(11, 29, 58, 0.15);

  --radius-none: 0px;
  --radius-small: 4px;
  --radius-medium: 8px;

  --transition-color: 200ms ease-in-out;
  --transition-lift: 300ms ease-in-out;

  --touch-target-min: 44px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink-navy);
  background-color: var(--color-parchment-white);
  background-image: var(--surface-parchment-texture);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  padding: var(--space-3xs) var(--space-2xs);
  border-radius: var(--radius-small);
  transition: background-color var(--transition-color), color var(--transition-color), border-color var(--transition-color), box-shadow var(--transition-color);
}

a {
  color: var(--color-safety-orange);
  text-decoration: none;
  transition: color var(--transition-color), text-decoration-color var(--transition-color);
}

a:hover {
  color: var(--color-safety-orange-dark);
  text-decoration: underline;
  text-decoration-color: var(--color-safety-orange);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-safety-orange);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-ink-navy);
  letter-spacing: 0.01em;
  margin-block-end: var(--space-2xs);
}

h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  margin-block-end: var(--space-xs);
}

h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  margin-block-end: var(--space-2xs);
}

h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  margin-block-end: var(--space-3xs);
}

h4,
h5,
h6 {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  margin-block-end: var(--space-3xs);
}

p {
  margin-block-end: var(--space-2xs);
}

p:last-child {
  margin-block-end: 0;
}

ul,
ol {
  margin-block-end: var(--space-2xs);
  padding-inline-start: var(--space-xs);
}

ul:last-child,
ol:last-child {
  margin-block-end: 0;
}

blockquote {
  margin-block-end: var(--space-2xs);
  padding-inline-start: var(--space-2xs);
  border-inline-start: 3px solid var(--color-faded-turquoise);
  color: var(--color-ink-navy);
  font-style: italic;
}

blockquote:last-child {
  margin-block-end: 0;
}

figure {
  margin-block-end: var(--space-2xs);
}

figure:last-child {
  margin-block-end: 0;
}

figcaption {
  font-size: var(--text-small);
  line-height: var(--leading-small);
  color: var(--color-faded-turquoise);
  margin-block-start: var(--space-3xs);
}

hr {
  border: none;
  border-block-start: var(--border-default);
  margin-block: var(--space-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-block-end: var(--space-2xs);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}

table:last-child {
  margin-block-end: 0;
}

th,
td {
  padding: var(--space-3xs) var(--space-2xs);
  text-align: start;
  border-block-end: 1px solid var(--color-faded-turquoise);
}

th {
  background-color: var(--color-deep-navy);
  color: var(--color-parchment-white);
  font-weight: 600;
}

tr:nth-child(even) td {
  background-color: var(--color-light-turquoise-tint);
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background-color: var(--color-light-turquoise-tint);
  padding: 2px 6px;
  border-radius: var(--radius-small);
}

pre {
  background-color: var(--color-deep-navy);
  color: var(--color-parchment-white);
  padding: var(--space-2xs);
  border-radius: var(--radius-small);
  overflow-x: auto;
  margin-block-end: var(--space-2xs);
}

pre:last-child {
  margin-block-end: 0;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

small {
  font-size: var(--text-small);
  line-height: var(--leading-small);
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

mark {
  background-color: var(--color-safety-orange);
  color: var(--color-white);
  padding: 2px 4px;
  border-radius: 2px;
}

fieldset {
  border: var(--border-default);
  border-radius: var(--radius-small);
  padding: var(--space-2xs);
  margin-block-end: var(--space-2xs);
}

fieldset:last-child {
  margin-block-end: 0;
}

legend {
  padding-inline: var(--space-3xs);
  font-weight: 600;
}

label {
  display: block;
  margin-block-end: var(--space-4xs);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: var(--space-3xs) var(--space-2xs);
  border: var(--border-default);
  border-radius: var(--radius-small);
  background-color: var(--color-parchment-white);
  color: var(--color-ink-navy);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  transition: border-color var(--transition-color), box-shadow var(--transition-color);
  min-height: var(--touch-target-min);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-safety-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235B8A9A' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2xs) center;
  padding-inline-end: var(--space-sm);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: auto;
  min-height: auto;
  padding: 0;
  margin-inline-end: var(--space-3xs);
  accent-color: var(--color-safety-orange);
}

input[type="checkbox"] + label,
input[type="radio"] + label {
  display: inline;
  margin-block-end: 0;
}

input[type="file"] {
  padding: var(--space-3xs);
}

input[type="range"] {
  padding: 0;
  min-height: auto;
  accent-color: var(--color-safety-orange);
}

input[type="color"] {
  padding: 2px;
  min-height: var(--touch-target-min);
}

input[type="search"] {
  appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-faded-turquoise);
  opacity: 1;
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--section-spacing);
}

.surface-parchment {
  background-color: var(--surface-parchment);
  background-image: var(--surface-parchment-texture);
}

.surface-navy {
  background-color: var(--surface-navy);
  background-image: var(--surface-navy-texture);
  color: var(--color-parchment-white);
}

.surface-navy h1,
.surface-navy h2,
.surface-navy h3,
.surface-navy h4,
.surface-navy h5,
.surface-navy h6 {
  color: var(--color-parchment-white);
}

.surface-navy p,
.surface-navy li,
.surface-navy blockquote {
  color: var(--color-muted-turquoise);
}

.surface-navy a {
  color: #fff;
}

.surface-navy a:hover {
  color: var(--color-parchment-white);
}

.card {
  background-color: var(--color-parchment-white);
  background-image: var(--surface-parchment-texture);
  border: var(--border-default);
  border-radius: var(--radius-medium);
  padding: var(--card-padding);
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--transition-lift), transform var(--transition-lift);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-featured {
  border-block-start: 4px solid var(--color-safety-orange);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xs);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  border-radius: var(--radius-small);
  padding: var(--space-3xs) var(--space-2xs);
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  transition: background-color var(--transition-color), color var(--transition-color), border-color var(--transition-color), box-shadow var(--transition-color), transform var(--transition-color);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--color-safety-orange);
  color: var(--color-white);
  border: 1px solid var(--color-safety-orange);
}

.btn-primary:hover {
  background-color: var(--color-safety-orange-dark);
  border-color: var(--color-safety-orange-dark);
  color: var(--color-white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-ink-navy);
  border: 1px solid var(--color-faded-turquoise);
}

.btn-secondary:hover {
  background-color: var(--color-light-turquoise-tint);
  border-color: var(--color-faded-turquoise);
  color: var(--color-ink-navy);
}

.btn-tertiary {
  background: none;
  color: var(--color-safety-orange);
  border: none;
  padding-inline: var(--space-3xs);
  min-width: auto;
}

.btn-tertiary:hover {
  color: var(--color-safety-orange-dark);
  text-decoration: underline;
  text-decoration-color: var(--color-safety-orange);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4xs);
  background-color: var(--color-safety-orange);
  color: var(--color-white);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  font-weight: 600;
  padding: 2px var(--space-3xs);
  border-radius: 999px;
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.data-box {
  font-family: var(--font-mono);
  border: var(--border-default);
  border-radius: var(--radius-small);
  padding: var(--space-3xs) var(--space-2xs);
  background-color: var(--color-light-turquoise-tint);
  display: inline-block;
}

.image-polaroid {
  border: var(--border-polaroid);
  background-color: var(--color-white);
  padding: var(--space-3xs);
  box-shadow: var(--shadow-soft);
  transform: rotate(1deg);
  transition: transform var(--transition-lift), filter var(--transition-color);
}

.image-polaroid:hover {
  transform: rotate(0deg);
  filter: grayscale(100%);
}

.image-polaroid img {
  width: 100%;
  height: auto;
  display: block;
}

.image-overlay {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: var(--radius-medium);
}

.image-overlay img {
  display: block;
  width: 100%;
  height: auto;
}

.image-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 29, 58, 0) 40%, rgba(11, 29, 58, 0.7) 100%);
  pointer-events: none;
}

.image-overlay .image-caption {
  position: absolute;
  bottom: var(--space-2xs);
  left: var(--space-2xs);
  right: var(--space-2xs);
  color: var(--color-safety-orange);
  font-weight: 600;
  z-index: 1;
  margin: 0;
}

.flex {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.flex > * {
  min-width: 0;
  flex-shrink: 1;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.flex-column {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  align-items: flex-start;
  justify-content: flex-start;
}

.flex-end {
  align-items: flex-end;
  justify-content: flex-end;
}

.flex-grow {
  flex-grow: 1;
}

.flex-no-shrink {
  flex-shrink: 0;
}

.grid-auto {
  display: grid;
  gap: var(--grid-gap-desktop);
}

.grid-auto > * {
  min-width: 0;
}

.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2xs);
  z-index: 10000;
  background-color: var(--color-safety-orange);
  color: var(--color-white);
  padding: var(--space-3xs) var(--space-2xs);
  border-radius: var(--radius-small);
  font-weight: 600;
  transition: top var(--transition-color);
}

.skip-link:focus {
  top: var(--space-3xs);
  color: var(--color-white);
  text-decoration: none;
}

@media (max-width: 768px) {
  :root {
    --container-padding: var(--space-2xs);
    --section-spacing: var(--space-md);
    --grid-gap-desktop: var(--grid-gap-mobile);
  }

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

  .card {
    padding: var(--space-2xs);
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: var(--space-3xs);
    --section-spacing: var(--space-sm);
  }

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

  .card {
    padding: var(--space-2xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}