@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* browse.alaniver.fi — Alaniverin väriteema */
:root {
  --bg:      #060c1a;
  --bg2:     #0d1830;
  --card:    rgba(255, 255, 255, 0.04);
  --accent:  #3b82f6;
  --accent2: #06b6d4;
  --grad:    linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --text:    #f8fafc;
  --muted:   #94a3b8;
  --border:  rgba(255, 255, 255, 0.09);
  --radius:  16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Sama taustahehku kuin alaniver.fi:n herossa */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 50% -8%, rgba(59, 130, 246, 0.20), transparent 70%),
    radial-gradient(ellipse 60% 45% at 92% 92%, rgba(6, 182, 212, 0.11), transparent 70%),
    var(--bg);
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------- yläpalkki */

.ylapalkki {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  background: rgba(6, 12, 26, 0.72);
  backdrop-filter: blur(14px);
}
.brandi {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brandi:hover { text-decoration: none; }
.ylapalkki nav { display: flex; gap: 22px; font-size: .9rem; }
.ylapalkki nav a { color: var(--muted); }
.ylapalkki nav a:hover { color: var(--text); text-decoration: none; }

/* --------------------------------------------------------------------- hero */

main { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.hero { text-align: center; padding: 64px 0 40px; }

.korostuslappu {
  display: inline-block;
  padding: 5px 14px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent2);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #ffffff 30%, #9dc3f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.johdanto {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 1.05rem;
}

.latausrivi {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 14px;
}

.nappi {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  font-size: .92rem;
  font-weight: 600;
  transition: transform .15s, opacity .15s, background .15s;
}
.nappi:hover { text-decoration: none; background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.nappi small { font-weight: 400; font-size: .74rem; opacity: .75; }
.nappi.ensisijainen {
  border: none;
  background: var(--grad);
  color: #fff;
}
.nappi.ensisijainen:hover { opacity: .92; }
.nappi.iso { padding: 14px 28px; font-size: 1rem; }

.pieni { font-size: .82rem; }
.himmea { color: var(--muted); }

/* ------------------------------------------------------------- kuvankehys */

.kuvankehys {
  margin: 48px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75);
}
.kuvankehys figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
  text-align: left;
}
.kuvarivi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 22px;
}
.kuvarivi .kuvankehys { margin: 0; }

/* ------------------------------------------------------------------- osiot */

.osio { padding: 64px 0; }
.osio h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.osiojohdanto { color: var(--muted); margin-bottom: 28px; }
.osio > h2 + .ruudukko, .osio > h2 + .kuvarivi { margin-top: 28px; }

.ruudukko {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.kortti {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color .15s, transform .15s;
}
.kortti:hover { border-color: rgba(59, 130, 246, 0.35); transform: translateY(-2px); }
.kortti h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.kortti p { color: var(--muted); font-size: .9rem; }

.kuvake {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  margin-bottom: 16px;
  border-radius: 11px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent2);
}
.kuvake svg { width: 21px; height: 21px; }

/* ----------------------------------------------------------------- lataus */

.alustat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.alusta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.alusta h3 { font-size: 1.15rem; font-weight: 700; }
.alusta .nappi { width: 100%; }
/* Käyttäjän oma alusta nostetaan esiin, muut jäävät taustalle. */
.alusta.oma { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }
.alusta.odottaa { opacity: .62; }

.tarkisteet {
  margin-bottom: 22px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.tarkisteet summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.tarkisteet p { margin-top: 10px; }
.tarkisteet pre {
  margin: 10px 0;
  padding: 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .35);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.7;
  overflow-x: auto;
}
code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .07);
  font-size: .85em;
}

.huomio {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: .88rem;
}
.huomio strong { color: var(--text); }

.lista { list-style: none; }
.lista li {
  padding: 14px 0 14px 26px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .92rem;
  position: relative;
}
.lista li::before {
  content: '';
  position: absolute;
  left: 4px; top: 22px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--grad);
}
.lista li:last-child { border-bottom: none; }
.lista strong { color: var(--text); }

/* ------------------------------------------------------------ alatunniste */

.alatunniste {
  margin-top: 40px;
  padding: 30px 24px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.alatunniste a { color: var(--muted); text-decoration: underline; }
.alatunniste a:hover { color: var(--accent2); }

@media (max-width: 640px) {
  .ylapalkki nav a:not(:last-child) { display: none; }
  .hero { padding-top: 40px; }
  .osio { padding: 44px 0; }
  .kortti, .alusta { padding: 22px; }
}
