/* ============ kufiz OS ============ */

:root {
  --bg: #0b0f0c;
  --surface: #111813;
  --border: #1f2a22;
  --text: #d7e0d9;
  --muted: #8a9a8f;
  --accent: #39ff88;
  --amber: #ffb347;
  --red: #ff5f56;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --bar-h: 34px;
  --radius: 14px;
  --radius-sm: 10px;
  --glass: rgba(14, 20, 16, 0.78);
}

:root[data-theme="amber"] { --accent: var(--amber); }
:root[data-theme="red"] { --accent: var(--red); }

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font: 16px/1.6 var(--sans);
  background:
    radial-gradient(1100px 700px at 75% 40%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%),
    radial-gradient(800px 600px at 10% 90%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--bg);
}

h1, h2, h3, button, .btn, .cmd, .ps1, pre, code { font-family: var(--mono); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.ps1 { color: var(--accent); }
.cmd { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.lg-ink { fill: #e6ede8; }
.lg-mid { fill: #8a9a8f; }
.lg-dark { fill: #4b5a51; }
.lg-hi { fill: var(--accent); }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 8px 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 44px; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 190; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: #000; transition: opacity 0.4s; }
.boot[hidden] { display: none; }
.boot.fade { opacity: 0; }
.boot-log { margin: 0 auto; width: min(100%, 560px); color: var(--accent); font-size: 15px; white-space: pre-wrap; }
.boot-hint { width: min(100%, 560px); margin: 24px auto 0; color: var(--muted); font: 13px var(--mono); }

/* ---------- wallpaper ---------- */
.wallpaper { position: fixed; inset: 0; z-index: 0; }
.wallpaper canvas { display: block; width: 100%; height: 100%; }
.wall-static { position: absolute; right: 8%; top: 50%; width: min(36vw, 420px); height: min(42vw, 490px); transform: translateY(-50%); opacity: 0.9; }
.wallpaper.live .wall-static { display: none; }

/* ---------- menu bar ---------- */
.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bar-h);
  padding: 0 10px;
  background: rgba(8, 11, 9, 0.7);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font: 13px var(--mono);
}
.menu-brand, .menu-item, .menu-ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 10px;
  background: none;
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
.menu-brand { font-weight: 700; }
.menu-brand b { color: var(--accent); font-weight: 700; }
.menu-logo { width: 16px; height: 19px; }
.menu-item { color: var(--muted); }
.menu-brand:hover, .menu-item:hover, .menu-ai:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.menu-apps { display: none; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .menu-apps { display: flex; } }
.menu-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.menu-ai { color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.menu-ai.busy .status-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.menu-clock { padding: 0 6px; color: var(--text); white-space: nowrap; }

/* ---------- desktop ---------- */
.desktop { position: fixed; inset: var(--bar-h) 0 0; z-index: 1; }
.desk-hero { position: absolute; left: 40px; bottom: 120px; max-width: 640px; pointer-events: none; }
.desk-hero h1 {
  white-space: nowrap;
  font-size: clamp(2rem, 4.4vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 20%, rgba(215, 224, 217, 0.55));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.desk-role { max-width: 52ch; margin-top: 12px; color: var(--muted); font-size: 15px; }
.founder-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 5px 14px 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, rgba(0, 0, 0, 0.3));
  font: 12px var(--mono);
}
.founder-pill strong { color: var(--accent); font-weight: 600; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--accent); animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

.desktop-icons {
  display: none; /* desktop uses the dock; phones show these as the home screen */
  position: absolute;
  top: 16px;
  right: 16px;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 88px;
  padding: 8px 4px;
  background: none;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 12px var(--mono);
  color: var(--text);
  text-shadow: 0 1px 4px #000;
  cursor: pointer;
}
.desk-icon:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.08); }

.app-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--app);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app) 26%, #18211b), #0d130f);
  border: 1px solid color-mix(in srgb, var(--app) 35%, transparent);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 16px rgba(0, 0, 0, 0.45);
}
.app-icon svg { width: 24px; height: 24px; }

.desk-footer {
  position: fixed;
  left: 16px;
  bottom: 10px;
  z-index: 2;
  color: rgba(138, 154, 143, 0.7);
  font: 11px var(--mono);
}

/* ---------- dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 6px;
  background: rgba(14, 20, 16, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.dock ul { display: flex; align-items: flex-end; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dock-btn {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 0 6px;
  background: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease-out;
}
.dock-btn:hover, .dock-btn:focus-visible { transform: translateY(-8px) scale(1.12); }
.dock-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}
.dock-btn.running::after { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dock-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  padding: 3px 8px;
  white-space: nowrap;
  background: rgba(8, 11, 9, 0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.dock-btn:hover .dock-tip, .dock-btn:focus-visible .dock-tip { opacity: 1; }

/* ---------- windows ---------- */
.windows { position: absolute; inset: 0; pointer-events: none; }
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 220px;
  overflow: hidden;
  resize: both;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: win-open 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.win[hidden] { display: none; }
.win.active { border-color: color-mix(in srgb, var(--accent) 30%, rgba(255, 255, 255, 0.1)); }
.win:focus { outline: none; }
.win.max { left: 8px !important; top: 8px !important; width: calc(100% - 16px) !important; height: calc(100% - 96px) !important; resize: none; }
.win.dragging { user-select: none; }
@keyframes win-open { from { opacity: 0; transform: scale(0.94) translateY(10px); } }

.win-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  flex: none;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: grab;
  user-select: none;
}
.win.dragging .win-bar { cursor: grabbing; }
.win-lights { display: flex; gap: 8px; width: 60px; }
.light { width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: #3a443d; }
.win.active .light-close { background: var(--red); }
.win.active .light-min { background: var(--amber); }
.win.active .light-max { background: #39d36e; }
.win-title { flex: 1; overflow: hidden; text-align: center; font: 500 13px var(--mono); color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.win.active .win-title { color: var(--text); }
.win-spacer { width: 60px; }
.win-body { flex: 1; min-height: 0; overflow: auto; padding: 22px; container-type: inline-size; }

/* ---------- shared bits ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--accent); color: var(--bg); }
.btn-solid { color: var(--bg); background: var(--accent); font-weight: 600; box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { color: var(--text); border-color: var(--border); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { padding: 2px 8px; border: 1px solid var(--amber); border-radius: 999px; color: var(--amber); font: 11px var(--mono); white-space: nowrap; }
.tag { padding: 3px 9px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; font: 12px var(--mono); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 32px; padding: 4px 14px; color: var(--muted); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ---------- about ---------- */
.about { display: grid; gap: 20px; }
.about-head { display: flex; align-items: center; gap: 16px; }
.about-logo { flex: none; width: 56px; height: 64px; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.about-name { font: 800 clamp(1.5rem, 5cqi, 2.2rem) var(--mono); letter-spacing: -0.02em; line-height: 1.1; }
.about-role { margin-top: 4px; color: var(--muted); font-size: 14px; }
.about-role b { color: var(--accent); font-weight: 600; }
.about-pitch { font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.stats li { position: relative; overflow: hidden; padding: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.stats li::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.stats strong { display: block; font: 800 1.6rem var(--mono); }
.stats span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.about-text { display: grid; gap: 10px; max-width: 70ch; }
.facts { display: grid; gap: 1px; margin: 0; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); }
@container (min-width: 520px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts div { padding: 10px 14px; background: rgba(12, 17, 14, 0.95); }
.facts dt { font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.facts dd { margin: 2px 0 0; font-weight: 500; font-size: 14px; }

/* ---------- projects ---------- */
.finder-bar { position: sticky; top: -22px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; margin: -22px -22px 18px; padding: 12px 22px; background: rgba(12, 17, 14, 0.92); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.project-grid li[hidden] { display: none; }
.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease-out, border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); border-bottom: 3px solid var(--strip, var(--border)); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.4s; }
.card:hover .thumb img { transform: scale(1.05); }
.thumb-empty { display: grid; place-content: center; gap: 4px; text-align: center; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--strip) 30%, transparent) 0 20px, transparent 20px 24px), linear-gradient(160deg, color-mix(in srgb, var(--strip) 45%, var(--bg)), var(--bg)); }
.thumb-empty b { font: 800 1.3rem var(--mono); color: #fff; }
.thumb-empty small { font: 11px var(--mono); color: rgba(255, 255, 255, 0.75); text-transform: uppercase; letter-spacing: 0.08em; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; font: 11px var(--mono); color: var(--muted); }
.card-name { font: 600 1rem var(--mono); }
.card-desc { color: var(--muted); font-size: 14px; line-height: 1.45; }

.project { display: grid; gap: 14px; max-width: 70ch; margin: 0 auto; }
.shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: 12px; }
.shot-missing { display: grid; place-items: center; color: var(--muted); background: rgba(0, 0, 0, 0.3); border-style: dashed; font: 13px var(--mono); }
.project-meta { display: flex; gap: 10px; align-items: center; font: 12px var(--mono); color: var(--muted); }
.project-name { font: 800 1.6rem var(--mono); letter-spacing: -0.02em; }
.project h3 { margin-top: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.project ul { margin: 0; padding-left: 20px; }

/* ---------- experience ---------- */
.gitlog { margin: 0; padding: 0 0 0 4px; list-style: none; border-left: 2px solid var(--border); }
.commit { position: relative; padding: 0 0 22px 22px; }
.commit:last-child { padding-bottom: 0; }
.commit::before { content: ''; position: absolute; left: -8px; top: 5px; width: 12px; height: 12px; background: var(--bg); border: 2px solid var(--accent); border-radius: 50%; }
.commit-hash { font: 13px var(--mono); color: var(--amber); }
.commit-ref { color: var(--accent); }
.commit-date { margin: 2px 0 6px; font: 12px var(--mono); color: var(--muted); }
.commit h3 { font-size: 1rem; }
.commit-co { color: var(--muted); font-weight: 400; }
.commit ul { margin: 6px 0 0; padding-left: 18px; font-size: 15px; }

/* ---------- skills ---------- */
.skills { display: grid; gap: 12px; margin-bottom: 22px; }
@container (min-width: 520px) { .skills { grid-template-columns: repeat(3, 1fr); } }
.skill-group { padding: 12px 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.skill-name { margin-bottom: 8px; font: 600 12px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.skill-list li { padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; font: 12px var(--mono); }
.log { margin: 0; padding: 0; list-style: none; font: 13px/1.6 var(--mono); }
.log li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.log-date { color: var(--muted); }
.log-level { color: var(--amber); }

/* ---------- terminal ---------- */
.win-terminal { background: rgba(5, 8, 6, 0.88); }
.win-terminal .win-body { padding: 0; }
.term { display: flex; flex-direction: column; height: 100%; font: 13px/1.55 var(--mono); }
.term-log { flex: 1; overflow-y: auto; padding: 14px 16px 4px; white-space: pre-wrap; word-break: break-word; }
.term-log .echo { color: var(--muted); }
.term-log .ok { color: var(--accent); }
.term-log .err { color: var(--red); }
.term-form { display: flex; align-items: center; gap: 8px; padding: 6px 16px 14px; }
.term-form input { flex: 1; min-width: 0; padding: 2px 0; color: var(--text); background: none; border: 0; font: inherit; caret-color: var(--accent); }
.term-form input:focus { outline: none; }
.term-form:focus-within { box-shadow: inset 2px 0 0 var(--accent); }

/* ---------- KUFIZ AI ---------- */
.win-ai .win-body { padding: 0; }
.ai { display: grid; height: 100%; }
@container (min-width: 640px) { .ai { grid-template-columns: 0.85fr 1.15fr; } }
.ai-side { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
@container (min-width: 640px) { .ai-side { border-bottom: 0; border-right: 1px solid rgba(255, 255, 255, 0.06); } }
.scene-box { position: relative; }
.scene-box canvas { display: block; width: 100%; height: 100%; }
.orb-box { height: 170px; }
.ai-title { font: 700 1.15rem var(--mono); }
.suggest-list { display: grid; gap: 8px; margin-top: 4px; }
.suggest { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 42px; padding: 9px 14px; text-align: left; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); font: 14px var(--sans); cursor: pointer; }
.suggest span { color: var(--accent); transition: transform 0.2s; }
.suggest:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.suggest:hover span { transform: translateX(4px); }
.chat { display: flex; flex-direction: column; min-height: 320px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 20px; }
.msg { max-width: 85%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; white-space: pre-wrap; font-size: 15px; }
.msg-bot { align-self: flex-start; background: rgba(0, 0, 0, 0.35); border-bottom-left-radius: 4px; }
.msg-user { align-self: flex-end; color: var(--bg); background: var(--accent); border-color: var(--accent); border-bottom-right-radius: 4px; font-weight: 500; }
.msg.pending { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; margin: 0 16px 16px; padding: 6px 6px 6px 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border); border-radius: 14px; }
.chat-form:focus-within { border-color: var(--accent); }
.chat-form input { flex: 1; min-width: 0; color: var(--text); background: none; border: 0; font: inherit; }
.chat-form input:focus { outline: none; }
.send-btn { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--bg); background: var(--accent); border: 0; border-radius: 10px; cursor: pointer; }
.send-btn svg { width: 20px; height: 20px; }
.send-btn:disabled { opacity: 0.5; cursor: wait; }

/* ---------- contact ---------- */
.win-contact .win-body { padding: 0; }
.contact { display: grid; height: 100%; }
@container (min-width: 680px) { .contact { grid-template-columns: 1fr 1fr; } }
.contact-visual { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
@container (min-width: 680px) { .contact-visual { border-bottom: 0; border-right: 1px solid rgba(255, 255, 255, 0.06); } }
.globe-box { position: absolute; inset: 0; }
.ping-panel { position: relative; padding: 10px 12px; background: rgba(5, 8, 6, 0.8); border: 1px solid var(--border); border-radius: 10px; }
.ping-panel .cmd { margin-bottom: 4px; }
.ping-out { margin: 0; min-height: 1em; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.contact-info { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 28px; }
.contact-title { font: 800 clamp(1.5rem, 5cqi, 2.2rem) var(--mono); letter-spacing: -0.02em; line-height: 1.15; }
.contact-links { display: grid; gap: 14px; transition: opacity 0.5s; }
.contact-links.waiting { opacity: 0; visibility: hidden; }
.methods { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.method { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--text); text-decoration: none; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.2s, transform 0.2s; }
.method:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateX(4px); }
.method-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 9px; }
.method-icon svg { width: 18px; height: 18px; }
.method-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; font-size: 14px; }
.method-text small { display: block; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.method-arrow { color: var(--muted); }

/* ---------- effects ---------- */
.matrix { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.toast { position: fixed; left: 50%; top: 48px; z-index: 160; margin: 0; padding: 10px 14px; transform: translateX(-50%); color: var(--red); background: var(--surface); border: 1px solid var(--red); border-radius: 10px; font: 13px var(--mono); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.toast.show { opacity: 1; }

.grain, .vignette { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.vignette { background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%); }
.grain {
  inset: -50%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }

.letterbox { position: fixed; inset: 0; z-index: 180; pointer-events: none; }
.letterbox span { position: absolute; left: 0; right: 0; height: 50%; background: #000; animation: 1.3s cubic-bezier(0.7, 0, 0.2, 1) 0.2s both; }
.letterbox span:first-child { top: 0; animation-name: bar-up; }
.letterbox span:last-child { bottom: 0; animation-name: bar-down; }
@keyframes bar-up { to { transform: translateY(-100%); } }
@keyframes bar-down { to { transform: translateY(100%); } }

/* ---------- project drawer (off-canvas, right) ---------- */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(560px, 100vw);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--text);
  background: rgba(10, 14, 11, 0.94);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6);
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.drawer.closing { animation: drawer-out 0.22s ease-in forwards; }
.drawer::backdrop { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(2px); }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes drawer-out { to { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; gap: 12px; flex: none; padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.drawer-title { flex: 1; min-width: 0; overflow: hidden; font: 500 13px var(--mono); color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.drawer-close { padding: 6px 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 8px; font: 12px var(--mono); cursor: pointer; }
.drawer-close:hover { border-color: var(--accent); color: var(--accent); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 20px 32px; }

/* ---------- phones: home screen + full-screen apps ---------- */
@media (max-width: 767px) {
  body { overflow: auto; }
  .menubar { padding: 0 6px; }
  .menu-clock { font-size: 12px; }
  .desktop { position: relative; inset: auto; min-height: 100svh; padding: calc(var(--bar-h) + 24px) 16px 120px; }
  .desk-hero { position: static; max-width: none; margin-bottom: 28px; pointer-events: auto; }
  .desk-hero h1 { font-size: clamp(1.6rem, 7.6vw, 2.4rem); }
  .wall-static { position: fixed; right: -10%; top: auto; bottom: 90px; width: 70vw; height: 80vw; transform: none; opacity: 0.18; }
  .desktop-icons { display: grid; position: static; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; }
  .desk-icon { width: auto; }
  .app-icon { width: 58px; height: 58px; border-radius: 16px; }
  .app-icon svg { width: 28px; height: 28px; }
  .dock { display: none; }
  .desk-footer { position: static; display: block; padding: 0 16px 24px; }
  .windows { position: fixed; inset: var(--bar-h) 0 0; z-index: 95; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; border: 0; }
  .win-bar { cursor: default; }
  .win-lights .light-min, .win-lights .light-max { display: none; }
  .light-close { width: auto; height: auto; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.08) !important; color: var(--text); font: 12px var(--mono); }
  .light-close::before { content: '← back'; }
  .win-body { padding: 18px 16px; }
  .finder-bar { top: -18px; margin: -18px -16px 16px; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .grain, .letterbox { display: none; }
}

/* ---------- custom scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 45%, #26322a) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 35%, #26322a); border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
