/* Lernlang — shared blog styles */
:root{
  --bg:#f3efee;
  --text:#0e0e10;
  --muted:#6d6b73;
  --stroke:rgba(14,14,16,.10);
  --shadow: 0 18px 40px rgba(14,14,16,.08);
  --shadow-soft: 0 10px 24px rgba(14,14,16,.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1080px;
  --app-icon: url("AppIcon.png");
  --header-h: 72;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a{ color:inherit; text-decoration:none; }
button{ font:inherit; }
.container{ max-width:var(--max); margin:0 auto; padding:0 22px; }

/* Scroll progress */
.scroll-progress{
  position:fixed; top:0; left:0;
  height:3px; width:0%;
  background: linear-gradient(90deg,#ffb800,#ff3f99,#5b7cff);
  z-index:200;
  transition: width .12s linear;
}

/* Reveal */
.reveal{
  opacity:0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.reveal.is-visible{ opacity:1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
  .scroll-progress{ transition:none; }
}

.serif{
  font-family:"Playfair Display", Georgia, serif;
  font-style: italic; font-weight: 700; letter-spacing: -0.02em;
}

main{ padding: 20px 0 70px; }
.section{ padding: 54px 0; }
.section-tight{ padding: 30px 0; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  border-radius:999px; padding:10px 14px;
  font-weight:850; font-size:13px;
  border:1px solid var(--stroke);
  background:#fff;
  box-shadow: 0 10px 18px rgba(14,14,16,.06);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap; position:relative; overflow:hidden; isolation:isolate;
}
.btn::after{
  content:""; position:absolute; inset: 0 auto 0 -60%; width:40%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg); transition: left .5s ease; pointer-events:none;
}
.btn:hover::after{ left:130%; }
.btn:active{ transform: scale(.96); }
.btn:hover{ transform: translateY(-1px); box-shadow: 0 16px 24px rgba(14,14,16,.10); }
.btn.primary{ background: var(--text); color:#fff; border-color: rgba(14,14,16,.25); }
.btn.ghost{ background: transparent; box-shadow:none; }
@media (prefers-reduced-motion: reduce){
  .btn::after{ display:none; }
  .btn:active{ transform:none; }
}

/* Header */
header{
  position: sticky; top:0; z-index:50;
  background: linear-gradient(to bottom, rgba(243,239,238,.92), rgba(243,239,238,.70));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(14,14,16,.06);
}
.nav{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; gap:14px; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:950; letter-spacing:-0.02em; }
.brand-mark{
  width:28px; height:28px; border-radius:10px; object-fit:cover; display:block;
  box-shadow: 0 12px 22px rgba(14,14,16,.10);
}
.nav-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.nav-links{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.nav-toggle{
  display:none; align-items:center; justify-content:center;
  width:40px; height:40px; flex:0 0 auto;
  border-radius:12px; border:1px solid var(--stroke);
  background:#fff; cursor:pointer; color:var(--text);
}
.nav-toggle svg{ width:20px; height:20px; }
.nav-toggle .icon-close{ display:none; }
.nav-toggle.is-open .icon-menu{ display:none; }
.nav-toggle.is-open .icon-close{ display:block; }

/* Pills */
.pill{
  display:inline-flex; align-items:center; gap:10px;
  padding:8px 12px; border-radius:999px;
  background: rgba(255,255,255,.55);
  border:1px solid rgba(14,14,16,.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 18px rgba(14,14,16,.05);
  font-weight:850; font-size:12px; color: rgba(14,14,16,.72);
  width: fit-content;
}
.dot{ width:8px; height:8px; border-radius:99px; background:#ffd55c; box-shadow:0 0 0 3px rgba(255,213,92,.20); }

/* Hero */
.hero-section{ position:relative; isolation:isolate; }
.hero-glow{
  position:absolute; inset:-100px -40px auto -40px; height:460px;
  z-index:-1; pointer-events:none;
  background:
    radial-gradient(40% 55% at 20% 30%, rgba(255,184,0,.35), transparent 60%),
    radial-gradient(35% 50% at 80% 20%, rgba(91,124,255,.30), transparent 60%),
    radial-gradient(45% 55% at 55% 85%, rgba(255,63,153,.22), transparent 60%);
  filter: blur(40px);
  animation: heroDrift 22s ease-in-out infinite alternate;
}
@keyframes heroDrift{
  0%{ transform: translate(0,0) scale(1); }
  100%{ transform: translate(18px,-14px) scale(1.05); }
}
@media (prefers-reduced-motion: reduce){ .hero-glow{ animation:none; } }

.h1{
  margin:10px 0 10px;
  font-size: clamp(36px, 4.8vw, 60px);
  line-height:.95; letter-spacing:-0.05em; font-weight:950;
  max-width: 20ch;
}
.lead{
  margin:14px 0 0; max-width:64ch;
  color: rgba(14,14,16,.66);
  font-weight:650; line-height:1.7; font-size:15px;
}
.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }

/* ---------- Blog index ---------- */
.post-grid{
  display:grid; grid-template-columns: repeat(3, 1fr);
  gap:18px; margin-top:26px;
}
.post-card{
  display:flex; flex-direction:column;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.66);
  border:1px solid rgba(14,14,16,.06);
  box-shadow: var(--shadow-soft);
  overflow:hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}
.post-card:hover{ transform: translateY(-6px); box-shadow: 0 22px 46px rgba(14,14,16,.12); }
@media (hover:none){ .post-card:hover{ transform:none; } }
@media (prefers-reduced-motion: reduce){ .post-card{ transition:none; } .post-card:hover{ transform:none; } }

.post-thumb{
  min-height:150px; padding:16px;
  display:flex; align-items:flex-end;
  position:relative; overflow:hidden;
}
.post-thumb .mini{
  position:absolute; top:14px; left:14px;
  font-size:11px; font-weight:950; letter-spacing:.04em;
  padding:7px 10px; border-radius:999px;
  background: rgba(255,255,255,.7);
  border:1px solid rgba(255,255,255,.8);
  backdrop-filter: blur(10px);
  color:#0e0e10;
}
.post-body{ padding:18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.post-body h2{
  margin:0; font-size:19px; font-weight:950; letter-spacing:-0.03em; line-height:1.18;
}
.post-body p{
  margin:0; font-size:13.5px; font-weight:650; line-height:1.6;
  color: rgba(14,14,16,.64);
}
.post-meta{
  margin-top:auto; padding-top:10px;
  font-size:11.5px; font-weight:800; color: rgba(14,14,16,.5);
  letter-spacing:.02em;
}
.g1{
  background:
    radial-gradient(70% 70% at 20% 20%, rgba(255,184,0,.95), rgba(255,184,0,0) 55%),
    radial-gradient(70% 70% at 80% 35%, rgba(255,0,122,.65), rgba(255,0,122,0) 60%),
    radial-gradient(70% 70% at 60% 90%, rgba(0,212,255,.65), rgba(0,212,255,0) 60%),
    #ffe9a8;
}
.g2{
  background:
    radial-gradient(70% 70% at 25% 25%, rgba(255,122,0,.90), rgba(255,122,0,0) 60%),
    radial-gradient(70% 70% at 85% 25%, rgba(91,124,255,.95), rgba(91,124,255,0) 60%),
    radial-gradient(70% 70% at 55% 95%, rgba(0,212,255,.70), rgba(0,212,255,0) 62%),
    #1d34ff;
}
.g3{
  background:
    radial-gradient(70% 70% at 25% 20%, rgba(255,80,0,.92), rgba(255,80,0,0) 62%),
    radial-gradient(70% 70% at 75% 35%, rgba(255,63,153,.80), rgba(255,63,153,0) 60%),
    radial-gradient(70% 70% at 55% 95%, rgba(255,184,0,.65), rgba(255,184,0,0) 60%),
    #ff6a00;
}

/* ---------- Article ---------- */
.article{ max-width: 720px; margin: 0 auto; }
.article-head{ max-width:720px; margin:0 auto; }
.article-head .h1{ max-width: 24ch; font-size: clamp(32px, 4.2vw, 52px); }
.byline{
  margin-top:16px; font-size:12px; font-weight:800;
  color: rgba(14,14,16,.52); letter-spacing:.02em;
}
.article p{
  font-size:16px; line-height:1.78; font-weight:520;
  color: rgba(14,14,16,.80); margin: 0 0 20px;
}
.article h2{
  margin: 44px 0 14px;
  font-size: clamp(24px, 3vw, 31px);
  font-weight:950; letter-spacing:-0.035em; line-height:1.12;
}
.article h3{
  margin: 30px 0 10px;
  font-size:18px; font-weight:950; letter-spacing:-0.025em;
}
.article ul, .article ol{
  margin: 0 0 22px; padding-left: 20px;
  color: rgba(14,14,16,.80);
}
.article li{ font-size:15.5px; line-height:1.72; font-weight:520; margin-bottom:9px; }
.article strong{ font-weight:850; color: var(--text); }
.article a.inline{
  font-weight:800; border-bottom:2px solid rgba(255,184,0,.55);
}
.article a.inline:hover{ border-bottom-color:#ff3f99; }
.article hr{
  border:0; height:1px; margin:40px 0;
  background: linear-gradient(90deg, transparent, rgba(14,14,16,.14), transparent);
}
.article blockquote{
  margin: 26px 0; padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.62);
  border:1px solid rgba(14,14,16,.06);
  border-left:4px solid #ffb800;
  box-shadow: var(--shadow-soft);
}
.article blockquote p{ margin:0; font-size:15.5px; font-weight:650; }

.callout{
  margin: 30px 0; padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.68);
  border:1px solid rgba(14,14,16,.06);
  box-shadow: var(--shadow-soft);
  position:relative; overflow:hidden;
}
.callout::before{
  content:""; position:absolute; inset:-70px; pointer-events:none;
  background:
    radial-gradient(60% 60% at 20% 20%, rgba(255,184,0,.26), rgba(255,184,0,0) 60%),
    radial-gradient(60% 60% at 85% 25%, rgba(91,124,255,.20), rgba(91,124,255,0) 60%),
    radial-gradient(60% 60% at 50% 90%, rgba(255,63,153,.16), rgba(255,63,153,0) 60%);
}
.callout > *{ position:relative; z-index:1; }
.eyebrow{ font-size:10px; letter-spacing:.22em; font-weight:950; color: rgba(14,14,16,.55); }
.callout h3{ margin:10px 0 8px; font-weight:950; letter-spacing:-0.03em; font-size:19px; }
.callout p{ margin:0 0 14px; font-size:14.5px; line-height:1.65; font-weight:650; color: rgba(14,14,16,.68); }

/* Comparison table */
.table-wrap{ overflow-x:auto; margin: 26px 0; -webkit-overflow-scrolling: touch; }
table.cmp{
  width:100%; border-collapse:separate; border-spacing:0;
  min-width: 560px;
  background: rgba(255,255,255,.66);
  border:1px solid rgba(14,14,16,.08);
  border-radius: var(--radius-md); overflow:hidden;
  box-shadow: var(--shadow-soft);
}
table.cmp th, table.cmp td{
  text-align:left; padding: 13px 14px;
  font-size:13.5px; line-height:1.5;
  border-bottom:1px solid rgba(14,14,16,.07);
}
table.cmp th{ font-weight:950; letter-spacing:-0.01em; background: rgba(255,255,255,.5); }
table.cmp td{ font-weight:650; color: rgba(14,14,16,.72); }
table.cmp tr:last-child td{ border-bottom:0; }

/* CTA band */
.cta{
  border-radius:26px;
  background: rgba(255,255,255,.62);
  border:1px solid rgba(14,14,16,.06);
  box-shadow: var(--shadow-soft);
  padding:18px;
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap; margin-top: 34px;
}
.cta h3{ margin:0; font-weight:950; letter-spacing:-0.03em; font-size:18px; }
.cta p{ margin:6px 0 0; color: rgba(14,14,16,.62); font-weight:650; line-height:1.5; max-width:60ch; font-size:13px; }
.cta .right{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* More posts */
.more-posts{ margin-top:44px; }
.more-posts h3{ font-weight:950; letter-spacing:-0.03em; font-size:16px; margin:0 0 14px; }
.more-list{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.more-list a{
  display:block; padding:16px; border-radius:18px;
  background: rgba(255,255,255,.58);
  border:1px solid rgba(14,14,16,.06);
  box-shadow: 0 10px 20px rgba(14,14,16,.05);
  font-weight:850; font-size:14px; line-height:1.4; letter-spacing:-0.02em;
  transition: transform .25s ease;
}
.more-list a:hover{ transform: translateY(-3px); }
.more-list span{ display:block; margin-top:5px; font-size:12px; font-weight:650; color: rgba(14,14,16,.55); }

/* Footer */
.site-footer{
  margin-top:60px; padding:24px 0;
  border-top:1px solid rgba(14,14,16,.08);
  background: rgba(255,255,255,.4);
  backdrop-filter: blur(8px);
}
.footer-inner{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.footer-copy{ font-size:12px; color: rgba(14,14,16,.55); font-weight:650; }
.footer-links{ display:flex; gap:18px; flex-wrap:wrap; }
.footer-links a{ font-size:12px; color: rgba(14,14,16,.65); font-weight:650; }
.footer-links a:hover{ text-decoration:underline; }

/* Responsive */
@media (max-width: 980px){
  .post-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 840px){
  .nav-toggle{ display:grid; }
  .nav-links{
    position:fixed; top:76px; left:14px; right:14px; z-index:60;
    flex-direction:column; align-items:stretch;
    background:#fff; border:1px solid var(--stroke);
    border-radius:18px; box-shadow: var(--shadow);
    padding:10px; opacity:0; transform: translateY(-8px);
    pointer-events:none; transition: opacity .2s ease, transform .2s ease;
  }
  .nav-links.is-open{ opacity:1; transform: translateY(0); pointer-events:auto; }
  .nav-links .btn{ width:100%; min-height:44px; }
}
@media (max-width: 640px){
  .post-grid{ grid-template-columns: 1fr; }
  .more-list{ grid-template-columns: 1fr; }
  .section{ padding:40px 0; }
  .article p{ font-size:15.5px; }
  .btn{ min-height:40px; }
}
@media (max-width: 520px){
  .footer-inner{ flex-direction:column; text-align:center; }
}

/* ---------- Post thumbnails, second row ---------- */
.g4{
  background:
    radial-gradient(70% 70% at 22% 22%, rgba(0,212,255,.90), rgba(0,212,255,0) 58%),
    radial-gradient(70% 70% at 82% 30%, rgba(91,124,255,.85), rgba(91,124,255,0) 60%),
    radial-gradient(70% 70% at 55% 95%, rgba(255,184,0,.55), rgba(255,184,0,0) 60%),
    #0b7fd4;
}
.g5{
  background:
    radial-gradient(70% 70% at 25% 25%, rgba(120,225,140,.92), rgba(120,225,140,0) 58%),
    radial-gradient(70% 70% at 80% 30%, rgba(255,213,92,.90), rgba(255,213,92,0) 60%),
    radial-gradient(70% 70% at 55% 92%, rgba(0,180,160,.65), rgba(0,180,160,0) 62%),
    #12a06f;
}
.g6{
  background:
    radial-gradient(70% 70% at 22% 24%, rgba(255,63,153,.92), rgba(255,63,153,0) 60%),
    radial-gradient(70% 70% at 82% 28%, rgba(150,88,255,.90), rgba(150,88,255,0) 60%),
    radial-gradient(70% 70% at 58% 95%, rgba(0,212,255,.55), rgba(0,212,255,0) 60%),
    #7b2ff7;
}
.g7{
  background:
    radial-gradient(70% 70% at 24% 22%, rgba(255,184,0,.92), rgba(255,184,0,0) 58%),
    radial-gradient(70% 70% at 80% 32%, rgba(255,110,64,.88), rgba(255,110,64,0) 60%),
    radial-gradient(70% 70% at 52% 94%, rgba(180,60,40,.55), rgba(180,60,40,0) 62%),
    #e2521a;
}

/* ---------- Data table ----------
   Wrapped in .table-wrap so a wide table scrolls inside its own box on a
   phone instead of widening the page and letting the whole article slide
   sideways. */
.table-wrap{
  margin:22px 0;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:18px;
  border:1px solid rgba(14,14,16,.07);
  background: rgba(255,255,255,.58);
  box-shadow: 0 10px 20px rgba(14,14,16,.05);
}
.datatable{
  width:100%;
  border-collapse:collapse;
  font-size:14.5px;
}
/* Cells wrap rather than forcing the table wide. A table that has to be
   scrolled sideways on a phone hides its last column, which is usually the
   number the whole table was built around. */
.datatable th,
.datatable td{
  padding:11px 16px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid rgba(14,14,16,.07);
}
.datatable th{
  font-size:11px; font-weight:900; letter-spacing:.08em; text-transform:uppercase;
  color: rgba(14,14,16,.52);
  background: rgba(255,255,255,.5);
}
.datatable td{ font-weight:600; }
.datatable td:first-child{ font-weight:850; white-space:normal; }
.datatable tbody tr:last-child td{ border-bottom:none; }
.datatable .num{ font-variant-numeric: tabular-nums; }
.datatable th.num, .datatable td.num{ text-align:right; }

/* A source line under a table or figure. */
.source-note{
  margin:-8px 0 26px;
  font-size:12.5px; font-weight:650; line-height:1.55;
  color: rgba(14,14,16,.52);
}
.source-note a{ border-bottom:1px solid rgba(14,14,16,.22); }

@media (max-width: 640px){
  .datatable{ font-size:13px; }
  .datatable th, .datatable td{ padding:9px 10px; }
  .datatable th{ font-size:10px; letter-spacing:.05em; }
}

/* The hero glow is inset -40px on each side so the colour bleeds past the
   text column. body{overflow-x:hidden} propagates to the viewport and then
   leaves body itself scrollable, so that bleed was adding ~18px of sideways
   drift on every blog page at phone width. Clipping on the root stops it
   without touching the effect. */
html{ overflow-x: clip; }
