/* ═══════════════════════════════════════════════════════════════════════
   KosmoCal — visual language matches astrodeepsearch.
   Dark editorial · gold/teal accents · serif headlines · mono technical.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* palette */
  --bg:           #0b0d12;
  --surface:      #13161f;
  --surface-2:    #1a1e29;
  --hairline:     #1d2129;
  --border:       #2a2f3a;
  --border-2:     #3a4050;
  --ink:          #e5e5e5;
  --ink-soft:     #b8b8b8;
  --ink-mute:     #7d8593;
  --gold:         #e0a449;
  --gold-bg:      rgba(224, 164, 73, 0.10);
  --teal:         #4ec9b0;
  --teal-bg:      rgba(78, 201, 176, 0.10);
  --rose:         #d97777;
  --rose-bg:      rgba(217, 119, 119, 0.10);

  /* type */
  --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif:   "Times New Roman", Georgia, serif;
  --font-mono:    "Courier New", "DejaVu Sans Mono", monospace;

  /* layout */
  --content-w:    960px;
  --gutter:       28px;
  --radius:       4px;
  --ease:         cubic-bezier(0.4, 0.0, 0.2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1100px 600px at 50% -100px, rgba(224,164,73,0.06), transparent 60%),
    var(--bg);
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; color: var(--gold); font-family: var(--font-serif); }
code { font-family: var(--font-mono); font-size: 0.9em; color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 600; }

/* ───────────────────────────────────────────────────────────────────────
   MASTHEAD
   ─────────────────────────────────────────────────────────────────────── */
.masthead {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 0.5px solid var(--hairline);
}
.masthead__brand {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
}
.masthead__brand-mark {
  color: var(--gold);
  font-weight: 600;
}
.masthead__brand-name {
  color: var(--ink);
}
.masthead__nav {
  display: flex;
  gap: 10px;
  align-items: center;
}
.link {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: all 120ms var(--ease);
  text-decoration: none;
}
.link:hover {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--gold);
  text-decoration: none;
}

/* ───────────────────────────────────────────────────────────────────────
   HERO
   ─────────────────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: clamp(50px, 8vh, 90px) var(--gutter) 30px;
  text-align: center;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin: 0 0 14px;
}
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero__lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}
.hero__lede sub, .hero__lede sup { font-size: 0.7em; }

/* ───────────────────────────────────────────────────────────────────────
   CONVERTER — the centerpiece
   ─────────────────────────────────────────────────────────────────────── */
.converter {
  max-width: var(--content-w);
  margin: 30px auto 60px;
  padding: 0 var(--gutter);
}
.converter__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}
.converter__pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  transition: border-left-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.converter__pane--angular { border-left-color: var(--gold); }
.converter__pane--linear  { border-left-color: var(--teal); }
.converter__pane--active {
  box-shadow: 0 0 0 1px var(--gold), 0 8px 30px -16px rgba(224,164,73,0.4);
}
.converter__pane--linear.converter__pane--active {
  box-shadow: 0 0 0 1px var(--teal), 0 8px 30px -16px rgba(78,201,176,0.4);
}
.converter__pane-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.converter__pane-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--gold);
  color: #1a1208;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.converter__pane--linear .converter__pane-step,
.converter__pane-step--alt { background: var(--teal); color: #062420; }

.converter__pane-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin: 0;
}
.converter__input-row {
  display: flex;
  gap: 8px;
}
.converter__input-row input[type="number"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.converter__input-row input[type="number"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(224,164,73,0.22);
}
.converter__pane--linear input[type="number"]:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(78,201,176,0.22);
}

/* SWAP button */
.converter__swap {
  align-self: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms var(--ease);
}
.converter__swap:hover {
  background: var(--gold);
  color: #1a1208;
  transform: rotate(180deg);
  box-shadow: 0 8px 18px -8px rgba(224,164,73,0.6);
}

/* Distance / redshift section */
.converter__distance {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
}
.converter__input-row--distance {
  align-items: center;
}
.converter__input-row--distance input {
  flex: 0 0 200px;
}
.converter__distance-label {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}
.converter__checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.converter__checkbox:hover span { color: var(--ink); }

/* ───────────────────────────────────────────────────────────────────────
   SELECTS — uniform styled dropdown across the app
   ─────────────────────────────────────────────────────────────────────── */
.select-styled, select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 36px 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
  flex: 0 0 auto;
}
select:hover { border-color: var(--gold); }
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(78,201,176,0.22);
}

/* ───────────────────────────────────────────────────────────────────────
   ICON BUTTON (copy)
   ─────────────────────────────────────────────────────────────────────── */
.iconbtn {
  width: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-mute);
  font-size: 16px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 120ms var(--ease);
}
.iconbtn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}

/* ───────────────────────────────────────────────────────────────────────
   ERROR + TOAST
   ─────────────────────────────────────────────────────────────────────── */
.error-msg {
  margin-top: 14px;
  padding: 8px 14px;
  background: var(--rose-bg);
  border-left: 3px solid var(--rose);
  color: var(--rose);
  font-family: var(--font-mono);
  font-size: 12.5px;
  border-radius: var(--radius);
}
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--gold);
  padding: 10px 18px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
  z-index: 1000;
}

/* ───────────────────────────────────────────────────────────────────────
   RESULTS PANEL
   ─────────────────────────────────────────────────────────────────────── */
.results-section {
  max-width: var(--content-w);
  margin: 50px auto 30px;
  padding: 0 var(--gutter);
}
.section-head { margin-bottom: 16px; }
.results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.results__item {
  background: var(--surface);
  padding: 16px 18px;
  transition: background 150ms var(--ease);
}
.results__item:hover { background: var(--surface-2); }
.results__item--highlight {
  background: var(--gold-bg);
  border: 1px solid var(--gold);
}
.results__item--highlight:hover { background: var(--gold-bg); }
.results__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.results__value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
}
.results__item--highlight .results__value {
  color: var(--gold);
  font-weight: 600;
}
.results__unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  margin-left: 4px;
  font-weight: 400;
}

/* ───────────────────────────────────────────────────────────────────────
   COSMOLOGY OPTIONS
   ─────────────────────────────────────────────────────────────────────── */
.cosmology {
  max-width: var(--content-w);
  margin: 30px auto 60px;
  padding: 0 var(--gutter);
}
.cosmology__details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.cosmology__details summary {
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  list-style: none;
  user-select: none;
  position: relative;
}
.cosmology__details summary::-webkit-details-marker { display: none; }
.cosmology__details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 10px;
  color: var(--gold);
  transition: transform 200ms var(--ease);
}
.cosmology__details[open] summary::before { transform: rotate(90deg); }
.cosmology__row {
  display: flex;
  gap: 14px;
  padding: 0 18px 14px;
  align-items: center;
  flex-wrap: wrap;
}
.cosmology__label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.cosmology__label > span:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 60px;
}
.cosmology__params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}
.cosmology__params label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.cosmology__params label > span:first-child {
  min-width: 30px;
  color: var(--gold);
  font-weight: 600;
}
.cosmology__params input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 120ms var(--ease);
}
.cosmology__params input:focus {
  outline: none;
  border-color: var(--gold);
}
.cosmology__params .unit {
  font-size: 11px;
  color: var(--ink-mute);
}
.cosmology__ref { padding: 0 18px 14px; margin: 0; }
.cosmology__methods {
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cosmology__methods label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 120ms var(--ease);
}
.cosmology__methods label:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.cosmology__methods input[type="radio"] { margin-top: 4px; flex: 0 0 auto; accent-color: var(--gold); }
.cosmology__methods strong { color: var(--gold); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 120ms var(--ease);
}
.btn:hover { color: var(--ink); border-color: var(--gold); background: var(--surface); }

/* ───────────────────────────────────────────────────────────────────────
   ABOUT
   ─────────────────────────────────────────────────────────────────────── */
.about {
  max-width: var(--content-w);
  margin: 60px auto;
  padding: 0 var(--gutter);
}
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}
.about h3 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin: 24px 0 10px;
}
.about h3:first-child { margin-top: 0; }
.about p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ───────────────────────────────────────────────────────────────────────
   FOOTER
   ─────────────────────────────────────────────────────────────────────── */
.footer {
  max-width: var(--content-w);
  margin: 80px auto 30px;
  padding: 24px var(--gutter);
  border-top: 0.5px solid var(--hairline);
  text-align: center;
}

.muted { color: var(--ink-mute); }
.small { font-size: 12.5px; }

/* ───────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .converter__grid {
    grid-template-columns: 1fr;
  }
  .converter__swap {
    justify-self: center;
  }
  .converter__swap:hover { transform: rotate(90deg); }
  .about__grid { grid-template-columns: 1fr; gap: 0; }
  .converter__input-row { flex-wrap: wrap; }
  .converter__input-row input[type="number"] { width: 100%; }
  .converter__input-row--distance input { flex: 1 1 100%; }
}
