/* altitude-simulator
   Punkfish Academy Tools
   First draft: lean, responsive, no external dependencies
*/

:root {
  --pf-bg: #f6f8fb;
  --pf-card: #ffffff;
  --pf-ink: #14213d;
  --pf-muted: #61708a;
  --pf-blue: #2446a6;
  --pf-blue-soft: #e7ecff;
  --pf-yellow: #ffcd00;
  --pf-green: #23a36b;
  --pf-orange: #f59e0b;
  --pf-red: #dc2626;
  --pf-border: rgba(20, 33, 61, 0.14);
  --pf-shadow: 0 18px 45px rgba(20, 33, 61, 0.10);
  --pf-radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 205, 0, 0.18), transparent 34rem),
    linear-gradient(180deg, #eef3ff 0%, var(--pf-bg) 42%, #ffffff 100%);
  color: var(--pf-ink);
}

.pf-tool-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.pf-tool-hero {
  display: block;
  width: 100%;
  margin: 0 0 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pf-hero-copy,
.pf-hero-note,
.alt-card {
  width: 100%;
  max-width: none;
}

.pf-hero-copy {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.pf-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  color: var(--pf-blue);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.pf-kicker::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--pf-yellow);
  box-shadow: 0 0 0 4px rgba(255, 205, 0, 0.2);
}

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

h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.pf-lead {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--pf-muted);
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.65;
}

.pf-hero-note {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  border-left: 7px solid var(--pf-yellow);
}

.pf-hero-note strong {
  color: var(--pf-blue);
}

.pf-hero-note p {
  margin: 0;
  line-height: 1.55;
  color: var(--pf-muted);
}

.alt-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.45fr);
  gap: 1.25rem;
  align-items: start;
}

.alt-card {
  padding: 1.25rem;
}

.alt-card h2,
.alt-card h3 {
  margin-bottom: 0.75rem;
  line-height: 1.1;
}

.alt-card h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.alt-card h3 {
  font-size: 1.1rem;
}

.alt-card p {
  color: var(--pf-muted);
  line-height: 1.58;
}

.alt-controls {
  display: grid;
  gap: 1rem;
}

.alt-control {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid var(--pf-border);
  border-radius: 18px;
  background: #fbfcff;
}

.alt-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.alt-control label,
.alt-control-title {
  font-weight: 800;
}

.alt-output {
  color: var(--pf-blue);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--pf-blue);
}

select,
button {
  font: inherit;
}

select {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--pf-border);
  border-radius: 14px;
  color: var(--pf-ink);
  background: white;
}

.alt-depth-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.alt-depth-buttons button {
  border: 1px solid var(--pf-border);
  border-radius: 14px;
  padding: 0.72rem 0.45rem;
  background: white;
  color: var(--pf-ink);
  cursor: pointer;
  font-weight: 800;
}

.alt-depth-buttons button[aria-pressed="true"] {
  background: var(--pf-blue);
  color: white;
  border-color: var(--pf-blue);
}

.alt-landscape {
  min-height: 340px;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--pf-border);
  background: linear-gradient(180deg, #dcecff 0%, #eef5ff 34%, #f9fbff 68%, #ffffff 100%);
  isolation: isolate;
}

.alt-landscape-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 100%),
    url("/images/altitude-mountains.svg") center bottom / cover no-repeat;
  opacity: 0.98;
  pointer-events: none;
}

.alt-landscape::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 45%, rgba(255,255,255,0.48) 100%);
  z-index: 1;
  pointer-events: none;
}

.alt-sky-label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 6;
  max-width: 15rem;
  padding: 0.65rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--pf-muted);
  font-size: 0.9rem;
  line-height: 1.35;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 20px rgba(20, 33, 61, 0.08);
}

.alt-sea-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2rem;
  border-top: 2px dashed rgba(36, 70, 166, 0.34);
  z-index: 2;
}

.alt-sea-line span {
  position: absolute;
  right: 1rem;
  top: -1.75rem;
  color: var(--pf-blue);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
}

.alt-slope-back {
  position: absolute;
  inset: auto -4% 1.8rem 2%;
  height: 76%;
  z-index: 2;
  background: linear-gradient(180deg, rgba(125, 156, 109, 0.88), rgba(92, 127, 77, 0.95));
  clip-path: polygon(
    0 100%,
    0 92%,
    12% 88%,
    25% 78%,
    39% 64%,
    54% 48%,
    70% 30%,
    86% 14%,
    100% 0,
    100% 100%
  );
  opacity: 0.45;
}

.alt-slope {
  position: absolute;
  inset: auto -3% 1.2rem 4%;
  height: 74%;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(131, 171, 104, 0.98), rgba(95, 134, 73, 1));
  clip-path: polygon(
    0 100%,
    0 94%,
    10% 90%,
    23% 80%,
    37% 66%,
    52% 50%,
    68% 32%,
    84% 15%,
    100% 0,
    100% 100%
  );
  box-shadow: inset 0 10px 16px rgba(255,255,255,0.16);
}

.alt-lake {
  position: absolute;
  left: 18%;
  bottom: 2rem;
  transform: translate(-50%, 0);
  width: 148px;
  height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(255,255,255,0.72) 0 18%, transparent 19% 100%),
    linear-gradient(180deg, #74d7ff 0%, #3ca7ea 45%, #1d6ec6 100%);
  border: 5px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 14px 26px rgba(20, 33, 61, 0.18),
    inset 0 2px 10px rgba(255,255,255,0.28);
  transition: left 220ms ease, bottom 220ms ease;
  z-index: 5;
}

.alt-lake::before {
  content: "";
  position: absolute;
  inset: auto 18px 9px 18px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
}

.alt-lake::after {
  content: "";
  position: absolute;
  inset: 10px 30px auto 30px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
}

.alt-lake-tag {
  position: absolute;
  left: 18%;
  bottom: calc(2rem + 58px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  color: white;
  background: var(--pf-blue);
  font-weight: 900;
  font-size: 0.88rem;
  box-shadow: 0 10px 22px rgba(36, 70, 166, 0.24);
  transition: left 220ms ease, bottom 220ms ease;
  z-index: 6;
}

@media (max-width: 700px) {
  .alt-landscape {
    min-height: 290px;
  }

  .alt-sky-label {
    max-width: 12.5rem;
    font-size: 0.84rem;
  }

  .alt-lake {
    width: 124px;
    height: 40px;
  }

  .alt-lake-tag {
    font-size: 0.8rem;
  }
}
.alt-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.alt-metric {
  padding: 1rem;
  border: 1px solid var(--pf-border);
  border-radius: 18px;
  background: #fbfcff;
}

.alt-metric span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--pf-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.alt-metric strong {
  display: block;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.alt-barometer-wrap {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  align-items: center;
}

.alt-barometer {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 8px solid var(--pf-blue-soft);
  background: conic-gradient(from 210deg, var(--pf-blue) var(--barometer-angle, 68%), #e6eaf5 0);
  display: grid;
  place-items: center;
  position: relative;
}

.alt-barometer::after {
  content: "";
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--pf-border);
}

.alt-pressure-big {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 950;
  color: var(--pf-blue);
}

.alt-pressure-sub {
  margin: 0.45rem 0 0;
  color: var(--pf-muted);
}

.alt-status-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--pf-border);
  background: var(--pf-blue-soft);
}

.alt-status-card[data-level="low"] {
  background: rgba(35, 163, 107, 0.12);
}

.alt-status-card[data-level="medium"] {
  background: rgba(245, 158, 11, 0.14);
}

.alt-status-card[data-level="high"] {
  background: rgba(220, 38, 38, 0.10);
}

.alt-status-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--pf-ink);
}

.alt-bars {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.alt-bar-row {
  display: grid;
  grid-template-columns: 9rem 1fr 4.5rem;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.92rem;
}

.alt-bar-label {
  color: var(--pf-muted);
  font-weight: 750;
}

.alt-bar-track {
  height: 14px;
  border-radius: 999px;
  background: #e9edf6;
  overflow: hidden;
}

.alt-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--pf-blue);
  transition: width 220ms ease;
}

.alt-bar-value {
  text-align: right;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.alt-model-note,
.alt-safety-note {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  line-height: 1.6;
}

.alt-model-note {
  background: #fff8d6;
  border: 1px solid rgba(255, 205, 0, 0.55);
  color: #6b5300;
}

.alt-safety-note {
  background: #f7f9fe;
  border: 1px solid var(--pf-border);
  color: var(--pf-muted);
}

.alt-mini-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.alt-mini-table th,
.alt-mini-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--pf-border);
  text-align: left;
}

.alt-mini-table th {
  color: var(--pf-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.alt-mini-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 860px) {
  .pf-tool-hero,
  .alt-grid,
  .alt-dashboard {
    grid-template-columns: 1fr;
  }

  .alt-bar-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .alt-bar-value {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .pf-tool-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .alt-card,
  .pf-hero-copy,
  .pf-hero-note {
    border-radius: 18px;
    padding: 1rem;
  }

  .alt-depth-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .alt-barometer-wrap {
    grid-template-columns: 1fr;
  }
}

.alt-grid-spaced {
  margin-top: 1.25rem;
}

.alt-section-subtitle {
  margin-top: 1.1rem;
}
