/*
  Andres Putrolainen – staattinen pääsivu
  Tähtitaivas ja portaalit toteutetaan ilman bittikuvia.
*/

:root {
  color-scheme: dark;
  --space-0: #04050a;
  --space-1: #080b15;
  --space-2: #111725;
  --text: #f4f0e8;
  --muted: #b9beca;
  --line: rgba(255, 255, 255, 0.14);
  --coach: #d08a57;
  --coach-deep: #6c3022;
  --coach-glow: rgba(220, 139, 83, 0.52);
  --poet: #8d68b8;
  --poet-deep: #27192f;
  --poet-gold: #c8ad49;
  --poet-glow: rgba(145, 101, 190, 0.5);
  --professional: #5cb5d2;
  --professional-deep: #12394a;
  --professional-glow: rgba(82, 180, 213, 0.48);
  --radius: 1.1rem;
  --content-width: 1180px;
}

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

html {
  min-height: 100%;
  background: var(--space-0);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 18%, rgba(63, 76, 112, 0.24), transparent 38rem),
    radial-gradient(circle at 12% 78%, rgba(66, 36, 88, 0.15), transparent 34rem),
    linear-gradient(160deg, var(--space-0), var(--space-1) 52%, #050711);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -2;
  pointer-events: none;
  background-repeat: repeat;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255,255,255,.82) 0 1px, transparent 1.25px),
    radial-gradient(circle, rgba(190,213,255,.54) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255,222,177,.38) 0 1px, transparent 1.35px);
  background-position: 19px 23px, 117px 89px, 61px 151px;
  background-size: 211px 211px, 283px 283px, 367px 367px;
  opacity: .52;
  animation: starlight-near 11s ease-in-out infinite alternate;
}

body::after {
  z-index: -3;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.42) 0 .8px, transparent 1.15px),
    radial-gradient(circle, rgba(156,188,255,.32) 0 .7px, transparent 1.1px);
  background-position: 71px 37px, 9px 131px;
  background-size: 137px 137px, 191px 191px;
  opacity: .42;
  animation: starlight-far 17s ease-in-out infinite alternate;
}

@keyframes starlight-near {
  from { opacity: .45; transform: translate3d(0, 0, 0) scale(1); }
  to   { opacity: .60; transform: translate3d(.25%, -.18%, 0) scale(1.004); }
}

@keyframes starlight-far {
  from { opacity: .34; }
  to   { opacity: .47; }
}

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: .45rem;
  color: #111;
  background: #fff;
  transform: translateY(-180%);
}

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

.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
  padding: clamp(3.2rem, 8vw, 7rem) 0 2rem;
}

.identity {
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 1rem;
  color: #c5cbd7;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 6.9rem);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.identity__summary {
  max-width: 760px;
  margin: clamp(1.6rem, 4vw, 2.5rem) auto 0;
  color: #dde0e7;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
  text-wrap: balance;
}

.identity__instruction {
  margin: .75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.portals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.6vw, 2rem);
  margin-top: clamp(3rem, 7vw, 6rem);
}

.portal {
  --portal-color: #fff;
  --portal-glow: rgba(255,255,255,.3);
  position: relative;
  isolation: isolate;
  display: flex;
  aspect-ratio: 1 / 1;
  min-height: 25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), transparent 32%),
    rgba(7, 9, 15, .72);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.035),
    0 1.4rem 4rem rgba(0,0,0,.4),
    0 0 2rem var(--portal-glow);
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.portal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 34%, rgba(3,4,8,.38) 56%, rgba(3,4,8,.95) 86%);
}

.portal:hover,
.portal:focus-visible {
  transform: translateY(-.45rem) scale(1.008);
  border-color: var(--portal-color);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 1.8rem 5rem rgba(0,0,0,.48),
    0 0 4.5rem var(--portal-glow);
}

.portal:focus-visible {
  outline: 3px solid rgba(255,255,255,.92);
  outline-offset: 5px;
}

.portal--coach {
  --portal-color: var(--coach);
  --portal-glow: var(--coach-glow);
}

.portal--poet {
  --portal-color: var(--poet);
  --portal-glow: var(--poet-glow);
}

.portal--professional {
  --portal-color: var(--professional);
  --portal-glow: var(--professional-glow);
}

.portal__glow {
  position: absolute;
  inset: 6%;
  z-index: -1;
  border-radius: 40%;
  background: var(--portal-color);
  filter: blur(3.4rem);
  opacity: .13;
  animation: portal-breath 6.5s ease-in-out infinite alternate;
}

.portal--poet .portal__glow { animation-duration: 8.5s; }
.portal--professional .portal__glow { animation-duration: 7.4s; }

@keyframes portal-breath {
  from { opacity: .09; transform: scale(.92); }
  to   { opacity: .20; transform: scale(1.05); }
}

.portal__window {
  position: absolute;
  top: 8%;
  left: 50%;
  z-index: 1;
  width: 70%;
  height: 58%;
  transform: translateX(-50%);
  border: 1px solid var(--portal-color);
  box-shadow:
    inset 0 0 2.4rem rgba(0,0,0,.62),
    0 0 1.4rem var(--portal-glow),
    0 0 4rem var(--portal-glow);
}

.portal__window--coach {
  overflow: hidden;
  border-color: rgba(209, 139, 91, 0.42);

  background:
    radial-gradient(
      ellipse at 50% 69%,
      rgba(255, 205, 142, 0.48) 0%,
      rgba(191, 91, 53, 0.25) 19%,
      transparent 43%
    ),
    linear-gradient(
      180deg,
      #12121a 0%,
      #21161a 44%,
      #613427 68%,
      #180d0b 100%
    );

  box-shadow:
    inset 0 0 2.8rem rgba(0, 0, 0, 0.72),
    inset 0 -1.2rem 2.8rem rgba(196, 88, 47, 0.25),
    0 0 0.5rem rgba(208, 138, 87, 0.12);
}

.coach-horizon {
  position: absolute;
  inset: auto -12% 9%;
  height: 23%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, rgba(63,34,28,.4), rgba(9,6,6,.95));
  box-shadow: 0 -1px 0 rgba(255,190,121,.25);
}

.portal__window--poet {
  overflow: hidden;
  width: 64%;
  border-radius: 47% 53% 45% 55% / 55% 42% 58% 45%;
  background:
    radial-gradient(circle at 62% 28%, rgba(231,211,134,.85) 0 3%, transparent 3.5%),
    radial-gradient(circle at 46% 49%, rgba(135,79,177,.6), transparent 38%),
    linear-gradient(150deg, #17101e 9%, #3b224b 52%, #12101d);
  animation: poet-shape 10s ease-in-out infinite alternate;
}

@keyframes poet-shape {
  from { border-radius: 47% 53% 45% 55% / 55% 42% 58% 45%; }
  to   { border-radius: 53% 47% 57% 43% / 45% 58% 42% 55%; }
}

.poet-moon {
  position: absolute;
  top: 17%;
  right: 18%;
  width: 17%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--poet-gold);
  box-shadow: 0 0 1rem rgba(220,199,103,.55), 0 0 3rem rgba(174,128,71,.24);
  opacity: .8;
}

.portal__window--professional {
  overflow: hidden;
  clip-path: polygon(8% 0, 92% 0, 100% 10%, 100% 90%, 92% 100%, 8% 100%, 0 90%, 0 10%);
  background:
    linear-gradient(135deg, rgba(73,177,213,.18), transparent 38%),
    linear-gradient(180deg, #112a38, #0a1721);
}

.professional-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(111,202,231,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111,202,231,.13) 1px, transparent 1px);
  background-size: 14% 14%;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25));
}

.portal__content {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  min-width: 0;
  padding: clamp(1.25rem, 2.8vw, 2rem);
  flex-direction: column;
  justify-content: flex-end;
}

.portal__number {
  margin-bottom: .5rem;
  color: var(--portal-color);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.portal__title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.4vw, 2.3rem);
  line-height: 1.05;
  text-wrap: balance;
}

.portal__description {
  max-width: 31ch;
  margin-top: .85rem;
  color: #d4d8e0;
  font-size: clamp(.94rem, 1.4vw, 1.05rem);
  line-height: 1.5;
}

.portal__action {
  display: inline-flex;
  margin-top: 1.2rem;
  align-items: center;
  gap: .45rem;
  color: var(--portal-color);
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.identity-note {
  max-width: 780px;
  margin: clamp(2.2rem, 5vw, 4rem) auto 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
  text-align: center;
  text-wrap: balance;
}

.site-footer {
  display: flex;
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: 1.35rem 0 .4rem;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  color: #969da9;
  font-size: .82rem;
}

.site-footer a { text-underline-offset: .2em; }
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--text); }

@media (max-width: 940px) {
  .portals {
    grid-template-columns: 1fr;
    width: min(100%, 36rem);
    margin-inline: auto;
  }
  .portal { min-height: auto; }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(calc(100% - 1.25rem), var(--content-width));
    padding-top: 3rem;
  }
  h1 { font-size: clamp(2.75rem, 14vw, 4.4rem); }
  .portal { border-radius: .8rem; }
  .portal__window { top: 7%; height: 56%; }
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before,
  body::after,
  .portal__glow,
  .portal__window--poet { animation: none; }
  .portal { transition: none; }
}
