/* Tähetorn Orion — one-page site. Tokens: see PLAN.md §4.2 */

:root {
  --bg: #05060a;
  --surface: #0e1118;
  --surface-2: #151926;
  --line: rgb(255 255 255 / 0.1);
  --line-strong: rgb(255 255 255 / 0.22);
  --text: #f3f4f7;
  --muted: #a3a9b8;
  --star: #9cc2ff;
  --glow: #ffb54a;

  --font-display: Optima, Candara, "Segoe UI", "Noto Sans", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 20px;
  --radius-sm: 12px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-x: hidden;
}

/* Starfield: two tiled layers of tiny radial dots; the second one twinkles. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(1px 1px at 23px 41px, rgb(255 255 255 / 0.7), transparent 60%),
    radial-gradient(1px 1px at 141px 97px, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(1px 1px at 77px 173px, rgb(255 255 255 / 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 189px 19px, rgb(207 224 255 / 0.8), transparent 60%),
    radial-gradient(1px 1px at 251px 233px, rgb(255 255 255 / 0.45), transparent 60%),
    radial-gradient(1px 1px at 311px 151px, rgb(255 255 255 / 0.55), transparent 60%);
  background-size: 337px 281px;
}

body::after {
  background-image:
    radial-gradient(1.5px 1.5px at 61px 113px, rgb(255 255 255 / 0.9), transparent 60%),
    radial-gradient(1px 1px at 211px 61px, rgb(207 224 255 / 0.8), transparent 60%),
    radial-gradient(2px 2px at 383px 307px, rgb(255 255 255 / 0.75), transparent 60%),
    radial-gradient(1px 1px at 137px 389px, rgb(255 255 255 / 0.7), transparent 60%);
  background-size: 479px 443px;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

img,
svg,
iframe { display: block; max-width: 100%; }

img { height: auto; }

a { color: var(--star); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: #c6dbff; }

:focus-visible {
  outline: 2px solid var(--star);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; list-style: none; }

address { font-style: normal; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.eyebrow {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
}

.btn--primary {
  background: var(--glow);
  color: #1c1205;
  box-shadow: 0 8px 30px -10px rgb(255 181 74 / 0.6);
}
.btn--primary:hover {
  color: #1c1205;
  background: #ffc66e;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px -10px rgb(255 181 74 / 0.75);
}

.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgb(255 255 255 / 0.03);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: var(--star);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgb(5 6 10 / 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: background-color 0.3s, border-color 0.3s;
}

.is-top .site-header {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }

.brand__logo { width: 26px; height: 34px; color: var(--text); }

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
}

.nav a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover,
.nav a[aria-current="true"] { color: var(--text); }

.nav--desktop { display: none; }

.nav--desktop ul { display: flex; gap: 4px; }

.nav--desktop a {
  position: relative;
  padding: 10px 12px;
}

.nav--desktop a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--star);
  box-shadow: 0 0 8px var(--star);
  opacity: 0;
  transition: opacity 0.2s;
}
.nav--desktop a[aria-current="true"]::after { opacity: 1; }

/* Mobile menu: <details> so it works without JS */
.nav-mobile { position: relative; }

.nav-mobile summary {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}
.nav-mobile summary::-webkit-details-marker { display: none; }

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.burger { position: relative; }
.burger::before,
.burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }

.nav-mobile[open] .burger { background: transparent; }
.nav-mobile[open] .burger::before { transform: translateY(6px) rotate(45deg); }
.nav-mobile[open] .burger::after { transform: translateY(-6px) rotate(-45deg); }

.nav--mobile {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(80vw, 280px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(14 17 24 / 0.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.8);
}

.nav--mobile a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
}
.nav--mobile a:hover { background: var(--surface-2); }

@media (min-width: 860px) {
  .nav--desktop { display: block; }
  .nav-mobile { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(40px, 8vw, 96px));
  padding-bottom: clamp(40px, 6vw, 72px);
  overflow: hidden;
  isolation: isolate;
}

/* Soft nebula glows */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% 0;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 78% 35%, rgb(86 120 255 / 0.16), transparent 70%),
    radial-gradient(35% 40% at 15% 80%, rgb(150 90 255 / 0.1), transparent 70%),
    radial-gradient(25% 30% at 60% 10%, rgb(255 181 74 / 0.06), transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  align-items: center;
  gap: 32px;
}

.hero__text { position: relative; z-index: 1; max-width: 640px; }

.wordmark {
  margin-bottom: 24px;
  font-size: clamp(3rem, 11vw, 6.5rem);
  font-weight: 800;
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
  line-height: 0.95;
  background: linear-gradient(180deg, #fff 30%, #c9d6f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 34em;
  margin-bottom: 32px;
  color: #d6d9e2;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__art {
  position: absolute;
  top: -12%;
  right: -12%;
  width: min(70vw, 360px);
  height: auto;
  opacity: 0.35;
  pointer-events: none;
}

.hero__tower {
  fill: none;
  stroke: rgb(255 255 255 / 0.28);
  stroke-width: 0.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__lines {
  fill: none;
  stroke: var(--star);
  stroke-opacity: 0.45;
  stroke-width: 0.18;
  stroke-dasharray: 0.8 0.8;
}

.hero__stars circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 4s ease-in-out infinite alternate;
}
.hero__stars circle:nth-child(2) { animation-delay: -1s; }
.hero__stars circle:nth-child(3) { animation-delay: -2.2s; }
.hero__stars circle:nth-child(4) { animation-delay: -0.6s; }
.hero__stars circle:nth-child(5) { animation-delay: -3.1s; }
.hero__stars circle:nth-child(6) { animation-delay: -1.7s; }
.hero__stars circle:nth-child(7) { animation-delay: -2.6s; }

@keyframes pulse {
  from { opacity: 0.55; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.1); }
}

@media (min-width: 600px) {
  .hero__art { width: min(48vw, 380px); top: -6%; right: -4%; }
}

@media (min-width: 900px) {
  .hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
  .hero__inner { grid-template-columns: 1.35fr 1fr; }
  .hero__art { position: static; width: 100%; max-height: 460px; opacity: 1; }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(48px, 7vw, 88px); }

.section__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.section__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 1.5px solid rgb(255 255 255 / 0.8);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgb(156 194 255 / 0.22), rgb(14 17 24 / 0.9) 70%);
  color: var(--star);
  box-shadow: 0 0 22px -6px rgb(156 194 255 / 0.5);
}
.section__icon svg { width: 24px; height: 24px; }

.section__head h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.04), rgb(255 255 255 / 0.01)),
    var(--surface);
  padding: clamp(22px, 3.5vw, 36px);
}

.card::before {
  /* hairline highlight along the top edge */
  content: "";
  position: absolute;
  inset: 0 20% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.25), transparent);
}

/* ---------- Info ---------- */

.bento { display: grid; gap: 20px; }

@media (min-width: 900px) {
  .bento { grid-template-columns: 1.3fr 1fr; align-items: stretch; }

  /* equal-height cards: keep the sign-off at the bottom of the intro card */
  .card--intro { display: flex; flex-direction: column; }
  .card--intro .signoff { margin-top: auto; }
}

.lead { font-size: clamp(1.15rem, 2vw, 1.3rem); color: #e4e7ee; }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 28px;
  padding: 14px 18px;
  border: 1px solid rgb(255 181 74 / 0.35);
  border-radius: var(--radius-sm);
  background: rgb(255 181 74 / 0.08);
  color: #ffdcaa;
}
.notice .icon { color: var(--glow); }

.signoff {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
}
.signoff span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: normal;
}

.prices {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.prices caption {
  margin-bottom: 12px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.prices th,
.prices td {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.prices th { text-align: left; font-weight: 400; padding-right: 16px; }

.prices td {
  text-align: right;
  white-space: nowrap;
  color: var(--glow);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

/* "tasuta" rows */
.prices tr:nth-child(n+3) td { font-size: 1.1rem; color: var(--star); }

.rules {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.98rem;
}
.rules li { display: flex; gap: 10px; }
.rules li::before { content: "✦"; color: var(--star); font-size: 0.8em; line-height: 2; }

/* ---------- Tegevused ---------- */

.features {
  display: grid;
  gap: 20px;
}

@media (min-width: 700px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}

.feature {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.feature__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.feature__media img { width: 100%; height: 100%; object-fit: cover; }

/* the two original 222 px photos: keep them from growing too large */
.feature__media--small img { max-width: 444px; margin-inline: auto; }

.feature__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgb(0 0 0 / 0.35)),
    linear-gradient(180deg, transparent 55%, var(--surface));
}

.feature__body { padding: 8px clamp(22px, 3vw, 28px) clamp(22px, 3vw, 28px); }

.feature h3 {
  margin-bottom: 14px;
  font-size: 1.45rem;
}

.feature p { color: #d3d6de; font-size: 1.02rem; }

.feature__link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.chips li {
  padding: 4px 12px;
  border: 1px solid rgb(156 194 255 / 0.3);
  border-radius: 999px;
  background: rgb(156 194 255 / 0.08);
  color: #d8e6ff;
  font-size: 0.9rem;
}

/* ---------- Kontakt + Teejuht ---------- */

.split { display: grid; gap: clamp(56px, 8vw, 40px); }

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1.15fr; gap: 32px; align-items: stretch; }

  /* equal-height contact and map cards */
  .split > section { display: flex; flex-direction: column; }
  .split .contact,
  .split .map { flex: 1; }
  .split .map iframe { aspect-ratio: auto; min-height: 320px; }
}

.label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact__person {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.contact__links { display: grid; gap: 4px; margin-bottom: 28px; }

.contact__links a,
.contact address {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact__links a {
  min-height: 48px;
  color: var(--text);
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__links a:hover { color: var(--star); }

.contact .icon { color: var(--star); }

.contact address { align-items: flex-start; margin-bottom: 28px; }
.contact address .icon { margin-top: 0.3em; }

.contact__org {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.98rem;
}
.contact__org p { margin-bottom: 4px; }

.iban {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.copy {
  margin-left: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.copy:hover { border-color: var(--star); }

.map {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.map iframe {
  flex: 1;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  /* night-mode look for the light Google map */
  filter: invert(0.9) hue-rotate(180deg) saturate(0.7) brightness(0.95) contrast(0.95);
}

.map__link {
  margin: 0;
  padding: 6px 20px;
  border-top: 1px solid var(--line);
}
.map__link a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-height: 44px; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 48px 40px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgb(86 120 255 / 0.05));
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer__logo { width: 42px; height: 56px; color: rgb(255 255 255 / 0.75); }

.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--star); }

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ---------- Reveal on scroll (enabled by JS) ---------- */

.has-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.has-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .has-reveal .reveal { opacity: 1; transform: none; }
}
