:root {
  --bg: #0d0d1a;
  --card: #161625;
  --card2: #1e1e35;
  --border: #2a2a4a;
  --text: #e8e8f0;
  --muted: #8888aa;
  --accent: #6ea8fe;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(110, 168, 254, 0.12), transparent),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.3px;
}

/* Launcher grid */
.hub {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 760px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 128px;
  padding: 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tile:hover {
  transform: translateY(-4px);
  background: var(--card2);
}

.tile .ico { font-size: 30px; line-height: 1; }
.tile .tname { font-size: 18px; font-weight: 800; }
.tile .tsub { font-size: 13px; color: var(--muted); }

.tile.pixel:hover { border-color: #ff6b9d; }
.tile.shorts:hover { border-color: #3fb950; }
.tile.msg:hover { border-color: #4de8ff; }
.tile.grades:hover { border-color: #3fb950; }
.tile.friends:hover { border-color: #a371f7; }
.tile.games:hover { border-color: #ffb347; }
.tile.dash:hover { border-color: #58a6ff; }
.tile.admin:hover { border-color: #ffcc00; }
.tile.hotel:hover { border-color: #38bdf8; }
.tile.karts:hover { border-color: #ff6b9d; }
.tile.polls:hover { border-color: #ffb347; }
.tile.exams:hover { border-color: #f87171; }
.tile.bus:hover { border-color: #4de8ff; }
.tile.health:hover { border-color: #3fb950; }
.tile.money:hover { border-color: #ffcc00; }
.tile.countdowns:hover { border-color: #a371f7; }
.tile.me:hover { border-color: #58a6ff; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px;
}
.foot-link { color: var(--muted); text-decoration: none; }
.foot-link:hover { color: var(--accent); }

/* ---------- public landing page ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  text-align: center;
  padding: 56px 8px 40px;
}

.today-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 22px;
  align-items: stretch;
  padding: 22px 0 12px;
}
.today-greet {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--card), var(--card2));
  min-width: 0;
}
.today-title {
  margin: 0;
  font-size: clamp(44px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: .98;
  background: linear-gradient(120deg, var(--text), var(--accent) 64%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.today-sub {
  max-width: 480px;
  margin: 16px 0 0;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}
.today-greet .hero-cta {
  justify-content: flex-start;
}
.today-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.date-card,
.weather-card,
.vac-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
.date-card { min-height: 108px; }
.date-line {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.clock-line {
  margin-top: 6px;
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.weather-card { min-height: 136px; }
.weather-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.weather-emoji { font-size: 44px; line-height: 1; }
.weather-top strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}
.weather-top em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}
.weather-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.weather-meta span {
  padding: 4px 8px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.weather-muted { color: var(--muted); font-size: 13px; }
.vac-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vac-label { font-size: 15px; font-weight: 600; color: var(--muted); }
.vac-timer {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.hero-kicker {
  display: inline-block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.hero-name {
  margin: 0;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(120deg, #ff6b9d, #6ea8fe 60%, #4de8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tag {
  max-width: 560px;
  margin: 16px auto 0;
  font-size: clamp(15px, 2.4vw, 19px);
  line-height: 1.55;
  color: var(--muted);
}
.hero-tag strong { color: var(--text); font-weight: 700; }
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.btn-primary, .btn-ghost {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  min-width: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

.section { margin-top: 44px; }
.sec-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 0 0 18px;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.proj-card:not(.static):hover { transform: translateY(-4px); background: var(--card2); border-color: var(--accent); }
.proj-card.static { cursor: default; }
.proj-card .pico { font-size: 34px; line-height: 1; }
.proj-card .ptitle { font-size: 18px; font-weight: 800; }
.proj-card .pdesc { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.proj-card .ptags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.proj-card .ptag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}
.proj-card.static .ptag { background: var(--bg); }

/* app launcher: everyone sees the grid; tiles that need an account carry a 🔒
   badge until the visitor signs in */
#apps .tiles { max-width: none; }
.tile .lockb {
  position: absolute; top: 9px; right: 11px;
  font-size: 13px; line-height: 1; opacity: .7;
}
body.signed-in .tile .lockb { display: none; }
.apps-gate {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 22px; margin-top: 6px;
}
.apps-gate .ag-ico { font-size: 30px; line-height: 1; flex: none; }
.apps-gate .ag-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.apps-gate .ag-text strong { font-size: 16px; font-weight: 800; color: var(--text); }
.apps-gate .ag-text span { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.apps-gate .btn-primary { flex: none; }
body.signed-in .apps-gate { display: none; }

.about-compact {
  padding-top: 46px;
}

@media (max-width: 760px) {
  .bar { padding: 14px 16px; }
  .bar > span { gap: 6px !important; min-width: 0; }
  #langSw button:not(.on) { display: none; }
  #acctHost .auth-btn {
    width: 38px;
    padding: 8px !important;
    overflow: hidden;
    font-size: 0 !important;
    justify-content: center;
  }
  #acctHost .auth-btn::before {
    content: "👤";
    font-size: 16px;
  }
  .page { padding: 16px; }
  .today-hero { grid-template-columns: 1fr; }
  .today-greet { min-height: auto; padding: 26px 22px; }
  .today-greet .hero-cta {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .today-greet .hero-cta a { text-align: center; }
  .clock-line { font-size: 34px; }
  .weather-top strong { font-size: 34px; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tile { min-height: 118px; padding: 16px; }
}
