@font-face {
  font-family: 'Brush Script';
  src: url('./BrushScript.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root{
  color-scheme: light;
  --bg: #e9eaee;
  --frame: rgba(245, 245, 245, 0.78);
  --card: rgba(255, 255, 255, 0.72);
  --border: rgba(40, 40, 40, 0.12);
  --text: #1a1a1a;
  --muted: #666;
  --muted2: #888;
  --accent: #2f8f66;
  --accent-2: #2f5fbf;
  --danger: #dc2626;
  --shadow: 0 0 0 1px rgba(20,20,20,0.12), 0 16px 48px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 10px;
  --maxw: 1100px;
}

*{ box-sizing: border-box; }
html,body{
  margin:0;
  padding:0;
  background:
    radial-gradient(circle at 8% 10%, rgba(47, 143, 102, 0.08), transparent 42%),
    radial-gradient(circle at 92% 18%, rgba(47, 95, 191, 0.07), transparent 46%),
    radial-gradient(circle at 60% 95%, rgba(0, 0, 0, 0.04), transparent 55%),
    linear-gradient(180deg, #eef0f4 0%, var(--bg) 58%, #e7e8ec 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  line-height: 1.55;
}

a{ color: var(--accent-2); text-decoration: none; }
a:hover{ text-decoration: underline; }

.site{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.frame{
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.40) 0%, rgba(245,245,245,0.75) 22%, rgba(245,245,245,0.86) 100%),
    var(--frame);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(1.05) blur(10px);
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.62));
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.05) blur(10px);
  gap: 18px;
}

.brand{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand a{
  color: var(--text);
  text-decoration: none;
}
.brand-title{
  font-size: 18px;
  font-family: 'Brush Script', cursive;
  font-weight: normal;
  margin: 0;
  line-height: 1.15;
}
.brand-sub{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.nav a{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover{
  background: rgba(0,0,0,0.03);
  color: var(--text);
}
.nav a[aria-current="page"]{
  color: var(--text);
  border-color: rgba(47, 95, 191, 0.22);
  background: rgba(47, 95, 191, 0.05);
}

.content{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 36px;
  flex: 1;
}

.card{
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.88) 100%);
  border: 1px solid rgba(40,40,40,0.18);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.72) inset,
    0 10px 28px rgba(0,0,0,0.08);
}

.stack{ display:flex; flex-direction: column; gap: 14px; }
.grid{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}

.lede{
  color: var(--muted);
  font-size: 15px;
  max-width: 70ch;
}

h1,h2,h3{ line-height: 1.2; margin: 0; }
h1{ font-size: 32px; font-family: 'Brush Script', cursive; font-weight: normal; letter-spacing: 0; }
h2{ font-size: 20px; margin-top: 6px; }
h3{
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.btn-row{ display:flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(20,20,20,0.12);
  background: rgba(255,255,255,0.55);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover{ background: rgba(255,255,255,0.72); text-decoration: none; }
.btn-primary{
  background: rgba(47, 143, 102, 0.06);
  border-color: rgba(47, 143, 102, 0.30);
  color: rgba(22, 66, 47, 0.95);
}
.btn-primary:hover{
  background: rgba(47, 143, 102, 0.10);
  border-color: rgba(47, 143, 102, 0.40);
}
.btn-primary:active{
  background: rgba(47, 143, 102, 0.14);
}
.btn-secondary{
  background: rgba(107, 114, 128, 0.08);
  border-color: rgba(107, 114, 128, 0.26);
  color: rgba(45, 51, 59, 0.92);
}
.btn-secondary:hover{
  background: rgba(107, 114, 128, 0.12);
  border-color: rgba(107, 114, 128, 0.34);
}
.btn-link{
  background: transparent;
  border-color: transparent;
  color: var(--accent-2);
  padding: 10px 10px;
}
.btn-link:hover{ background: rgba(47, 95, 191, 0.05); }

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(24, 96, 67, 0.95);
  border: 1px solid rgba(47, 143, 102, 0.32);
  background: rgba(47, 143, 102, 0.08);
}

.muted{ color: var(--muted); }
.small{ font-size: 12px; color: var(--muted2); }

.kicker{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items:center;
  margin-bottom: 10px;
}

.list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.list li{ margin: 6px 0; }

.footer{
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0.48));
  backdrop-filter: saturate(1.05) blur(10px);
}
.footer-inner{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px 16px;
  align-items: center;
}
.footer-left{
  display:flex;
  flex-direction: column;
  gap: 3px;
}
.footer-center{
  display:flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: center;
  align-items: center;
}
.footer-right{
  display:flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-end;
  align-items: center;
}
.footer-user-label{ font-size: 12px; color: #888; white-space: nowrap; }
.footer a{ color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; }
.footer a:hover{ color: var(--text); }
.footer-center svg, .footer-right svg{ width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.footer-auth-btn { display:none; padding: 5px 14px; border-radius: 6px; border: 1px solid #ccc; background: #f5f5f5; color: #444; font-size: 13px; font-family: inherit; cursor: pointer; }
.footer-auth-btn:hover { background: #eee; border-color: #bbb; }
.footer-auth-btn.is-logout { border-color: #f5a0a0; background: #fff5f5; color: #c44; }
.footer-auth-btn.is-logout:hover { background: #fde8e8; }
.footer-auth-btn.is-logout:hover { background: #fde8e8; }

.video{
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(20,20,20,0.14);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.70);
  overflow: hidden;
}
.video iframe{
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.note{
  border-left: 3px solid var(--accent-2);
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(47, 95, 191, 0.045);
  border: 1px solid rgba(47, 95, 191, 0.12);
  color: var(--muted);
}

.danger{
  border-left-color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
  border-color: rgba(220, 38, 38, 0.16);
}

.hero-card{
  padding: 32px 28px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.hero-text{ flex: 1; min-width: 0; }
.hero-buttons{
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.hero-logo{
  width: 220px;
  height: 220px;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .header{
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 10px;
  }
  .brand{
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .brand-title{ font-size: 20px; }
  .nav{
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .nav::-webkit-scrollbar{ display: none; }
  .nav a{ flex-shrink: 0; }
  .content{ padding-top: 18px; }
  .hero-card{ flex-direction: column; align-items: flex-start; padding: 20px 18px 18px; gap: 14px; }
  .hero-logo{ display: none; }
  .hero-buttons{ flex-direction: row; flex-wrap: wrap; }
  .hero-card h1{ font-size: 44px !important; }
}

@media (max-width: 480px){
  .header{
    padding: 10px 12px;
    gap: 8px;
  }
  .brand-sub{ font-size: 11px; }
  .nav{
    gap: 2px;
    margin: 0 -12px;
    padding: 2px 12px;
  }
  .nav a{
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
  }
  .content{ padding: 14px 12px 28px; }
  .card{ padding: 14px; }
  .hero-card{ padding: 16px 14px 14px; }
  .hero-card h1{ font-size: 36px !important; }
  .footer-inner{
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .footer-center{ justify-content: flex-start; }
  .footer-right{ justify-content: flex-start; }
}

/* ── Story layout (berattelsen.html) ── */
.story-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 14px;
}
.story-row--image-right { flex-direction: row; }
.story-row--image-left  { flex-direction: row-reverse; }
.story-row__text { flex: 1 1 0; min-width: 0; }
.story-row__text > p:first-child,
.story-row__text > ul:first-child { margin-top: 0; }
.story-fig { flex: 0 0 320px; margin: 0; }
.story-row--half .story-fig,
.story-row--half .story-row__text { flex: 1 1 0; }
.story-fig img {
  width: 100%; height: auto; display: block;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
}
.story-fig figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: #666; }
.story-fig figcaption .credit { display: block; margin-top: 6px; color: #888; }
@media (max-width: 720px) {
  .story-row,
  .story-row--image-left { flex-direction: column; }
  .story-fig { flex-basis: auto; width: 100%; }
}

/* ── Android install page ── */
.apk-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}
.apk-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.apk-qr {
  position: sticky;
  top: 16px;
}
@media (max-width: 760px) {
  .apk-layout { grid-template-columns: 1fr; }
  .apk-qr { position: static; }
}

/* ── Studio iframe mode ── */
.content.studio-main {
  padding: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.content.studio-main #studio-iframe {
  flex: 1;
  border: none;
  width: 100%;
  min-height: 0;
  display: block;
}
