/* Kogukonna ekstranet – landing page. Styles follow the AOS sign-in page (aos.tll.aero). */

@font-face { font-family: Montserrat; src: url("fonts/montserrat-light-webfont.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-regular-webfont.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-medium-webfont.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-semibold-webfont.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --panel: #2d2d2d;      /* dark left panel */
  --surface: #eaeeef;    /* light illustrated panel */
  --ink: #1c2b39;        /* text on light */
  --on-panel: #ffffff;
  --muted: #eaeaea;
  --accent: #ffdd4f;     /* TLL yellow */
  --gutter: clamp(24px, 4.5vw, 75px);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Montserrat, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

/* ---------- Layout: single column on small screens ---------- */

.page {
  display: grid;
  background: var(--panel); /* hides sub-pixel seams between the dark blocks */
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: 1fr;
  grid-template-areas:
    "brand"
    "main"
    "foot";
}

.brand { grid-area: brand; }
.welcome { grid-area: main; }
.foot { grid-area: foot; }

/* ---------- Dark panel ---------- */

.brand,
.foot {
  background: var(--panel);
  color: var(--on-panel);
  padding-inline: var(--gutter);
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 40px 36px;
}

.lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
}

.lockup img { width: 52px; flex: none; }

.lockup-name {
  margin: 0;
  font-size: clamp(26px, 7vw, 30px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  min-height: 44px;
  padding: 0.5em 1em;
  border: 1px solid var(--on-panel);
  border-radius: 5px;
  color: var(--on-panel);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.signin img { width: 22px; height: 22px; }

.signin:hover { background: rgba(255, 255, 255, 0.08); }
.signin:active { background: rgba(255, 255, 255, 0.14); }

/* ---------- Footer (support + copyright) ---------- */

.foot {
  padding-block: 32px 40px;
  font-size: 12px;
  line-height: 1.2;
}

.support { margin-bottom: 28px; }
.support-label { font-weight: 300; }
.support a { font-weight: 500; }

.copyright { margin: 0 0 4px; color: var(--muted); font-weight: 300; }
.policy { font-weight: 300; }

.foot a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Light illustrated panel ---------- */

.welcome {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  /* room for the logo + top decor above, and the illustrations below */
  padding: calc(26vw + 32px) var(--gutter) calc(46vw + 24px);
}

.welcome-text {
  position: relative;
  z-index: 2;
  max-width: 570px;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(22px, 5.6vw, 26px);
  font-weight: 600;
  line-height: 1.2;
}

.welcome p {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}

.welcome p + p { margin-top: 12px; }

.welcome a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tll-logo {
  position: absolute;
  z-index: 1;
  top: 24px;
  right: var(--gutter);
  width: clamp(128px, 34vw, 194px);
}

.decor { position: absolute; pointer-events: none; }

.decor-top-left { top: 0; left: 0; width: min(534px, 52%); }
.decor-waves    { bottom: 0; right: 0; width: min(632px, 92%); }
.decor-stone    { bottom: -2px; left: -10px; width: min(523px, 78%); }
.decor-castle   { bottom: 0; right: 0; width: min(632px, 92%); }
.decor-flowers  { bottom: -2px; left: -10px; width: min(273px, 42%); }

/* Animated plane: desktop split layout only (on stacked layouts its path crosses the text) */
.plane {
  display: none;
  position: absolute;
  z-index: 0;
  left: -100px;
  bottom: 250px;
  width: 129px;
  animation: plane-cycle 13s linear infinite;
}

@keyframes plane-cycle {
  0%   { opacity: 0; transform: translateX(-10%) translateY(0); }
  10%  { opacity: 1; transform: translateX(15vw) translateY(-10px); }
  80%  { opacity: 1; transform: translateX(60vw) translateY(-120px); }
  90%  { opacity: 0; transform: translateX(75vw) translateY(-130px); }
  100% { opacity: 0; transform: translateX(-10%) translateY(0); }
}

/* ---------- Tablet: keep the stack, give the art more air ---------- */

@media (min-width: 600px) {
  .welcome { padding-top: 170px; padding-bottom: 300px; }
  .tll-logo { top: 40px; }
}

/* ---------- Desktop: AOS-style split, dark panel 1/4 ---------- */

@media (min-width: 960px) {
  .page {
    /* AOS proportions: 75px gutters + 1/4 of the remaining width */
    grid-template-columns: clamp(400px, calc((100vw - 150px) / 4 + 150px), 560px) 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "brand main"
      "foot  main";
    min-height: max(100vh, 640px);
    min-height: max(100dvh, 640px);
  }

  .brand { padding-block: 64px 32px; }

  .lockup { margin-bottom: 1.875rem; }
  .lockup img { width: 60px; }
  .lockup-name { font-size: clamp(30px, 2.3vw, 40px); }

  .brand, .foot { padding-inline: clamp(40px, 5vw, 75px); }

  .signin { max-width: 300px; font-size: 14px; padding-inline: 0.75em; }

  .foot { padding-block: 0 80px; }
  .support { margin-bottom: 40px; }

  .welcome {
    padding: 140px 1rem 10rem clamp(48px, 7vw, 100px);
  }

  .welcome-text { max-width: 670px; padding-right: 1.875rem; }
  .welcome h1 { font-size: clamp(26px, 1.4vw + 12px, 32px); }
  .welcome p { font-size: 14px; }

  .tll-logo { top: 64px; right: 64px; width: 194px; }

  .decor-top-left { width: min(534px, 55%); }
  .decor-waves,
  .decor-castle { width: min(632px, 62%); }
  .decor-stone { width: min(523px, 52%); }
  .decor-flowers { width: min(273px, 28%); }

  .plane { display: block; }
}

@media (min-width: 1600px) {
  .welcome p { font-size: 15px; }
}

/* Keep last so it overrides the desktop rule above (AOS hides the plane the same way). */
@media (prefers-reduced-motion: reduce) {
  .plane { display: none; }
  .signin { transition: none; }
}
