/* ============================================================
   FRWDEPLOY OS — stylesheet
   ============================================================ */

:root {
  --bg: #0a0a14;
  --bg-2: #0e0e1f;
  --surface: rgba(22, 22, 38, 0.72);
  --surface-solid: #15152a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f7;
  --muted: #9aa0b4;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-3: #ff5c8a;
  --green: #28c840;
  --yellow: #febc2e;
  --red: #ff5f57;
  --radius: 14px;
  --shadow: 0 24px 70px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);
  --menubar-h: 38px;
  --dock-h: 78px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: relative;
  user-select: none;
}

/* ---------- Wallpaper ---------- */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, #161636 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, #1a1030 0%, transparent 50%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 22s ease-in-out infinite;
}
.blob-1 { width: 50vw; height: 50vw; left: -10vw; top: -10vw; background: #5b3cff; }
/* Film grain — the single cheapest thing that reads as "premium" */
.wallpaper::after {
  content: ""; position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  opacity: 0.22; mix-blend-mode: overlay; pointer-events: none;
  animation: grainShift 750ms steps(3) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  33%  { transform: translate(-1.5%, 1%); }
  66%  { transform: translate(1%, -1.5%); }
  100% { transform: translate(0,0); }
}
.blob-2 { width: 45vw; height: 45vw; right: -8vw; bottom: -12vw; background: #007a99; animation-delay: -7s; }
.blob-3 { width: 35vw; height: 35vw; left: 45%; top: 35%; background: #b1326b; animation-delay: -14s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4vw, 5vh) scale(1.1); }
  66% { transform: translate(-3vw, -4vh) scale(0.95); }
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 75%);
}

/* ---------- Menu bar ---------- */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--menubar-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.menubar-left { display: flex; align-items: center; gap: 14px; }
.logo-mark { color: var(--accent); font-size: 15px; }
.brand { font-weight: 800; letter-spacing: -0.01em; }
.menu-items { display: flex; gap: 4px; }
.menu-item {
  background: none; border: 0; color: var(--muted);
  font: inherit; cursor: pointer; padding: 4px 10px; border-radius: 7px;
  transition: 0.18s;
}
.menu-item:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.menubar-right { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.menubar-hint { font-size: 11.5px; opacity: 0.8; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(40, 200, 64, 0.6); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(40,200,64,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(40,200,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(40,200,64,0); }
}
.clock { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--text); }

/* ---------- Desktop ---------- */
.desktop {
  position: fixed;
  inset: var(--menubar-h) 0 0 0;
  z-index: 1;
}

/* ---------- Hero ---------- */
.hero {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex; justify-content: center;
  padding: clamp(16px, 3vh, 34px) 22px 118px;
  transition: opacity 0.45s, transform 0.45s, visibility 0.45s;
  -webkit-overflow-scrolling: touch;
}
.hero.hidden { opacity: 0; visibility: hidden; transform: scale(0.99); pointer-events: none; }

.launchpad {
  width: 100%; max-width: 1180px;
  margin: auto 0;
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.lp-head { text-align: center; max-width: 620px; margin: 0 auto 24px; }
.hero-kicker {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600;
  padding: 5px 13px; border: 1px solid var(--border-strong); border-radius: 100px;
  margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(28px, 4.2vw, 42px); line-height: 1.06;
  letter-spacing: -0.035em; font-weight: 800; margin-bottom: 12px;
  text-wrap: balance;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 520px; margin: 0 auto; text-wrap: pretty; }


/* ---- Hero identity ---- */
.hero-name {
  display: block; font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 700; margin-bottom: 14px;
}
.hero-disc {
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  color: var(--muted); letter-spacing: 0.02em; margin-bottom: 14px;
}
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.pc-num {
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; font-weight: 600;
  color: var(--w-accent); border: 1px solid color-mix(in oklab, var(--w-accent) 40%, transparent);
  padding: 2px 6px; border-radius: 5px;
}
.flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px;
}
.flow span {
  font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 7px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 34%, transparent);
}
.flow i { color: var(--muted); font-style: normal; font-size: 11px; }

/* ============================================================
   Bento widget grid
   ============================================================ */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 172px;
  grid-auto-flow: dense;
  gap: 14px;
}

.project-card {
  --w-accent: var(--card-accent, var(--accent));
  position: relative; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  container-type: inline-size;
  background:
    radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%),
      color-mix(in oklab, var(--w-accent) 20%, transparent), transparent 62%),
    linear-gradient(168deg, rgba(30,30,52,0.82), rgba(16,16,30,0.92));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 18px;
  cursor: pointer; color: var(--text); font: inherit;
  box-shadow:
    0 1px 1px rgba(0,0,0,0.28), 0 4px 8px rgba(0,0,0,0.24),
    0 12px 26px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.07);
  transition:
    transform 0.4s cubic-bezier(0.16,1,0.3,1),
    border-color 0.3s, box-shadow 0.4s;
  animation: widgetIn 0.75s cubic-bezier(0.16,1,0.3,1) backwards;
}
@keyframes widgetIn {
  from { opacity: 0; transform: translateY(26px) scale(0.965); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in oklab, var(--w-accent) 60%, transparent);
  box-shadow:
    0 1px 1px rgba(0,0,0,0.28), 0 8px 16px rgba(0,0,0,0.26),
    0 26px 54px -14px color-mix(in oklab, var(--w-accent) 42%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.12);
}
.project-card:active { transform: translateY(-2px) scale(0.995); }
.project-card:focus-visible { outline: 2px solid var(--w-accent); outline-offset: 3px; }

/* Bento spans */
.project-card[data-size="lg"] { grid-column: span 2; grid-row: span 2; }
.project-card[data-size="wide"] { grid-column: span 2; }
.project-card[data-size="tall"] { grid-row: span 2; }

/* Widget head / body */
.pc-top { display: flex; align-items: center; gap: 10px; margin-bottom: auto; }
.pc-favicon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; padding: 7px;
  background:
    linear-gradient(150deg,
      color-mix(in oklab, var(--w-accent) 26%, #10101c),
      color-mix(in oklab, var(--w-accent) 8%, #0c0c16));
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.14);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff;
}
.pc-favicon img { object-fit: contain !important; border-radius: 3px !important; }
.pc-glyph { padding: 0; }
.pc-cat {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--w-accent); font-weight: 700;
}
.pc-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.015em;
  margin: 10px 0 4px;
}
.pc-tagline {
  font-size: 13px; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.pc-host { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); opacity: 0.85; }
.pc-open {
  font-size: 12px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 9px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  transition: 0.22s;
}
.project-card:hover .pc-open {
  background: var(--w-accent); border-color: transparent; color: #fff;
}

/* Bigger type inside the large widget (container query, not viewport) */
@container (min-width: 380px) {
  .pc-title { font-size: 25px; }
  .pc-tagline { font-size: 14.5px; -webkit-line-clamp: 3; }
  .pc-favicon { width: 46px; height: 46px; border-radius: 13px; }
}

/* ---- Widget visuals ---- */
.pc-visual { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.project-card > *:not(.pc-visual) { position: relative; z-index: 1; }

/* Poster (video widget) with slow Ken Burns */
.pc-poster {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.06);
  animation: kenburns 26s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1.06) translate3d(0,0,0); }
  to   { transform: scale(1.16) translate3d(-1.5%, -1.5%, 0); }
}
.pc-scrim.soft {
  background: linear-gradient(to top, rgba(10,10,20,0.92) 8%, rgba(10,10,20,0.55) 38%, transparent 68%);
}
.pc-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,16,0.95) 22%, rgba(8,8,16,0.35) 62%, rgba(8,8,16,0.15));
}
.pc-play {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: color-mix(in oklab, var(--w-accent) 88%, black);
  box-shadow: 0 8px 22px -6px color-mix(in oklab, var(--w-accent) 75%, transparent);
}
.project-card:hover .pc-play { animation: pulseRing 1.6s ease-out infinite; }
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--w-accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Step-sequencer visual (CookUp) */
.pc-seq {
  position: absolute; inset: auto 0 0 0; height: 66%;
  display: grid; grid-template-columns: repeat(16, 1fr);
  grid-template-rows: 100%;           /* definite row so bar %heights resolve */
  gap: 3px; padding: 0 16px 14px; align-items: end; opacity: 0.42;
}
.pc-seq i {
  display: block; border-radius: 3px;
  height: var(--h, 30%); align-self: end; min-height: 6px;
  background: linear-gradient(to top, var(--w-accent), color-mix(in oklab, var(--w-accent) 25%, transparent));
  animation: seqPulse 1.9s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.075s);
  transform-origin: bottom;
}
@keyframes seqPulse {
  0%, 100% { transform: scaleY(0.35); opacity: 0.45; }
  50%      { transform: scaleY(1);    opacity: 1; }
}


/* Payment rails (Loaded.Pay) — dots travelling along lines read as money
   moving, which is the product. Distinct from the sequencer on purpose. */
.pc-flow {
  position: absolute; inset: auto 0 0 0; height: 62%;
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 12%; padding: 0 0 15%; opacity: 0.62;
}
.pc-flow i {
  position: relative; display: block; height: 1px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in oklab, var(--w-accent) 40%, transparent) 18%,
    color-mix(in oklab, var(--w-accent) 40%, transparent) 82%,
    transparent);
}
.pc-flow i b {
  position: absolute; top: 50%; left: 0;
  width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--w-accent);
  box-shadow: 0 0 9px var(--w-accent);
  animation: railFlow 3.4s linear infinite;
  animation-delay: calc(var(--i) * -0.62s);
}
@keyframes railFlow {
  0%   { left: 10%;  opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 90%;  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-flow i b { animation: none; left: 50%; }
}

/* EQ bars (music widget) */
.pc-eq {
  position: absolute; inset: auto 0 0 0; height: 54%;
  display: flex; align-items: flex-end; gap: 4px;
  padding: 0 18px 14px; opacity: 0.55;
}
.pc-eq i {
  flex: 1; border-radius: 3px 3px 0 0; height: 100%;
  background: linear-gradient(to top, var(--w-accent), transparent);
  transform-origin: bottom; transform: scaleY(0.25);
  animation: eqBar 1.25s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.11s);
}
@keyframes eqBar {
  0%, 100% { transform: scaleY(0.22); }
  50%      { transform: scaleY(0.95); }
}

/* Live status pill */
.pc-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-left: auto;
}
.pc-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 0 rgba(40,200,64,0.6);
  animation: pulse 2.4s infinite;
}

.lp-actions {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-top: 30px; text-align: center;
}
.lp-hint { color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 12px 22px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: 0.18s; color: var(--text);
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), #6346e0);
  box-shadow: 0 10px 26px -10px var(--accent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px var(--accent); }
.btn-ghost { background: rgba(255,255,255,0.05); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }

/* ---------- Windows ---------- */
.window-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.win {
  position: absolute;
  width: 720px; height: 480px;
  min-width: 300px; min-height: 220px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  animation: winOpen 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
@keyframes winOpen { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: none; } }
.win.focused { box-shadow: 0 32px 90px -20px rgba(0,0,0,0.85), 0 0 0 1px var(--accent); }
.win.minimizing { animation: winMin 0.28s forwards; }
@keyframes winMin { to { opacity: 0; transform: scale(0.6) translateY(40vh); } }
.win.closing { animation: winClose 0.22s forwards; }
@keyframes winClose { to { opacity: 0; transform: scale(0.9); } }
.win.maximized {
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  border-radius: 0; border: 0;
}

.win-chrome {
  display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 14px; flex-shrink: 0;
  background: linear-gradient(180deg, #1c1c34, #16162a);
  border-bottom: 1px solid var(--border);
  cursor: grab;
}
.win-chrome:active { cursor: grabbing; }
.traffic { display: flex; gap: 8px; flex-shrink: 0; }
.light {
  width: 13px; height: 13px; border-radius: 50%; border: 0; cursor: pointer;
  position: relative; transition: 0.15s;
}
.light.close { background: var(--red); }
.light.min { background: var(--yellow); }
.light.max { background: var(--green); }
.light:hover { filter: brightness(1.15); transform: scale(1.08); }

.omnibox {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: 9px; min-width: 0;
  font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted);
}
.omnibox .lock { font-size: 9px; opacity: 0.7; }
.omnibox .url { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #c9cee0; }
.omni-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 5px; transition: 0.15s; line-height: 1;
}
.omni-btn:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.omni-btn.refresh:active { transform: rotate(180deg); }
/* Window tools: viewport toggle + info */
.win-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.viewport-toggle {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 9px;
}
.viewport-toggle button {
  display: grid; place-items: center; width: 26px; height: 22px;
  border: 0; border-radius: 6px; background: none; color: var(--muted);
  cursor: pointer; transition: 0.15s;
}
.viewport-toggle button:hover { color: var(--text); }
.viewport-toggle button.vp-active { background: var(--accent, #7c5cff); color: #fff; }
.tool-btn {
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(0,0,0,0.25); color: var(--muted); cursor: pointer; transition: 0.15s;
}
.tool-btn:hover { color: var(--text); border-color: var(--border-strong); }
.tool-btn.is-active { background: var(--accent, #7c5cff); color: #fff; border-color: transparent; }

.win-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.viewport {
  position: relative; width: 100%; height: 100%;
  display: flex; justify-content: center;
  background:
    radial-gradient(circle at 50% 0%, #1a1a30 0%, #0c0c16 70%);
  transition: background 0.3s;
}
.viewport[data-vp="tablet"], .viewport[data-vp="mobile"] { padding: 14px 0; }
.win-frame {
  width: 100%; height: 100%; border: 0; display: block; background: #fff;
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s;
}
.viewport[data-vp="tablet"] .win-frame {
  width: min(800px, 100%); height: 100%; border-radius: 8px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.7);
}
.viewport[data-vp="mobile"] .win-frame {
  width: min(390px, 100%); height: 100%; border-radius: 14px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.8);
}

/* --- Fit & zoom -----------------------------------------------------------
   Some embedded apps (CookUp's DAW) have a UI that simply does not exist below
   a desktop width — on a phone you get the top-left corner and no way out. Fit
   mode renders the app at its real canvas size and scales the whole thing down
   so it's all on screen, then lets you pinch back into any part of it.
   The stage is inert until .is-fit, so every other site is untouched.
   ------------------------------------------------------------------------- */
.vp-pan { width: 100%; height: 100%; display: flex; justify-content: center; }

.viewport.is-fit { padding: 0; display: block; overflow: hidden; touch-action: none; }
.viewport.is-fit .vp-pan {
  position: absolute; top: 0; left: 0; display: block;
  width: auto; height: auto;
  transform-origin: 0 0;
  will-change: transform;
}
/* Snapping back to Fit is animated; a live pinch must not be. */
.viewport.is-fit .vp-pan.is-eased { transition: transform 0.28s cubic-bezier(0.16,1,0.3,1); }
.viewport.is-fit .win-frame {
  width: 100%; height: 100%; border-radius: 0; box-shadow: none; transition: none;
}

.vp-grab {
  position: absolute; inset: 0; z-index: 3;
  touch-action: none; cursor: grab;
  background: transparent;
}
.vp-grab:active { cursor: grabbing; }

.vp-zoom {
  position: absolute; z-index: 4;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 11px;
  background: rgba(10,10,20,0.82);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
  font-size: 12px;
}
.vp-zoom button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 0; border-radius: 8px; background: none;
  color: var(--muted); font: inherit; font-weight: 600;
  cursor: pointer; transition: 0.15s;
}
.vp-zoom button:hover { color: var(--text); background: rgba(255,255,255,0.09); }
.vp-zoom .vz-pct {
  min-width: 46px; text-align: center; color: var(--muted);
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.vp-zoom .vz-mode {
  margin-left: 2px; padding: 0 10px;
  background: rgba(255,255,255,0.07); color: var(--text);
}
.vp-zoom .vz-mode.is-on { background: var(--accent, #7c5cff); color: #fff; }
.win-loader {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--surface-solid); color: var(--muted); font-size: 13px;
  transition: opacity 0.3s;
}
.win-loader.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Info panel (slides in over the frame) */
.win-info {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 5;
  width: min(340px, 86%);
  background: rgba(16, 16, 30, 0.86);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-left: 1px solid var(--border-strong);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16,1,0.3,1);
}
.win-info.open { transform: none; }
.win-info[hidden] { display: flex; }
.info-close {
  position: absolute; top: 12px; right: 14px; width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,0.05);
  color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; transition: 0.15s;
}
.info-close:hover { color: var(--text); background: rgba(255,255,255,0.12); }
.info-cat {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; color: var(--accent, var(--accent-2));
}
.info-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.info-summary { font-size: 14px; line-height: 1.65; color: var(--muted); }
.info-role {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  padding: 5px 11px; border-radius: 100px; margin: -4px 0 2px;
  color: var(--text);
  background: color-mix(in oklab, var(--accent) 20%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
}
.info-role::before { content: "◆"; font-size: 9px; color: var(--accent); }
.info-role[hidden] { display: none; }
.info-block { margin-top: 4px; }
.info-label {
  display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 9px;
}
.info-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.info-tags span {
  font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 100px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text);
}
.info-visit { margin-top: auto; text-align: center; }

.resize-handle {
  position: absolute; right: 0; bottom: 0; width: 20px; height: 20px;
  cursor: nwse-resize; z-index: 4;
  background: linear-gradient(135deg, transparent 50%, var(--border-strong) 50%, var(--border-strong) 62%, transparent 62%, transparent 75%, var(--border-strong) 75%);
}

/* Drag state: cover iframes so pointer events keep flowing to JS */
body.dragging iframe { pointer-events: none; }
body.dragging { cursor: grabbing; }

/* ---------- Dock ---------- */
.dock {
  position: fixed;
  bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 900;
  max-width: calc(100vw - 24px);
}
.dock-inner {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 14px;
  background: rgba(20, 20, 36, 0.6);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.dock-inner::-webkit-scrollbar { display: none; }
.dock-item {
  position: relative; flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-solid);
  cursor: pointer; transition: transform 0.18s cubic-bezier(0.16,1,0.3,1), border-color 0.18s;
  display: grid; place-items: center; overflow: hidden; padding: 0;
}
.dock-item img { width: 100%; height: 100%; object-fit: cover; }
.dock-item .icon-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff; }
.dock-item:hover { transform: translateY(-10px) scale(1.12); border-color: var(--accent); }
.dock-item .tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  background: #000; color: #fff; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: 0.16s; border: 1px solid var(--border);
}
.dock-item:hover .tip { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.dock-item .running {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); opacity: 0;
}
.dock-item.is-open .running { opacity: 1; }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--border); flex-shrink: 0; }
.dock-action {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px;
  border: 1px dashed var(--border-strong); background: rgba(255,255,255,0.03);
  color: var(--muted); cursor: pointer; font-size: 20px; transition: 0.18s;
}
.dock-action:hover { color: var(--text); transform: translateY(-6px); border-color: var(--accent); }

/* ---------- Sheet (About/Contact) ---------- */
.sheet { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); animation: fade 0.3s; }
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  position: relative; z-index: 1; max-width: 540px; width: 100%;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 38px; box-shadow: var(--shadow);
  animation: rise 0.4s cubic-bezier(0.16,1,0.3,1); max-height: 85vh; overflow-y: auto;
}
.sheet-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,0.05);
  color: var(--muted); font-size: 20px; cursor: pointer; transition: 0.16s; line-height: 1;
}
.sheet-close:hover { color: var(--text); background: rgba(255,255,255,0.12); }
.sheet-content h2 { font-size: 26px; margin-bottom: 14px; letter-spacing: -0.02em; }
.sheet-content p { color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.sheet-content a.inline { color: var(--accent-2); text-decoration: none; }
.sheet-content a.inline:hover { text-decoration: underline; }
.sheet-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.sheet-list li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 12px;
}
.sheet-list .badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; color: #fff; }
.sheet-list .meta { display: flex; flex-direction: column; }
.sheet-list .meta b { font-size: 14px; }
.sheet-list .meta small { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.sheet-list a { margin-left: auto; color: var(--accent-2); text-decoration: none; font-size: 13px; font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--dock-h) + 20px); left: 50%; transform: translateX(-50%) translateY(20px);
  background: #000; border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 18px; border-radius: 12px; font-size: 13px; z-index: 3000;
  opacity: 0; transition: 0.3s; pointer-events: none; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   Launchpad tabs
   ============================================================ */
.lp-tabs {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  margin: 0 auto 18px; padding: 5px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 100px; width: max-content; max-width: 100%;
}
.lp-tab {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  background: none; border: 0; cursor: pointer;
  padding: 8px 18px; border-radius: 100px; transition: 0.18s; white-space: nowrap;
}
.lp-tab:hover { color: var(--text); }
.lp-tab.is-active {
  background: linear-gradient(140deg, var(--accent), color-mix(in oklab, var(--accent) 62%, var(--accent-2)));
  color: #fff;
  box-shadow: 0 6px 18px -6px var(--accent), inset 0 1px 0 rgba(255,255,255,0.22);
}

.pc-glyph { color: #fff; }
.project-card.is-placeholder { opacity: 0.92; border-style: dashed; }

/* ============================================================
   App windows (Showreel / Studio)
   ============================================================ */
.app-titlebar {
  flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0;
  padding-left: 4px;
}
.app-glyph {
  display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 8px; background: var(--accent); color: #fff;
}
.app-name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.app-sub {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win-app .win-body { background: #0d0d18; }
.app-body { position: absolute; inset: 0; display: flex; min-height: 0; }

.media-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #16162c 0%, #0b0b14 70%);
}
.media-list {
  width: 264px; flex-shrink: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--border); background: rgba(0,0,0,0.28);
  min-height: 0;
}
.ml-head {
  padding: 14px 16px 10px; font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ml-count { color: var(--accent); }
.ml-items { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.ml-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--text);
  font: inherit; text-align: left; transition: 0.16s;
}
.ml-item:hover { background: rgba(255,255,255,0.06); }
.ml-item.is-playing { background: rgba(255,255,255,0.07); border-color: var(--accent); }
.mli-thumb {
  width: 54px; height: 34px; border-radius: 6px; flex-shrink: 0; overflow: hidden;
  background: #000; display: grid; place-items: center; color: var(--muted);
}
.mli-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mli-num {
  width: 22px; flex-shrink: 0; text-align: center; color: var(--muted);
  font-family: "JetBrains Mono", monospace; font-size: 12px;
}
.ml-item.is-playing .mli-num { color: var(--accent); }
.mli-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mli-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mli-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mli-bars { display: none; gap: 2px; align-items: flex-end; height: 13px; flex-shrink: 0; }
.ml-item.is-playing .mli-bars { display: flex; }
.mli-bars i { width: 2.5px; background: var(--accent); border-radius: 2px; height: 40%; }
.win-app.is-playing .ml-item.is-playing .mli-bars i { animation: eq 0.9s ease-in-out infinite; }
.mli-bars i:nth-child(2) { animation-delay: 0.15s; }
.mli-bars i:nth-child(3) { animation-delay: 0.3s; }
@keyframes eq { 0%,100% { height: 30%; } 50% { height: 100%; } }

/* ---- Video ---- */
.video-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden;
}
.video-el { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.media-meta {
  flex-shrink: 0; padding: 14px 18px; border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.mm-text { min-width: 0; }
.mm-cat {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.mm-title { font-size: 16px; font-weight: 700; margin: 3px 0 5px; letter-spacing: -0.01em; }
.mm-summary { font-size: 12.5px; color: var(--muted); line-height: 1.55; max-width: 62ch; }
.mm-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex-shrink: 0; max-width: 42%; }
.tool-chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border); color: var(--text);
  white-space: nowrap;
}

/* ---- Music ---- */
.music-main { justify-content: center; align-items: center; padding: 26px 30px; gap: 4px; text-align: center; }
.mp-art {
  position: relative; width: min(190px, 34vh); aspect-ratio: 1; flex-shrink: 0;
  border-radius: 18px; overflow: hidden; margin-bottom: 18px;
  background: linear-gradient(145deg, var(--accent), rgba(0,0,0,0.85));
  box-shadow: 0 24px 60px -22px var(--accent), inset 0 0 0 1px rgba(255,255,255,0.12);
  display: grid; place-items: center;
}
.mp-art-inner { position: relative; z-index: 2; display: grid; place-items: center; width: 100%; height: 100%; }
.mp-art-inner img { width: 100%; height: 100%; object-fit: cover; }
.mp-art-glyph { color: rgba(255,255,255,0.9); transform: scale(2.4); }
.mp-viz { position: absolute; inset: auto 0 0 0; width: 100%; height: 55%; z-index: 3; opacity: 0.9; }
.mp-info { min-width: 0; max-width: 46ch; }
.mp-title { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 7px; }
.music-main .mm-tools { justify-content: center; max-width: 100%; margin-top: 12px; }
.mp-controls { width: 100%; max-width: 420px; margin-top: 20px; }
.mp-seek { display: flex; align-items: center; gap: 10px; }
.mp-time { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); width: 34px; flex-shrink: 0; }
.mp-time.dur { text-align: right; }
.mp-range {
  -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.14); cursor: pointer; outline: none;
}
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; cursor: pointer;
}
.mp-range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff;
  background: var(--accent); cursor: pointer;
}
.mp-buttons { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.mp-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; transition: 0.16s;
}
.mp-btn:hover { background: rgba(255,255,255,0.14); transform: scale(1.06); }
.mp-play { width: 54px; height: 54px; background: var(--accent); border-color: transparent; }
.mp-play:hover { background: var(--accent); filter: brightness(1.1); }
.mp-play .ic-pause { display: none; }
.win-app.is-playing .mp-play .ic-play { display: none; }
.win-app.is-playing .mp-play .ic-pause { display: block; }

/* ---- Empty state ---- */
.media-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 36px 30px; gap: 10px;
}
.me-glyph {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px;
  background: var(--accent); color: #fff; margin-bottom: 6px; transform: scale(1.1);
}
.media-empty h3 { font-size: 18px; font-weight: 700; }
.media-empty p { font-size: 13.5px; color: var(--muted); line-height: 1.65; max-width: 44ch; }
.media-empty code {
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 5px; color: var(--text);
}
.me-hint { font-size: 12.5px; opacity: 0.8; }

/* ---- Dock app icons ---- */
.dock-app { border-color: transparent; }
.dock-glyph {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #fff; transform: scale(1.25);
}


/* ============================================================
   Window tabs · case study · architecture
   ============================================================ */
.win-tabs {
  display: flex; gap: 2px; flex-shrink: 0; padding: 0 12px;
  background: rgba(0,0,0,0.34); border-bottom: 1px solid var(--border);
}
.win-tabs[hidden] { display: none; }
.wt {
  position: relative; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 11px 15px; transition: color 0.18s;
}
.wt:hover { color: var(--text); }
.wt.is-active { color: var(--text); }
.wt.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
  box-shadow: 0 0 12px var(--accent);
}

.win-panel {
  position: absolute; inset: 0; z-index: 3; overflow-y: auto;
  background: radial-gradient(circle at 50% 0%, #14142a 0%, #0b0b14 72%);
  -webkit-overflow-scrolling: touch;
}
.win-panel[hidden] { display: none; }

.cs { padding: 30px 34px 40px; max-width: 780px; margin: 0 auto; }
.cs-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 26px; }
.cs-num {
  font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 500;
  color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  padding: 5px 9px; border-radius: 8px; flex-shrink: 0;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}
.cs-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; }
.cs-line { color: var(--muted); font-size: 14.5px; margin-top: 5px; }
.cs-block { margin-bottom: 24px; }
.cs-block h3 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 9px;
}
.cs-block p { font-size: 14.5px; line-height: 1.7; color: #c3c8d8; }
.cs-note {
  border-left: 2px solid color-mix(in oklab, var(--accent) 60%, transparent);
  padding: 2px 0 2px 16px;
}
.cs-list {
  list-style: none; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px 18px;
}
.cs-list li {
  font-size: 13.5px; color: #c3c8d8; padding-left: 17px; position: relative; line-height: 1.5;
}
.cs-list li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.85;
}
.cs-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cs-chips span {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 100px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text);
}
.cs-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.cs-stack-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.stack-grid { display: grid; gap: 18px; }
.stack-group {
  padding: 16px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.035); border: 1px solid var(--border);
}
.stack-label {
  display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 10px;
}

/* ---- Architecture diagram ---- */
.arch {
  padding: 34px 30px 46px; max-width: 620px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
}
.arch-layer {
  width: 100%; padding: 15px 18px; border-radius: 15px;
  background: linear-gradient(160deg, rgba(30,30,54,0.9), rgba(16,16,30,0.94));
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px -14px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.arch.run .arch-layer {
  animation: archIn 0.6s cubic-bezier(0.16,1,0.3,1) backwards;
  animation-delay: var(--d);
}
@keyframes archIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.arch-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.arch-label { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.arch-sub { font-size: 11.5px; color: var(--muted); }
.arch-nodes { display: flex; gap: 6px; flex-wrap: wrap; }
.arch-node {
  font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 500;
  padding: 5px 10px; border-radius: 7px; white-space: nowrap;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 38%, transparent);
}
.arch.run .arch-node {
  animation: nodeIn 0.5s ease backwards;
  animation-delay: calc(var(--d, 0s) + var(--nd) + 0.15s);
}
@keyframes nodeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }

/* connector with a pulse that travels downward = data movement */
.arch-link {
  position: relative; width: 2px; height: 30px; flex-shrink: 0;
  background: linear-gradient(to bottom,
    color-mix(in oklab, var(--accent) 45%, transparent),
    color-mix(in oklab, var(--accent) 12%, transparent));
}
.arch-flow {
  position: absolute; left: 50%; top: 0; width: 6px; height: 6px;
  margin-left: -3px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); opacity: 0;
}
.arch.run .arch-flow { animation: flowDown 2.1s linear infinite; }
@keyframes flowDown {
  0%   { top: -4px; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@media (max-width: 720px) {
  .win-tabs { overflow-x: auto; padding: 0 6px; }
  .wt { padding: 10px 11px; font-size: 12px; white-space: nowrap; }
  .cs { padding: 20px 18px 34px; }
  .cs-head h2 { font-size: 21px; }
  .cs-list { grid-template-columns: 1fr; }
  .arch { padding: 22px 16px 34px; }
  .arch-layer { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .arch.run .arch-flow { animation: none; opacity: 0.7; }
}


/* ============================================================
   Services app
   ============================================================ */
.svc { padding: 34px 38px 46px; max-width: 760px; margin: 0 auto; }
.svc-head { margin-bottom: 32px; }
.svc-head h2 { font-size: 27px; font-weight: 800; letter-spacing: -0.028em; }
.svc-line {
  font-size: 15.5px; color: var(--text); margin-top: 8px; font-weight: 500;
  text-wrap: pretty;
}
.svc-lede { font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 12px; }
.svc-sec { margin-bottom: 30px; }
.svc-sec h3 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 13px;
}
.svc-steps { list-style: none; display: grid; gap: 2px; }
.svc-steps li {
  display: grid; grid-template-columns: 34px 116px 1fr; align-items: baseline; gap: 10px;
  padding: 11px 12px; border-radius: 10px; transition: background 0.18s;
}
.svc-steps li:hover { background: rgba(255,255,255,0.045); }
.ss-n {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--accent); opacity: 0.85;
}
.ss-t { font-size: 13.5px; font-weight: 700; }
.ss-d { font-size: 13px; color: var(--muted); line-height: 1.5; }

.svc-method {
  padding: 18px 20px; border-radius: 14px;
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
.svc-method h3 { margin-bottom: 8px; }
.svc-method p { font-size: 14.5px; line-height: 1.65; color: #d2d6e4; }

/* Four pillars: what we are, building first. */
.svc-pillars {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.sp {
  padding: 16px 18px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.025);
  animation: spIn 0.5s cubic-bezier(0.16,1,0.3,1) backwards;
  animation-delay: calc(var(--i) * 0.07s);
}
@keyframes spIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sp-n {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--accent, #7c5cff); font-weight: 600;
}
.sp h4 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin: 4px 0 6px; }
.sp p { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.svc-buildnote {
  margin-top: 14px; font-size: 13.5px; line-height: 1.65; color: var(--muted);
  padding-left: 13px; border-left: 2px solid var(--border-strong);
}

.svc-offers {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  align-items: start;
}
.svc-offer {
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 20px 22px;
  background: linear-gradient(165deg, rgba(30,30,54,0.75), rgba(16,16,30,0.9));
  display: flex; flex-direction: column;
}
.svc-offer .so-items { flex: 1; }
.so-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.so-name { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.so-len { font-size: 12.5px; color: var(--muted); }
.so-price {
  font-family: "JetBrains Mono", monospace; font-size: 15px; font-weight: 500;
  color: var(--accent); white-space: nowrap;
  padding: 6px 12px; border-radius: 9px;
  background: color-mix(in oklab, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 36%, transparent);
}
.so-items {
  list-style: none; display: grid; gap: 8px;
  border-top: 1px solid var(--border); padding-top: 15px; margin-bottom: 18px;
}
.so-items li {
  font-size: 13.5px; color: #c6cbda; padding-left: 22px; position: relative; line-height: 1.5;
}
.so-items li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-size: 12px; font-weight: 700;
}
.so-cta { display: inline-block; text-decoration: none; }
.svc-card .pc-host { font-family: "JetBrains Mono", monospace; }

@media (max-width: 720px) {
  .svc { padding: 22px 18px 36px; }
  .svc-head h2 { font-size: 22px; }
  .svc-steps li { grid-template-columns: 26px 1fr; row-gap: 3px; }
  .ss-d { grid-column: 2; }
  .so-top { flex-direction: column; }
}


/* ============================================================
   Boot sequence
   ============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 5000;
  background: #06060c;
  display: grid; place-items: center; padding: 24px;
  transition: opacity 0.4s ease;
}
.boot[hidden] { display: none; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-inner { width: 100%; max-width: 620px; position: relative; }
.boot-log {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(11.5px, 2.6vw, 13.5px); line-height: 1.85;
  color: #8de8a6; margin: 0; white-space: pre-wrap;
}
.b-row { animation: bootLine 0.18s ease backwards; }
@keyframes bootLine { from { opacity: 0; } to { opacity: 1; } }
.b-head { color: #fff; font-weight: 700; font-size: 1.25em; letter-spacing: -0.01em; }
.b-dim { color: #5f6478; }
.b-ok { color: #8de8a6; }
.b-lede {
  color: #eef0f7; font-size: 1.12em; line-height: 1.6;
  border-left: 2px solid var(--accent); padding-left: 12px; margin: 4px 0;
}
.boot-skip {
  position: absolute; right: 0; bottom: -38px;
  font-family: "JetBrains Mono", monospace; font-size: 11.5px;
  color: #5f6478; background: none; border: 1px solid rgba(255,255,255,0.12);
  padding: 5px 12px; border-radius: 7px; cursor: pointer; transition: 0.18s;
}
.boot-skip:hover { color: var(--text); border-color: var(--border-strong); }

/* ============================================================
   Taskbar
   ============================================================ */
.taskbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-h) + 22px); z-index: 880;
  display: flex; gap: 6px; padding: 5px;
  background: rgba(16,16,30,0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: 0 14px 34px -14px rgba(0,0,0,0.8);
  max-width: calc(100vw - 24px); overflow-x: auto;
}
.taskbar[hidden] { display: none; }
.tb-item {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 11px; cursor: pointer; transition: 0.16s; white-space: nowrap;
}
.tb-item:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.tb-item.is-active { color: var(--text); background: rgba(255,255,255,0.09); }
.tb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tb-accent, var(--accent));
  box-shadow: 0 0 8px var(--tb-accent, var(--accent));
}
.tb-item.is-min { opacity: 0.6; }
.tb-item.is-min .tb-dot { box-shadow: none; opacity: 0.5; }

@media (max-width: 720px) {
  .taskbar { bottom: calc(var(--dock-h) + 14px); max-width: calc(100vw - 16px); }
  .tb-label { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .boot-log { line-height: 1.7; }
}
@media (prefers-reduced-motion: reduce) {
  .b-row { animation: none; }
}

/* ---------- Tablet ---------- */
@media (min-width: 721px) and (max-width: 1080px) {
  .lp-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 165px; }
  .project-card[data-size="lg"] { grid-column: span 2; grid-row: span 2; }
  .project-card[data-size="wide"] { grid-column: span 2; grid-row: span 1; }
  .project-card[data-size="tall"] { grid-column: span 1; grid-row: span 2; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .menubar-hint, .clock { display: none; }
  .menu-items { gap: 0; }
  .menu-item { padding: 4px 8px; font-size: 12.5px; }
  .desktop-icons { display: none; }
  .hero { padding: 18px 14px 110px; }
  .lp-grid { grid-template-columns: 1fr; gap: 12px; }
  .project-card { padding: 16px; }
  .pc-tagline { min-height: 0; }
  .win-tools .viewport-toggle { display: none; } /* the phone IS the mobile view */

  /* The taskbar chip and toasts both float over the window's bottom edge, which
     is exactly where the zoom bar lives. Stack them so nothing covers the one
     control you need to get back out of a zoom. */
  .vp-zoom { bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
  .vp-zoom button { min-width: 34px; height: 34px; }
  .toast { bottom: calc(var(--dock-h) + 132px); max-width: calc(100vw - 32px); }
  .resize-handle { display: none; }
  .win-info { width: 100%; }
  .dock-item, .dock-action { width: 46px; height: 46px; }

  /* --- media apps on phones --- */
  .lp-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(150px, auto); gap: 12px; }
  .project-card[data-size="lg"],
  .project-card[data-size="wide"],
  .project-card[data-size="tall"] { grid-column: span 1; grid-row: span 1; }
  .project-card[data-size="lg"] { min-height: 220px; }
  .lp-tabs { width: 100%; justify-content: flex-start; gap: 2px; padding: 4px; overflow-x: auto; }
  .lp-tab { flex: 1; padding: 8px 6px; font-size: 12px; text-align: center; }
  .app-body { flex-direction: column; }
  .app-sub { display: none; }
  .media-list { width: 100%; border-left: 0; border-top: 1px solid var(--border); max-height: 40%; }
  .media-meta { flex-direction: column; gap: 10px; }
  .mm-tools { max-width: 100%; justify-content: flex-start; }
  .music-main { padding: 18px; }
  .mp-art { width: min(140px, 22vh); margin-bottom: 12px; }
  .mp-controls { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .wallpaper::after, .pc-poster, .pc-seq i, .pc-eq i { animation: none !important; }
  .pc-poster { transform: scale(1.06); }
}
