/* GrapheneOS Pixel launcher — pure AMOLED black & white */

:root {
  --bg: #000000;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --icon: #2c2c2c;
  --icon-press: #3a3a3a;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --hairline: rgba(255, 255, 255, 0.08);
  --dock: rgba(22, 22, 22, 0.62);
  --label: 11px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --status-pad: env(safe-area-inset-top, 20px);
  --nav-pad: env(safe-area-inset-bottom, 10px);
  --icon-size: 58px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh;
  background: #000;
  color: var(--fg);
  font-family: Roboto, "Noto Sans", "SF Pro Text", "SF Pro Display",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
  color-scheme: dark;
}

button, input {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ========== Boot screen ========== */

.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding-bottom: 4vh;
  transition: opacity 0.7s ease;
}

.boot.fade {
  opacity: 0;
  pointer-events: none;
}

.boot-mark {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  animation: breathe 2.4s ease-in-out infinite;
  will-change: opacity, transform;
}

.boot-logo {
  width: 112px;
  height: 112px;
  display: block;
}

.boot-wordmark {
  color: #ffffff;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-stretch: condensed;
  font-synthesis: none;
  transform: scaleX(0.96);
  line-height: 1;
}

@keyframes breathe {
  0%, 100% { opacity: 0.78; transform: scale(0.985); }
  50% { opacity: 1; transform: scale(1); }
}

/* ========== OS chrome ========== */

.os {
  position: fixed;
  inset: 0;
  background: #000000;
  overflow: hidden;
}

.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 18px 6px;
  padding-top: max(var(--status-pad), 14px);
  height: calc(max(var(--status-pad), 14px) + 28px);
  color: #fff;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.status-left {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 54px;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-right .sig {
  width: 17px;
  height: 13px;
  fill: #fff;
}

.status-right .wifi-ic {
  width: 16px;
  height: 16px;
  fill: #fff;
}

#batt-pct {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.batt {
  display: flex;
  align-items: center;
}

.batt-body {
  width: 22px;
  height: 11px;
  border: 1.35px solid #fff;
  border-radius: 2.5px;
  padding: 1.4px;
  display: flex;
  align-items: stretch;
}

.batt-fill {
  display: block;
  width: 84%;
  background: #fff;
  border-radius: 0.8px;
}

.batt-nub {
  width: 1.6px;
  height: 5px;
  background: #fff;
  border-radius: 0 1px 1px 0;
  margin-left: 1px;
  opacity: 0.95;
}

/* ========== Homescreen ========== */

.homescreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: calc(max(var(--status-pad), 14px) + 36px);
  padding-bottom: calc(88px + var(--nav-pad));
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 22px;
  column-gap: 4px;
  padding: 8px 16px 0;
  align-content: start;
}

.home-spacer { flex: 1; }

.icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
}

.icon-blob {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 30%;
  background: var(--icon);
  display: grid;
  place-items: center;
  color: #f5f5f5;
  transition: transform 0.12s var(--ease), background 0.12s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.icon-btn:active .icon-blob {
  transform: scale(0.9);
  background: var(--icon-press);
}

.icon-blob svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.icon-label {
  font-size: var(--label);
  font-weight: 400;
  color: #e8e8e8;
  letter-spacing: 0.01em;
  line-height: 1.15;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Dock — glass, no labels */

.dock {
  margin: 0 18px 6px;
  height: 74px;
  border-radius: 28px;
  background: var(--dock);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.04) inset;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  justify-items: center;
  padding: 0 8px;
}

.dock .icon-btn { gap: 0; }

.dock .icon-blob {
  width: 54px;
  height: 54px;
}

.dock .icon-blob svg {
  width: 26px;
  height: 26px;
}

/* ========== App drawer ========== */

.drawer {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.drawer.open { pointer-events: auto; }

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.drawer.open .drawer-scrim { opacity: 1; }

.drawer-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(max(var(--status-pad), 14px) + 20px);
  background: rgba(8, 8, 8, 0.94);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(110%);
  transition: transform 0.48s var(--ease);
  overflow: auto;
  padding: 10px 16px calc(28px + var(--nav-pad));
  overscroll-behavior: contain;
}

.drawer.open .drawer-sheet { transform: translateY(0); }

.drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  margin: 6px auto 16px;
}

.drawer-title {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 22px;
}

/* ========== Gesture nav ========== */

.nav-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(18px + var(--nav-pad));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
}

.home-handle {
  width: 108px;
  height: 4px;
  border-radius: 4px;
  background: #fff;
  opacity: 0.92;
}

/* ========== App windows ========== */

.app-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.app-layer.active { pointer-events: auto; }

.app-screen {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transform: scale(0.94) translateY(8px);
  transition: opacity 0.28s ease, transform 0.38s var(--ease);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  padding-top: calc(max(var(--status-pad), 14px) + 28px);
  padding-bottom: calc(18px + var(--nav-pad));
}

.app-screen.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.app-screen[data-app="camera"] {
  padding: 0;
}

.app-top {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
}

.app-top-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.app-top svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.app-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.app-body.scroll {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 8px 24px;
}

.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  fill: #3a3a3a;
}

.empty-state p {
  margin: 0;
  color: #cfcfcf;
  font-size: 15px;
}

.dim { color: var(--muted); font-size: 13px; }
.tiny { font-size: 12px; margin-top: 10px; }

/* Phone */

.phone-app { display: flex; flex-direction: column; }
.phone-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px 12px 10px;
  gap: 4px;
}
.phone-tab {
  font-size: 13px;
  color: var(--muted);
  padding: 8px;
  border-bottom: 2px solid transparent;
}
.phone-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}
.phone-panel { display: none; flex: 1; }
.phone-panel.on { display: flex; flex-direction: column; }

.dial-display {
  min-height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 34px;
  letter-spacing: 0.04em;
  font-weight: 400;
  padding: 8px 20px 4px;
  word-break: break-all;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 18px;
  padding: 8px 28px 8px;
  flex: 1;
  align-content: center;
}

.key {
  height: 62px;
  border-radius: 50%;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 400;
}
.key small {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: -2px;
}
.key:active { background: #2a2a2a; }

.call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f2f2f2;
  color: #000;
  display: grid;
  place-items: center;
  margin: 8px auto 12px;
}
.call-btn svg { width: 26px; height: 26px; fill: #000; }
.call-btn:active { transform: scale(0.94); }

.in-call {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}
.in-call-num { font-size: 32px; letter-spacing: 0.04em; }
.in-call-sub { color: var(--muted); }
.in-call-actions { display: flex; gap: 18px; margin-top: 48px; }
.ic-act {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1c1c1c;
  font-size: 12px;
  color: #fff;
}
.ic-act.end { background: #f0f0f0; color: #000; }

/* Messages */

.msg-list { padding: 4px 0; }
.msg-row {
  width: 100%;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  text-align: left;
}
.msg-row:active { background: #141414; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2a2a2a;
  display: grid;
  place-items: center;
  font-weight: 500;
}
.msg-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg-from { font-size: 15px; }
.msg-preview {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-time { font-size: 11px; color: var(--muted); }

.thread {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
}
.thread-top {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 17px;
  font-weight: 500;
}
.icon-hit {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.icon-hit svg { width: 22px; height: 22px; fill: #fff; }
.thread-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  background: #1c1c1c;
  font-size: 15px;
  line-height: 1.4;
  align-self: flex-start;
}

/* Camera */

.camera-app {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}
#cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}
.cam-top {
  position: absolute;
  top: calc(max(var(--status-pad), 14px) + 32px);
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #d0d0d0;
  z-index: 2;
}
.cam-modes {
  position: absolute;
  bottom: calc(118px + var(--nav-pad));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #777;
  z-index: 2;
}
.cam-modes .on { color: #fff; }
.cam-controls {
  position: absolute;
  bottom: calc(28px + var(--nav-pad));
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 2;
  padding: 0 28px;
}
.cam-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  justify-self: start;
  overflow: hidden;
  background-size: cover;
}
.shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 0 0 0 3px #000, 0 0 0 4px #fff;
  justify-self: center;
}
.shutter:active { transform: scale(0.92); }
.cam-switch {
  width: 44px;
  height: 44px;
  justify-self: end;
  color: #fff;
}
.cam-switch svg { width: 26px; height: 26px; }
.cam-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.cam-flash.pop { animation: flash 0.28s ease; }
@keyframes flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Vanadium */

.v-chrome { flex-shrink: 0; }
.v-bar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 8px 8px 10px;
  gap: 4px;
}
.v-bar svg { width: 20px; height: 20px; fill: #ddd; justify-self: center; }
.v-url {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 24px;
  height: 40px;
  padding: 0 14px;
}
.v-url svg { width: 16px; height: 16px; fill: #888; }
.v-url input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: #fff;
  font-size: 14px;
  min-width: 0;
}
.v-page { flex: 1; overflow: auto; }
.v-ntp {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18vh;
  gap: 10px;
}
.v-mark { width: 56px; height: 56px; }
.v-ntp h1 { margin: 8px 0 0; font-size: 22px; font-weight: 500; }
.v-ntp p { margin: 0; color: var(--muted); font-size: 13px; }
.v-result {
  padding: 20px 22px;
  line-height: 1.55;
}
.v-result h2 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
.v-result p { margin: 0; color: #bdbdbd; font-size: 14px; }

/* Settings */

.set-search {
  margin: 4px 10px 14px;
  height: 42px;
  border-radius: 22px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.set-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 14px 12px;
  text-align: left;
  border-radius: 12px;
}
.set-row:active { background: #141414; }
.set-row .si {
  width: 22px;
  height: 22px;
  fill: #eaeaea;
}
.set-row .st { font-size: 16px; }
.set-row .sd { font-size: 12px; color: var(--muted); margin-top: 2px; }
.set-row .chev { color: #555; font-size: 18px; }
.set-group { height: 10px; }

/* Files / repo */

.files-head {
  padding: 18px 12px 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.file-row, .repo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  font-size: 15px;
}
.file-row .dim, .repo-item .dim { margin-left: auto; }
.file-ic { width: 28px; text-align: center; opacity: 0.7; }
.storage-bar {
  margin: 4px 12px 0;
  height: 6px;
  background: #222;
  border-radius: 4px;
  overflow: hidden;
}
.storage-bar span { display: block; height: 100%; background: #d0d0d0; }
.storage-cap { padding: 8px 12px 0; }

.repo-lead {
  padding: 8px 12px 4px;
  color: var(--muted);
  font-size: 13px;
}
.pill {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  padding: 4px 10px;
  color: #cfcfcf;
}
.pill.ghost { color: #888; }

/* Clock */

.clock-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.clock-face { width: 220px; height: 220px; }
.clock-digital {
  text-align: center;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.clock-date {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.clock-tabs {
  display: flex;
  gap: 22px;
  margin-top: 28px;
  font-size: 13px;
  color: #666;
  letter-spacing: 0.04em;
}
.clock-tabs .on { color: #fff; }

/* Calculator */

.calc {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 8px;
}
.calc-expr {
  min-height: 22px;
  text-align: right;
  color: var(--muted);
  font-size: 14px;
  padding: 0 12px;
}
.calc-display {
  text-align: right;
  font-size: 56px;
  font-weight: 300;
  padding: 4px 12px 16px;
  letter-spacing: -0.02em;
  overflow: hidden;
}
.calc-pad {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 10px;
}
.calc-key {
  border-radius: 50%;
  background: #1a1a1a;
  font-size: 26px;
  font-weight: 400;
}
.calc-key.op { background: #2a2a2a; }
.calc-key.eq { background: #f0f0f0; color: #000; }
.calc-key:active { filter: brightness(1.25); }

/* Gallery */

.gal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px 4px 0;
}
.gal-cell {
  aspect-ratio: 1;
  background: #1a1a1a;
}

/* Auditor / Seedvault */

.auditor, .seedvault {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px;
  text-align: center;
  overflow: auto;
}
.auditor-shield, .seed-ic {
  width: 64px;
  height: 64px;
  fill: #f0f0f0;
  margin-bottom: 8px;
}
.auditor h2, .seedvault h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  font-weight: 500;
}
.qr-box {
  width: 168px;
  height: 168px;
  margin: 22px 0;
  background:
    linear-gradient(#fff 0 0) 0 0 / 12px 12px no-repeat,
    linear-gradient(#fff 0 0) 100% 0 / 12px 12px no-repeat,
    linear-gradient(#fff 0 0) 0 100% / 12px 12px no-repeat,
    linear-gradient(#fff 0 0) 100% 100% / 12px 12px no-repeat,
    repeating-linear-gradient(90deg, #111 0 8px, #d8d8d8 8px 10px),
    repeating-linear-gradient(#111 0 8px, #d8d8d8 8px 10px);
  background-blend-mode: lighten;
  filter: grayscale(1) contrast(1.2);
  border: 8px solid #fff;
}
.btn-outline, .btn-fill {
  margin-top: 8px;
  height: 44px;
  padding: 0 28px;
  border-radius: 22px;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.btn-outline { border: 1px solid #4a4a4a; }
.btn-fill { background: #f2f2f2; color: #000; font-weight: 500; }
.seed-card {
  width: 100%;
  background: #121212;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 8px 16px;
  margin: 22px 0 10px;
}
.seed-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 14px;
  border-bottom: 1px solid #1c1c1c;
}
.seed-row:last-child { border: 0; }
.toggle {
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: #333;
  position: relative;
  display: inline-block;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #bbb;
  transition: transform 0.2s var(--ease);
}
.toggle.on { background: #eaeaea; }
.toggle.on::after { transform: translateX(14px); background: #111; }

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .boot-mark { animation: none; }
  .boot, .app-screen, .drawer-sheet, .drawer-scrim, .icon-blob {
    transition: none;
  }
}
