/* My Little Apps — shared styles for the home, projects, about and legal pages.
   Same family as the apps: calm blue-grey, Instrument Serif headings, Figtree text,
   light and dark theme follow the device. */
:root{
  --bg:#eef1f5; --surface:#ffffff; --surface-2:#e6eaf0; --line:#d4dae3;
  --text:#17202b; --text-dim:#5b6676;
  --accent:#2c6a98; --accent-ink:#ffffff; --warm:#a96a26;
  --shadow:0 1px 2px rgba(23,32,43,.06),0 12px 32px rgba(23,32,43,.10);
  --f-display:'Instrument Serif','Iowan Old Style',Georgia,serif;
  --f-body:'Figtree',system-ui,-apple-system,'Segoe UI',sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0e131a; --surface:#161d27; --surface-2:#1e2733; --line:#2b3544;
    --text:#e8edf3; --text-dim:#95a2b3;
    --accent:#7cb6de; --accent-ink:#0c1620; --warm:#e2ab63;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 14px 36px rgba(0,0,0,.35);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0e131a; --surface:#161d27; --surface-2:#1e2733; --line:#2b3544;
  --text:#e8edf3; --text-dim:#95a2b3;
  --accent:#7cb6de; --accent-ink:#0c1620; --warm:#e2ab63;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 14px 36px rgba(0,0,0,.35);
  color-scheme:dark;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--f-body);font-size:17px;line-height:1.6;overflow-x:hidden}
img{max-width:100%;height:auto;display:block}
a{color:var(--accent)}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px}
.skip{position:absolute;left:-9999px}
.skip:focus{left:16px;top:12px;z-index:10;background:var(--surface);padding:8px 14px;border-radius:8px}

.wrap{max-width:1040px;margin:0 auto;padding-inline:16px}
.narrow{max-width:720px}

/* top bar */
.topbar{padding-top:max(18px,env(safe-area-inset-top))}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px}
.brand{white-space:nowrap;display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font-weight:700;font-size:.98rem;letter-spacing:.01em}
.brand img{width:28px;height:28px;border-radius:7px}
.nav{display:flex;gap:2px;flex-wrap:nowrap;justify-content:flex-end}
.nav a{color:var(--text-dim);text-decoration:none;font-weight:600;font-size:.95rem;padding:8px 12px;border-radius:999px}
.nav a:hover{color:var(--text);background:var(--surface-2)}
.nav a[aria-current="page"]{color:var(--text);background:var(--surface)}

/* hero */
.hero{padding:clamp(28px,6vw,64px) 0 clamp(22px,4vw,36px)}
.hero h1{font-family:var(--f-display);font-weight:400;font-size:clamp(3.2rem,12vw,6rem);line-height:.92;letter-spacing:-.02em;margin:0}
.byline{margin:10px 0 0;font-family:var(--f-display);font-style:italic;font-size:clamp(1.3rem,4vw,1.7rem);color:var(--warm);line-height:1.2}
.lead{margin:16px 0 0;font-size:clamp(1.08rem,2.6vw,1.25rem);color:var(--text-dim);max-width:44ch;text-wrap:pretty}
.page-title{font-family:var(--f-display);font-weight:400;font-size:clamp(2.6rem,9vw,4.4rem);line-height:.95;letter-spacing:-.015em;margin:0}

/* app cards */
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
@media (max-width:680px){.grid{grid-template-columns:1fr;gap:16px}}
.card{position:relative;display:flex;flex-direction:column;text-decoration:none;color:inherit;background:var(--surface);border:1px solid var(--line);border-radius:20px;overflow:hidden;box-shadow:var(--shadow);transition:transform .2s ease,box-shadow .2s ease}
.card:hover{transform:translateY(-3px)}
.card .pic{aspect-ratio:4/3;background:var(--surface-2);overflow:hidden}
.card .pic img{width:100%;height:100%;object-fit:cover}
.card .pic svg{width:100%;height:100%;display:block}
.card .txt{padding:16px 18px 18px;display:flex;flex-direction:column;gap:6px;flex:1}
.card h2,.card h3{font-family:var(--f-display);font-weight:400;font-size:2rem;line-height:1;margin:0;letter-spacing:-.01em}
.card p{margin:0;color:var(--text-dim);text-wrap:pretty}
.flow{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:4px;font-size:.85rem;font-weight:600}
.flow span{background:var(--surface-2);border-radius:999px;padding:3px 10px;color:var(--text)}
.flow i{font-style:normal;color:var(--text-dim)}
.card .go{margin-top:auto;padding-top:10px;font-weight:700;font-size:.95rem;color:var(--c,var(--accent))}
/* app cards: the whole card opens the app, "How it works" sits on top */
.card.app h2 a{color:inherit;text-decoration:none}
.card.app .stretch::after{content:"";position:absolute;inset:0;z-index:1;border-radius:20px}
.card.app .stretch:focus-visible{outline:none}
.card.app:has(.stretch:focus-visible){outline:2px solid var(--accent);outline-offset:3px}
.card.app .actions{margin-top:auto;padding-top:10px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.card.app .actions .go{margin:0;padding:0}
.card.app .how{position:relative;z-index:2;font-size:.9rem;font-weight:600;color:var(--text-dim);text-decoration:underline;text-underline-offset:3px;padding:8px 0;min-height:40px;display:inline-flex;align-items:center}
.card.app .how:hover{color:var(--text)}
.card .label{font-size:.78rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-dim)}

/* "more projects" card */
.more{background:linear-gradient(160deg,var(--surface) 0%,var(--surface-2) 100%)}
.more .chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.more .chips span{display:inline-flex;align-items:center;gap:7px;font-size:.88rem;font-weight:600;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:4px 11px 4px 8px}
.more .chips b{width:10px;height:10px;border-radius:50%;background:var(--d)}

/* promise row */
.promise{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:28px 0 0}
@media (max-width:680px){.promise{grid-template-columns:1fr}}
.promise div{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px 16px}
.promise b{display:block;font-size:.98rem}
.promise span{color:var(--text-dim);font-size:.93rem}

/* support strip */
.support{margin:28px 0 0;display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px 18px}
.support p{margin:0;color:var(--text-dim);max-width:52ch}
.btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border-radius:999px;font-weight:700;font-size:.95rem;text-decoration:none;white-space:nowrap}
.btn.primary{background:var(--accent);color:var(--accent-ink)}
.btn.ghost{background:var(--surface-2);color:var(--text)}

/* project cards */
.projects{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
@media (max-width:680px){.projects{grid-template-columns:1fr;gap:16px}}
.project .pic{aspect-ratio:16/9}
.project .facts{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.project .facts span{font-size:.82rem;font-weight:600;background:var(--surface-2);border-radius:999px;padding:3px 10px}
.project .url{font-size:.88rem;color:var(--text-dim);overflow-wrap:anywhere}

/* prose pages (about, privacy, terms) */
.prose{padding-bottom:12px}
.prose h2{font-family:var(--f-display);font-weight:400;font-size:clamp(1.7rem,5vw,2.1rem);line-height:1.1;margin:36px 0 10px}
.prose h3{font-size:1.05rem;margin:22px 0 6px}
.prose p,.prose li{max-width:66ch;text-wrap:pretty}
.prose ul,.prose ol{padding-left:1.25em}
.prose li{margin:6px 0}
.prose .meta{color:var(--text-dim);font-size:.95rem}
.box{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px 18px;margin:16px 0}
.box p{margin:0}
.credits{display:grid;gap:10px}
.credits div{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 16px}
.credits b{display:block}
.credits span{color:var(--text-dim);font-size:.94rem}

section.block{margin-top:clamp(40px,7vw,64px)}
.section-head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.section-head h2{font-family:var(--f-display);font-weight:400;font-size:clamp(2rem,6vw,2.8rem);line-height:1;margin:0}
.section-head p{margin:0;color:var(--text-dim)}

/* footer */
.foot{margin-top:clamp(48px,8vw,80px);border-top:1px solid var(--line);padding:22px 0 max(32px,env(safe-area-inset-bottom))}
.foot .wrap{display:grid;gap:10px}
.foot nav{display:flex;flex-wrap:wrap;gap:4px 16px}
.foot nav a{color:var(--text);text-decoration:none;font-weight:600;font-size:.95rem}
.foot nav a:hover{text-decoration:underline}
.foot p{margin:0;color:var(--text-dim);font-size:.88rem}
.foot p a{color:inherit}

@media (max-width:420px){
  .brand{font-size:.9rem;gap:8px}
  .brand img{width:24px;height:24px}
  .nav a{padding:8px 8px;font-size:.9rem}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
