:root {
  --bg:      #080b0e;
  --surface: #0f1318;
  --border:  #263040;
  --dim:     #344558;
  --muted:   #607080;
  --subtle:  #8a9bb0;
  --body:    #c8d8e8;
  --bright:  #f0f4f8;
  --accent:  #38bdf8;
  --accent2: #0ea5e9;
  --glow:    rgba(56,189,248,0.15);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; background: var(--bg); color: var(--body);
  font-family: 'JetBrains Mono', monospace; font-size: 16px;
  line-height: 1.6; overflow: hidden; user-select: none;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; opacity: 0.4; pointer-events: none; z-index: 0;
}
body::after {
  content: ''; position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 700px;
  background: radial-gradient(ellipse at center, rgba(56,189,248,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.shell { position: relative; z-index: 1; width: 100vw; height: 100vh; }

/* CARD */
.card {
  position: absolute; width: min(560px, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(56,189,248,0.05), 0 32px 64px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
  opacity: 0; transform: translateY(16px);
  animation: rise 0.7s cubic-bezier(0.16,1,0.3,1) 0.1s forwards;
  transition: width 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
  z-index: 10;
}
.card.is-dragging {
  transition: none;
  box-shadow: 0 0 0 1px rgba(56,189,248,0.2), 0 48px 96px rgba(0,0,0,0.8);
  cursor: grabbing;
}
.card.is-maximized {
  top: 0 !important; left: 0 !important;
  width: 100vw !important; border-radius: 0 !important; overflow-y: auto;
}
.card.is-minimized .card-body,
.card.is-minimized .card-footer { display: none; }
.card.is-minimized { width: 320px !important; border-radius: 4px !important; }
.card.is-minimized .titlebar { border-bottom: none; cursor: pointer; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* TITLEBAR */
.titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border); cursor: grab; flex-shrink: 0;
}
.titlebar:active { cursor: grabbing; }
.dot {
  width: 12px; height: 12px; border-radius: 50%; cursor: pointer;
  position: relative; transition: filter 0.15s; flex-shrink: 0;
}
.dot:hover { filter: brightness(1.3); }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }
.dot-label {
  display: none; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); font-size: 9px; font-weight: 700;
  color: rgba(0,0,0,0.6); pointer-events: none;
}
.dot:hover .dot-label { display: block; }
.titlebar-label { margin-left: auto; font-size: 13px; color: var(--subtle); letter-spacing: 0.08em; pointer-events: none; }

/* BODY */
.card-body { padding: 2.5rem 2.5rem 2rem; }
.prompt { font-size: 15px; color: var(--subtle); letter-spacing: 0.06em; margin-bottom: 1.6rem; opacity: 0; animation: fadein 0.5s ease 0.5s forwards; }
.prompt span { color: var(--accent); }
.name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(2rem,5vw,2.75rem); color: var(--bright); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 0.5rem; opacity: 0; animation: fadein 0.5s ease 0.65s forwards; }
.title { font-size: 14px; color: var(--body); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 2.2rem; opacity: 0; animation: fadein 0.5s ease 0.8s forwards; }
.title::before { content: '// '; color: var(--muted); }
.divider { height: 1px; background: linear-gradient(90deg, var(--accent2), var(--border) 60%, transparent); margin-bottom: 2rem; opacity: 0; animation: fadein 0.5s ease 0.9s forwards; }
.links { display: flex; flex-direction: column; gap: 0.75rem; opacity: 0; animation: fadein 0.5s ease 1s forwards; }
.link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--body); padding: 0.65rem 0.9rem; border: 1px solid var(--border); border-radius: 3px; background: transparent; transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s; font-size: 15px; user-select: none; }
.link:hover { border-color: var(--accent); color: var(--bright); background: var(--glow); box-shadow: 0 0 16px rgba(56,189,248,0.08); }
.link-arrow { margin-left: auto; color: var(--muted); font-size: 16px; transition: transform 0.2s, color 0.2s; }
.link:hover .link-arrow { transform: translateX(3px); color: var(--accent); }
.link-tag { font-size: 12px; color: var(--subtle); letter-spacing: 0.08em; text-transform: uppercase; min-width: 80px; }

/* FOOTER */
.card-footer { padding: 0.9rem 2.5rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; opacity: 0; animation: fadein 0.5s ease 1.1s forwards; }
.footer-loc { font-size: 13px; color: var(--subtle); }
.footer-loc::before { content: '📍 '; font-size: 10px; }
.cursor { display: inline-block; width: 8px; height: 14px; background: var(--accent); margin-left: 4px; vertical-align: middle; animation: blink 1.1s step-end infinite; }

/* CRASH */
#crash { display: none; position: fixed; inset: 0; z-index: 1000; cursor: pointer; }
#crash.visible { display: flex; }
#crash:not(.visible) * { display: none; }
.crash-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 2rem; font-family: monospace; }
.crash-hint { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); font-size: 12px; opacity: 0.5; animation: blink 2s ease-in-out infinite; white-space: nowrap; }

/* Apple II */
.crash-appleii { background:#000; color:#33ff33; font-family:'Courier New',monospace; }
.crash-appleii .crash-inner { flex-direction:column; justify-content:flex-start; align-items:flex-start; padding:3rem 4rem; font-size:clamp(12px,2vw,18px); }

/* Amiga */
.crash-amiga { background:#aa0000; }
.crash-amiga .crash-inner { flex-direction:column; gap:0; }
.amiga-bar { width:100%; max-width:600px; background:#000; color:#ff0000; font-family:'Courier New',monospace; font-size:clamp(14px,2.5vw,22px); font-weight:bold; text-align:center; padding:0.3rem 1rem; border:4px solid #ff0000; letter-spacing:0.1em; }
.amiga-body { width:100%; max-width:600px; background:#ff0000; color:#000; font-family:'Courier New',monospace; font-size:clamp(12px,2vw,16px); padding:1rem; border:4px solid #ff0000; border-top:none; text-align:center; }

/* VAX */
.crash-vax { background:#000; color:#fff; }
.crash-vax .crash-inner { flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:3rem 4rem; font-size:clamp(11px,1.8vw,15px); }

/* Win 3.1 */
.crash-win31 { background:#0000aa; color:#aaaaaa; }
.crash-win31 .crash-inner { flex-direction:column; align-items:center; justify-content:center; }
.win31-box { background:#aaaaaa; color:#000; font-family:'Courier New',monospace; font-size:clamp(11px,1.8vw,14px); width:100%; max-width:560px; border:2px solid #fff; box-shadow:4px 4px 0 #000; }
.win31-titlebar { background:#000080; color:#fff; font-weight:bold; padding:2px 6px; font-size:clamp(12px,2vw,15px); display:flex; justify-content:space-between; }
.win31-body { padding:1rem 1.2rem; line-height:1.8; }

/* Linux */
.crash-linux { background:#000; color:#fff; }
.crash-linux .crash-inner { flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:2rem 3rem; font-size:clamp(10px,1.6vw,13px); overflow:hidden; }

/* Win 9x */
.crash-win9x { background:#0000aa; color:#fff; font-family:'Courier New',monospace; }
.crash-win9x .crash-inner { flex-direction:column; align-items:center; text-align:center; gap:1rem; font-size:clamp(12px,2vw,16px); }
.win9x-header { background:#aaaaaa; color:#0000aa; padding:0.2rem 2rem; font-weight:bold; font-size:clamp(14px,2.5vw,20px); width:100%; max-width:700px; text-align:center; }
.win9x-body { max-width:620px; text-align:left; line-height:1.9; }

/* Sad Mac */
.crash-sadmac { background:#fff; color:#000; }
.crash-sadmac .crash-inner { flex-direction:column; align-items:center; gap:1.5rem; font-size:clamp(12px,2vw,16px); font-family:'Courier New',monospace; }
.sadmac-face { font-size:clamp(60px,12vw,120px); line-height:1; }

/* IRIX */
.crash-irix { background:#1a1a2e; color:#00ff88; }
.crash-irix .crash-inner { flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:2.5rem 4rem; font-size:clamp(11px,1.8vw,14px); }

/* Solaris */
.crash-solaris { background:#000; color:#ff8c00; }
.crash-solaris .crash-inner { flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:3rem 4rem; font-size:clamp(11px,1.8vw,14px); }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes fadein { to { opacity:1; } }

/* Mobile */
@media (max-width: 600px) {
  .card-body { padding: 1.5rem 1.25rem 1.25rem; }
  .card-footer { padding: 0.75rem 1.25rem; }
  .name { font-size: clamp(1.5rem, 8vw, 2.75rem); }
  .link { font-size: 13px; }
  .link-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
