/* ---------- tokens ---------- */
:root {
  --bg: #07070b;
  --fg: #f5f5f7;
  --muted: rgba(235, 235, 245, .6);
  --faint: rgba(235, 235, 245, .3);
  --line: rgba(255, 255, 255, .1);
  --accent: #0a84ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  --la: 135deg; /* light angle for CSS rim highlights */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -.01em;
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.i { width: 1em; height: 1em; display: block; flex: none; }
.i .s { fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(7, 7, 11, .72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: .5px solid var(--line);
}
.topbar .back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-size: 14px; }
.topbar .back:hover { color: var(--fg); }
.topbar .ttl { font-weight: 650; font-size: 16px; letter-spacing: -.02em; margin-right: auto; }
.tries {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: rgba(118, 118, 128, .24);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08);
  overflow-x: auto; max-width: 100%;
}
.tries button {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 550; white-space: nowrap;
  color: var(--muted); transition: background .25s, color .25s;
}
.tries button[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: #000; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.tries button:not([aria-pressed="true"]):hover { color: var(--fg); }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 28px;
  max-width: 1280px; margin: 0 auto; padding: 28px 20px 60px; align-items: start;
}
.notes { position: sticky; top: 84px; display: grid; gap: 14px; }
.notes .card { border: .5px solid var(--line); border-radius: 20px; padding: 18px 18px 16px; background: rgba(255, 255, 255, .03); }
.notes .eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.notes h2 { margin: 6px 0 8px; font-size: 20px; letter-spacing: -.02em; line-height: 1.2; }
.notes p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.notes ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.notes li { margin: 4px 0; }
.notes code { font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: rgba(255, 255, 255, .07); padding: 1px 5px; border-radius: 5px; color: var(--fg); }
.notes .kbd { color: var(--faint); font-size: 12px; }
.banner { border-radius: 14px; padding: 10px 14px; font-size: 13px; background: rgba(255, 159, 10, .12); color: #ffd28a; border: .5px solid rgba(255, 159, 10, .3); }
.stage { display: flex; justify-content: center; min-width: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px 16px 48px; }
  .notes { position: static; order: 2; }
}

/* ---------- controls panel (tweakers) ---------- */
.tweaks { display: grid; gap: 10px; }
.tweaks label { display: grid; grid-template-columns: 92px 1fr 42px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.tweaks output { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }
.tweaks input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- phone frame ---------- */
.phone {
  position: relative; flex: none;
  width: min(393px, calc(100vw - 40px));
  height: clamp(640px, calc(100vh - 120px), 852px);
  border-radius: 56px;
  background: #000;
  box-shadow: 0 0 0 10px #151518, 0 0 0 11.5px #3b3b40, 0 0 0 12px #0b0b0d, 0 40px 100px rgba(0, 0, 0, .7);
  margin: 12px;
  color: #fff;
}
.screen { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; isolation: isolate; }
.island { position: absolute; z-index: 200; top: 11px; left: 50%; transform: translateX(-50%); width: 122px; height: 35px; border-radius: 20px; background: #000; }
.statusbar {
  position: absolute; z-index: 150; top: 0; left: 0; right: 0; height: 54px;
  display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 44px;
  font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; pointer-events: none;
}
.statusbar .right { display: flex; gap: 6px; align-items: center; font-size: 17px; }
.battery { width: 26px; height: 12.5px; border-radius: 4px; border: 1.2px solid currentColor; opacity: .95; position: relative; padding: 1.5px; }
.battery::before { content: ""; display: block; height: 100%; width: 78%; border-radius: 1.8px; background: currentColor; }
.battery::after { content: ""; position: absolute; right: -4px; top: 3.2px; width: 2px; height: 4px; border-radius: 0 2px 2px 0; background: currentColor; opacity: .5; }
.home-indicator { position: absolute; z-index: 150; bottom: 8px; left: 50%; transform: translateX(-50%); width: 140px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .9); pointer-events: none; }
.wallpaper { position: absolute; inset: 0; background-size: cover; background-position: center; }

/* ---------- home screen ---------- */
.home-grid { position: absolute; top: 72px; left: 22px; right: 22px; display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 22px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.app span { font-size: 11.5px; font-weight: 500; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.app-ic { width: 62px; height: 62px; border-radius: 15px; display: grid; place-items: center; font-size: 32px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 0, 0, .15), 0 2px 8px rgba(0, 0, 0, .15); }
.home-dock { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 92px; border-radius: 38px; display: flex; justify-content: space-around; align-items: center; padding: 0 10px; }

/* ---------- glass base ----------
   Every glass element gets a rim highlight (::before) and inner light
   (box-shadow). The material itself — the backdrop — comes from the
   active try: either a CSS backdrop-filter below or an SVG refraction
   filter attached by liquid-glass.js as an inline style. */
.glass {
  --tint: rgba(255, 255, 255, .08);
  --rim: 1;
  --shadow: 0 8px 28px rgba(0, 0, 0, .22);
  background: var(--tint);
  box-shadow: var(--shadow),
    inset 0 .5px 0 rgba(255, 255, 255, calc(.45 * var(--rim))),
    inset 0 -.5px 0 rgba(255, 255, 255, calc(.12 * var(--rim))),
    inset 0 0 22px rgba(255, 255, 255, calc(.05 * var(--rim)));
  backdrop-filter: blur(var(--blur, 16px)) saturate(var(--sat, 180%));
  -webkit-backdrop-filter: blur(var(--blur, 16px)) saturate(var(--sat, 180%));
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(var(--la),
    rgba(255, 255, 255, calc(.75 * var(--rim))) 0%,
    rgba(255, 255, 255, calc(.12 * var(--rim))) 22%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, calc(.14 * var(--rim))) 80%,
    rgba(255, 255, 255, calc(.5 * var(--rim))) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glass.dark { --tint: rgba(0, 0, 0, .22); }
/* zero specificity so any layout class can make a glass element absolute */
:where(.glass) { position: relative; }

/* hover/press response shared by interactive glass */
.press { transition: transform .45s cubic-bezier(.2, 1.4, .4, 1), filter .3s; }
.press:active { transform: scale(1.08); }

@media (prefers-reduced-transparency: reduce) {
  .glass { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; --tint: rgba(40, 40, 44, .96); }
}
