/* Decoy — shared design system
   Idea: a burner phone. The site is a cheap handset you actually use: a monochrome LCD,
   a physical keypad with real dial tones, and SIM cards. Each decoy is a SIM. Sinking one snaps it. */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "LCD"; src: url("../fonts/vt323-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #e6e8e3;
  --bg-2: #d8dbd4;
  --card: #f4f5f1;
  --ink: #121416;
  --ink-2: #41464a;
  --ink-3: #757a7d;
  --line: #c4c8c0;

  /* the handset */
  --body: #26292d;
  --body-hi: #383c41;
  --body-lo: #15171a;
  --key: #3b3f44;
  --key-hi: #4a4f55;
  --key-ink: #e9ebe6;
  --lcd: #a7b597;
  --lcd-lit: #c3dca6;
  --lcd-ink: #1f2819;
  --chip: #c9a24a;
  --sim: #f2f2ee;

  --hot: #f2552c;   /* end key, sinking */
  --go: #39b565;    /* call key */

  --body-font: "Archivo", system-ui, sans-serif;
  --lcd-font: "LCD", ui-monospace, monospace;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1113;
  --bg-2: #181b1e;
  --card: #1c1f23;
  --ink: #eceee9;
  --ink-2: #b4b9b5;
  --ink-3: #7d8385;
  --line: #2d3236;
  --body: #d9dcd6;
  --body-hi: #eceee9;
  --body-lo: #a9ada6;
  --key: #c9ccc5;
  --key-hi: #e2e4de;
  --key-ink: #16181a;
  --sim: #e8e8e3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body-font); font-size: 17px; line-height: 1.55; transition: background .3s, color .3s; }
a { color: inherit; }
img, svg, canvas { display: block; }
::selection { background: var(--hot); color: #fff; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; border-radius: 3px; }

/* type: Archivo stretched wide and heavy, like the brand moulded into a phone's plastic */
.display { font-stretch: 125%; font-weight: 900; line-height: .9; letter-spacing: -.035em; margin: 0; }
.h-2 { font-stretch: 125%; font-weight: 850; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: .95; letter-spacing: -.03em; margin: 0; }
.h-3 { font-stretch: 118%; font-weight: 800; font-size: 1.3rem; line-height: 1.1; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }

/* ---------- buttons: rubber keys ---------- */
.btn {
  appearance: none; border: 0; font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.35rem; border-radius: 14px;
  background: var(--ink); color: var(--bg);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 55%, #000), 0 8px 18px -10px rgba(0,0,0,.5);
  transition: transform .06s, box-shadow .06s, background .15s;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--hot)); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 color-mix(in srgb, var(--ink) 55%, #000); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--line), 0 8px 18px -12px rgba(0,0,0,.35); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { background: var(--hot); color: #fff; box-shadow: 0 3px 0 #a8351a, 0 8px 18px -10px rgba(242,85,44,.6); }
.btn.danger:hover { background: #ff6a40; }
.btn.go { background: var(--go); color: #fff; box-shadow: 0 3px 0 #23793f; }
.btn.sm { padding: .45rem .9rem; font-size: .875rem; border-radius: 11px; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); width: 100%;
  border: 2px solid var(--line); border-radius: 12px; padding: .62rem .85rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hot); }

/* ---------- status bar (site navigation) ---------- */
.status {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem;
  padding: .55rem 1.3rem; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); font-size: .9rem;
}
.carrier { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 900; font-stretch: 125%; letter-spacing: -.02em; font-size: 1.15rem; }
.bars { display: flex; align-items: end; gap: 2px; height: 14px; }
.bars i { width: 3px; background: var(--ink); border-radius: 1px; }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 55%; } .bars i:nth-child(3) { height: 80%; } .bars i:nth-child(4) { height: 100%; opacity: .3; }
.status nav { display: flex; gap: 1.3rem; justify-content: center; }
.status nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; padding: .25rem 0; border-bottom: 2px solid transparent; }
.status nav a:hover { color: var(--ink); }
.status nav a[aria-current="page"] { color: var(--ink); border-color: var(--hot); }
.status-r { display: flex; align-items: center; gap: .6rem; }
.clock { font-family: var(--lcd-font); font-size: 1.35rem; line-height: 1; min-width: 3.2ch; text-align: right; }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--ink); cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 18px; height: 18px; }
.battery { width: 26px; height: 13px; border: 1.6px solid var(--ink); border-radius: 3px; position: relative; padding: 1.5px; }
.battery::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 5px; background: var(--ink); border-radius: 0 1px 1px 0; }
.battery i { display: block; height: 100%; width: 70%; background: var(--ink); border-radius: 1px; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .status { grid-template-columns: auto 1fr; }
  .status nav { position: absolute; top: 100%; left: .8rem; right: .8rem; flex-direction: column; gap: 0; background: var(--card); border-radius: 18px; padding: .5rem; box-shadow: 0 24px 50px -20px rgba(0,0,0,.5); display: none; }
  .status nav.open { display: flex; }
  .status nav a { padding: .85rem 1rem; border: 0; border-radius: 12px; }
  .status nav a[aria-current="page"] { background: var(--bg-2); }
  .status-r { justify-content: end; }
  .menu-btn { display: grid; }
  .battery, .status-r .open-app { display: none; }
}

/* ---------- the handset ---------- */
.stage3d { perspective: 1400px; display: grid; place-items: center; }
.phone {
  --w: 300px;
  position: relative; width: var(--w); padding: 26px 22px 28px;
  background: linear-gradient(160deg, var(--body-hi), var(--body) 38%, var(--body-lo));
  border-radius: 46px 46px 58px 58px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.35),
    0 1px 0 var(--body-lo), 0 50px 70px -30px rgba(0,0,0,.55), 0 20px 30px -20px rgba(0,0,0,.4);
  transform-style: preserve-3d; transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -12deg));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.phone::before { /* moulded side edge for thickness */
  content: ""; position: absolute; inset: 0; border-radius: inherit; transform: translateZ(-18px);
  background: var(--body-lo); box-shadow: 0 0 0 2px var(--body-lo);
}
.ph-top { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 14px; }
.ph-speaker { width: 64px; height: 7px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--body-lo) 0 3px, transparent 3px 6px); box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.ph-brand { font-stretch: 125%; font-weight: 900; font-size: .78rem; letter-spacing: .18em; color: color-mix(in srgb, var(--key-ink) 55%, transparent); }

.lcd {
  position: relative; height: 236px; border-radius: 12px; padding: 10px 12px 8px;
  background: radial-gradient(ellipse at 50% 30%, var(--lcd-lit), var(--lcd) 75%);
  color: var(--lcd-ink); font-family: var(--lcd-font); font-size: 22px; line-height: 1.05;
  box-shadow: inset 0 0 0 6px #1b1e1a, inset 0 3px 10px rgba(0,0,0,.45);
  overflow: hidden; display: grid; grid-template-rows: auto 1fr auto;
  transform: translateZ(2px);
}
.lcd::after { /* pixel grid */
  content: ""; position: absolute; inset: 6px; border-radius: 7px; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.04) 0 1px, transparent 1px 3px);
}
.lcd-status { display: flex; justify-content: space-between; font-size: 18px; padding: 2px 4px 4px; border-bottom: 2px solid rgba(31,40,25,.5); }
.lcd-body { padding: 6px 4px; overflow: hidden; }
.lcd-soft { display: flex; justify-content: space-between; font-size: 20px; padding: 2px 4px 0; }
.lcd .big { font-size: 56px; line-height: .9; }
.lcd .row { display: flex; justify-content: space-between; gap: 8px; }
.lcd .sel { background: var(--lcd-ink); color: var(--lcd-lit); margin: 0 -4px; padding: 0 4px; }
.lcd .dim { opacity: .6; }
.lcd .blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lcd.glitch .lcd-body { animation: glitch .35s steps(3) 2; }
@keyframes glitch { 0% { transform: translateX(0); filter: none; } 33% { transform: translateX(-3px); filter: contrast(2); } 66% { transform: translateX(3px) skewX(4deg); } }

.ph-nav { display: grid; grid-template-columns: 1fr 86px 1fr; gap: 10px; align-items: center; margin: 18px 0 12px; }
.ph-nav .col { display: grid; gap: 10px; }
.dpad { width: 86px; height: 86px; border-radius: 50%; position: relative; background: var(--key); box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 4px 0 var(--body-lo); }
.dpad button { position: absolute; appearance: none; border: 0; background: transparent; cursor: pointer; color: var(--key-ink); }
.dpad .up { top: 0; left: 26px; width: 34px; height: 26px; }
.dpad .down { bottom: 0; left: 26px; width: 34px; height: 26px; }
.dpad .up::after, .dpad .down::after { content: ""; position: absolute; left: 12px; top: 9px; border: 6px solid transparent; }
.dpad .up::after { border-bottom-color: currentColor; top: 4px; }
.dpad .down::after { border-top-color: currentColor; top: 10px; }
.dpad .ok { left: 22px; top: 22px; width: 42px; height: 42px; border-radius: 50%; background: var(--key-hi); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); font-family: var(--lcd-font); font-size: 18px; }
.key {
  appearance: none; border: 0; cursor: pointer; font: inherit; color: var(--key-ink);
  background: linear-gradient(180deg, var(--key-hi), var(--key)); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 4px 0 var(--body-lo), 0 6px 8px -4px rgba(0,0,0,.5);
  transition: transform .05s, box-shadow .05s;
}
.key:active, .key.down, .dpad button.down { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 var(--body-lo); }
.soft { height: 30px; border-radius: 10px 10px 16px 16px; }
.soft::after { content: ""; display: block; width: 22px; height: 3px; margin: 0 auto; border-radius: 2px; background: currentColor; opacity: .7; }
.call { height: 34px; color: #fff; background: linear-gradient(180deg, #4fd07c, var(--go)); }
.end { height: 34px; color: #fff; background: linear-gradient(180deg, #ff7a55, var(--hot)); }
.call::after, .end::after { content: ""; display: block; width: 20px; height: 7px; margin: 0 auto; border-radius: 6px 6px 2px 2px; border: 2.5px solid #fff; border-bottom: 0; }
.end::after { transform: rotate(180deg); }
.ph-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.ph-keys .key { height: 44px; display: grid; place-items: center; line-height: 1; padding-top: 2px; }
.ph-keys .key b { font-size: 1.2rem; font-weight: 750; }
.ph-keys .key small { font-size: .55rem; letter-spacing: .12em; opacity: .65; font-weight: 600; }

/* ---------- SIM card ---------- */
.sim {
  --sw: 150px;
  position: relative; width: var(--sw); aspect-ratio: 1.46; border-radius: 10px;
  background: linear-gradient(150deg, var(--sim), color-mix(in srgb, var(--sim) 86%, #000));
  clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%, 0 24%);
  color: #16181a; padding: 10px 12px; display: grid; align-content: space-between;
  box-shadow: 0 10px 20px -12px rgba(0,0,0,.5);
}
.sim .chip {
  width: 30%; aspect-ratio: 1.25; border-radius: 6px; background: linear-gradient(135deg, #e2c472, var(--chip) 60%, #a5822f);
  background-image: linear-gradient(90deg, transparent 32%, rgba(0,0,0,.25) 32% 35%, transparent 35% 65%, rgba(0,0,0,.25) 65% 68%, transparent 68%),
    linear-gradient(0deg, transparent 47%, rgba(0,0,0,.25) 47% 53%, transparent 53%), linear-gradient(135deg, #e2c472, var(--chip) 60%, #a5822f);
  margin-left: 18%;
}
.sim .sim-name { font-stretch: 118%; font-weight: 850; font-size: .85rem; line-height: 1.05; letter-spacing: -.01em; }
.sim .sim-sub { font-family: var(--mono); font-size: .58rem; opacity: .7; }
.sim.hot { background: linear-gradient(150deg, #ff7a55, var(--hot)); color: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 14px; font-size: .95rem;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 2rem); pointer-events: none;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--hot); color: #fff; }

/* touch screens: no pointer tilt, so keep the handset upright */
@media (hover: none), (pointer: coarse) {
  .phone { --rx: 0deg !important; --ry: 0deg !important; transform: none; }
  .phone::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
