/* IAV Apps hub pages: circuit-board photo backgrounds (assets/bg-light.jpg, bg-dark.jpg) */
/* Light (default) */
:root {
  color-scheme: light;
  --bg: #E8E4D1;
  --bg-2: #F1EEE0;
  --bg-3: #DEDAC5;
  --card: rgba(250, 247, 236, 0.95);
  --card-hover: #FCFAF2;
  --sidebar: rgba(244, 241, 228, 0.92);
  --border: rgba(29, 47, 26, 0.16);
  --text: #1D2F1A;
  --muted: #5E6A5A;
  --heading: #2F6B47;
  --mark-bg: #2F6B47;
  --mark-fg: #F9F6EA;
  --live: #3F8A55;
  --soon: #C9A04A;
  --icon-bg: rgba(47, 107, 71, 0.12);
  --icon-fg: #2F6B47;
  --active: rgba(47, 107, 71, 0.10);
  --shadow: 0 1px 2px rgba(29, 47, 26, .06), 0 8px 24px rgba(29, 47, 26, .10);
  --menu-shadow: 0 12px 32px rgba(29, 47, 26, .18);
  --icon-shadow: 0 4px 12px rgba(29, 47, 26, .2);
  --tag-soon-bg: rgba(47, 107, 71, 0.14);
  --tag-soon-fg: #24543A;
  --hover-border: rgba(47, 107, 71, 0.4);
  --bg-image: url("/assets/bg-light.jpg");
  --bg-wash: transparent;    /* show the image exactly */
}
/* Dark: follows the system unless the visitor picked Light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1F292E;
    --bg-2: #26323A;
    --bg-3: #111A1F;
    --card: rgba(38, 50, 57, 0.88);
    --card-hover: #2E3C44;
    --sidebar: rgba(22, 31, 36, 0.92);
    --border: rgba(202, 230, 199, 0.14);
    --text: #F6F3D6;     /* logo cream highlight */
    --muted: #B5C4BB;
    --heading: #A3D2B1;     /* logo mint green */
    --mark-bg: #71A68C;     /* logo teal-green */
    --mark-fg: #18312E;
    --live: #A3D2B1;
    --soon: #71A68C;
    --icon-bg: rgba(163, 210, 177, 0.14);
    --icon-fg: #A3D2B1;
    --active: rgba(163, 210, 177, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .25);
    --menu-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    --icon-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    --tag-soon-bg: rgba(163, 210, 177, 0.18);
    --tag-soon-fg: #CAE6C7;
    --hover-border: rgba(163, 210, 177, 0.45);
    --bg-image: url("/assets/bg-dark.jpg");
    --bg-wash: transparent;
}
}
/* Dark: picked manually */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1F292E;
  --bg-2: #26323A;
  --bg-3: #111A1F;
  --card: rgba(38, 50, 57, 0.88);
  --card-hover: #2E3C44;
  --sidebar: rgba(22, 31, 36, 0.92);
  --border: rgba(202, 230, 199, 0.14);
  --text: #F6F3D6;     /* logo cream highlight */
  --muted: #B5C4BB;
  --heading: #A3D2B1;     /* logo mint green */
  --mark-bg: #71A68C;     /* logo teal-green */
  --mark-fg: #18312E;
  --live: #A3D2B1;
  --soon: #71A68C;
  --icon-bg: rgba(163, 210, 177, 0.14);
  --icon-fg: #A3D2B1;
  --active: rgba(163, 210, 177, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .25);
  --menu-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --icon-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --tag-soon-bg: rgba(163, 210, 177, 0.18);
  --tag-soon-fg: #CAE6C7;
    --hover-border: rgba(163, 210, 177, 0.45);
  --bg-image: url("/assets/bg-dark.jpg");
  --bg-wash: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    linear-gradient(var(--bg-wash), var(--bg-wash)) fixed,
    var(--bg) var(--bg-image) center / cover no-repeat fixed;
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }

/* ---------- Layout: app bar on top ---------- */
.layout { display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {                         /* the top app bar */
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 28px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brandlink { display: flex; align-items: center; gap: 12px; flex: none; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--mark-bg); color: var(--mark-fg);
  font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.brandlink .name { font-size: 1.2rem; font-weight: 500; }
.nav-label, .sidebar-foot { display: none; }

/* Apps dropdown */
.apps-menu { position: relative; }
.apps-menu summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 14px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 500; font-size: .95rem;
  transition: background .15s ease, border-color .15s ease;
}
.apps-menu summary::-webkit-details-marker { display: none; }
.apps-menu summary:hover, .apps-menu[open] summary { background: var(--card-hover); border-color: var(--hover-border); }
.apps-menu summary:focus-visible { outline: 2px solid var(--mark-bg); outline-offset: 2px; }
.apps-menu summary .icon { width: 24px; height: 24px; border-radius: 7px; margin-left: -6px; }
.apps-menu .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s ease; }
.apps-menu[open] .chev { transform: rotate(180deg); }

.nav {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  width: min(320px, calc(100vw - 28px));
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--menu-shadow);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px;
  transition: background .15s ease;
}
a.nav-item:hover { background: var(--active); }
a.nav-item:focus-visible { outline: 2px solid var(--mark-bg); outline-offset: -2px; }
.nav-item.muted { opacity: .72; }
.nav-item .icon { width: 36px; height: 36px; border-radius: 10px; }
.nav-item .text { min-width: 0; line-height: 1.3; }
.nav-item .title { font-weight: 500; font-size: .94rem; }
.nav-item .sub { font-size: .8rem; color: var(--muted); }
.nav-item .dot { position: absolute; right: 12px; top: 50%; margin-top: -4px; width: 8px; height: 8px; }
.nav-item.placeholder {
  justify-content: center; margin-top: 4px;
  border: 1.5px dashed var(--border); color: var(--muted); font-size: .84rem;
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-inner { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 32px; }

/* ---------- Main ---------- */
main.content-inner { padding-top: 48px; }
.hero {
  padding: 40px 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; font-weight: 600; letter-spacing: -.3px; }
.hero h1 span { color: var(--heading); }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 36em; }

.section-title {
  margin: 36px 0 14px;
  font-size: 1.3rem; font-weight: 400;
  color: var(--heading);
}
.lead { margin: -4px 0 18px; color: var(--muted); max-width: 40em; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; min-height: 76px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
a.card:hover { background: var(--card-hover); transform: translateY(-2px); border-color: var(--hover-border); }
a.card:focus-visible { outline: 2px solid var(--mark-bg); outline-offset: 2px; }
.card .text { min-width: 0; padding-right: 22px; }
.card .title { font-size: 1.02rem; font-weight: 500; }
.card .sub { font-size: .86rem; color: var(--muted); }
.card.muted { opacity: .78; }
.card .dot { position: absolute; top: 18px; right: 18px; }

/* ---------- Shared bits ---------- */
.icon {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  display: grid; place-items: center; overflow: hidden;
}
.icon img, .icon svg { width: 100%; height: 100%; display: block; }
/* Android adaptive-icon foregrounds have built-in padding; zoom them to fill the tile */
.icon img { transform: scale(1.5); }
.icon.plain { background: var(--icon-bg); color: var(--icon-fg); }
.icon.plain svg { width: 22px; height: 22px; }

.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px rgba(110, 143, 78, .2); }
.dot.soon { background: var(--soon); box-shadow: 0 0 0 3px rgba(217, 180, 106, .25); }

/* ---------- Bottom: Legal & Support + footer ---------- */
.legal {
  margin-top: auto;               /* pushes to the bottom of the page */
  padding-top: 56px;
}
.legal .section-title { margin-top: 0; }
.legal .grid { border-top: 1px solid var(--border); padding-top: 16px; }
footer.content-inner {
  padding-top: 24px; padding-bottom: 28px;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .sidebar { gap: 14px; padding: 10px 14px; }
  .brandlink .name { font-size: 1.05rem; }
  .apps-menu { position: static; }
  .nav { left: 14px; right: 14px; width: auto; top: calc(100% + 6px); }
  .content-inner { padding: 0 16px; }
  main.content-inner { padding-top: 24px; }
  .hero { padding: 28px 22px; }
}

/* Current app in the sidebar */
.nav-item[aria-current="page"] { background: var(--active); box-shadow: inset 3px 0 0 var(--mark-bg); }
/* Hero subtitle line */
.hero h1 span { display: block; font-size: .5em; font-weight: 500; margin-top: 6px; letter-spacing: 0; }

/* Compact Legal & Support */
.legal { padding-top: 40px; }
.legal .section-title {
  margin: 0 0 8px;
  font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.legal .grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 10px;
}
.legal .card {
  min-height: 0; padding: 7px 14px 7px 8px; gap: 9px;
  border-radius: 999px; box-shadow: none;
}
.legal a.card:hover { transform: none; }
.legal .card .icon { width: 26px; height: 26px; border-radius: 50%; }
.legal .card .icon.plain svg { width: 15px; height: 15px; }
.legal .card .text { padding-right: 0; }
.legal .card .title { font-size: .86rem; }
.legal .card .sub, .legal .card br { display: none; }
footer.content-inner { padding-top: 14px; padding-bottom: 18px; font-size: .78rem; }

/* Centered welcome header */
.hero { text-align: center; }
.hero p { margin-left: auto; margin-right: auto; }

/* About text: fills the main area under the welcome header */
.about {
  margin-top: 20px;
  padding: 36px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.about p { margin: 0; color: var(--text); font-size: 1.08rem; line-height: 1.8; }
.about p + p { margin-top: 1.1em; }
@media (max-width: 820px) { .about { padding: 24px 22px; } .about p { font-size: 1rem; } }

/* ---------- App lineup (home) ---------- */
.apps { margin-top: 8px; }
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.app-card {
  display: flex; align-items: center; gap: 20px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.app-card:has(.app-link):hover { background: var(--card-hover); transform: translateY(-2px); border-color: var(--hover-border); }
.app-card:has(.app-link:focus-visible) { outline: 2px solid var(--mark-bg); outline-offset: 2px; }
.app-card.muted { opacity: .8; }
.app-card.placeholder {
  justify-content: center; min-height: 116px;
  background: var(--card); box-shadow: var(--shadow); border: 1.5px dashed var(--border);
  color: var(--muted);
}
.app-icon {
  width: 72px; height: 72px; flex: none; border-radius: 18px; overflow: hidden;
  box-shadow: var(--icon-shadow);
}
.app-icon svg, .app-icon img { width: 100%; height: 100%; display: block; }
.app-icon img { transform: scale(1.5); }

/* Full-art icons (no adaptive-icon padding) are shown as-is */
.icon img.full, .app-icon img.full { transform: none; }
.app-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-name { font-size: 1.15rem; font-weight: 600; }
.app-desc { color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 6px;
  background: var(--icon-bg); color: var(--heading);
}
.tag.soon { background: var(--tag-soon-bg); color: var(--tag-soon-fg); }
@media (max-width: 720px) {
  .app-grid { grid-template-columns: 1fr; }
  .app-card { padding: 18px; gap: 16px; }
  .app-icon { width: 60px; height: 60px; border-radius: 15px; }
}

/* Inline text links */
.lead a.inline, .about a { color: var(--heading); text-decoration: underline; text-underline-offset: 2px; }

/* External-link arrow next to app names */
.ext { width: .8em; height: .8em; vertical-align: -1px; opacity: .6; margin-left: 2px; }

/* Theme button (Auto / Light / Dark) */
.theme-toggle {
  margin-left: auto; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; font-size: .88rem; font-weight: 500;
  cursor: pointer; transition: background .15s ease;
}
.theme-toggle:hover { background: var(--card-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--mark-bg); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 520px) { .theme-toggle .theme-label { display: none; } .theme-toggle { padding: 7px 9px; } }

/* 404 page */
.notfound .code { margin: 0 0 4px; font-size: 3.4rem; font-weight: 700; letter-spacing: -1px; color: var(--heading); line-height: 1; }
.btn {
  display: inline-block; margin-top: 20px; padding: 10px 20px; border-radius: 12px;
  background: var(--mark-bg); color: var(--mark-fg); font-weight: 600;
}
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* App cards: whole card clickable via the name link; Notify link sits above it */
.app-card { position: relative; }
.app-link { color: inherit; }
.app-link::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.app-link:focus-visible { outline: none; }
.notify {
  position: relative; z-index: 1; align-self: flex-start;
  margin-top: 8px; font-size: .84rem; font-weight: 600;
  color: var(--heading); text-decoration: underline; text-underline-offset: 3px;
}
.notify:hover { text-decoration-thickness: 2px; }
.notify:focus-visible { outline: 2px solid var(--mark-bg); outline-offset: 2px; border-radius: 4px; }
.apps-stats { margin: -6px 0 16px; color: var(--muted); font-size: .92rem; }

/* Logo image in the top bar */
img.mark { display: block; object-fit: cover; background: #243138; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* iOS Safari ignores fixed backgrounds; pin the image to a fixed layer instead */
@supports (-webkit-touch-callout: none) {
  body { background: var(--bg); }
  body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(var(--bg-wash), var(--bg-wash)), var(--bg) var(--bg-image) center / cover no-repeat; }
}


/* Headings that sit directly on the background photo get a solid label */
.apps .section-title, .apps-stats,
main.content-inner > .section-title, main.content-inner > .lead,
.legal .section-title {
  display: inline-block;
  background: var(--card-hover);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-shadow: none;
}
.apps .section-title, main.content-inner > .section-title {
  padding: 6px 16px; border-radius: 12px; margin-bottom: 10px;
}
.apps-stats {
  margin: 0 0 16px 10px; padding: 4px 12px; border-radius: 999px;
  vertical-align: 3px; color: var(--muted);
}
main.content-inner > .lead { padding: 10px 16px; border-radius: 12px; }
.legal .section-title { padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
@media (max-width: 520px) { .apps-stats { margin-left: 0; display: table; } }
footer.content-inner {
  width: fit-content; max-width: calc(100% - 32px);
  margin: 6px auto 18px; padding: 4px 14px; border-radius: 999px;
  background: var(--card-hover); border: 1px solid var(--border);
}
