/* =========================================================
   kafka's desktop
   Colours live in the variables below: change them here
   and the whole site follows.
   ========================================================= */

:root {
  --bg: #f4fbfb;
  --bg-top: #ffffff;
  --window: #ffffff;
  --titlebar: #20313f;
  --titlebar-text: #ffffff;
  --text: #1d2a35;
  --muted: #5b6b78;
  --accent: #0e9f94;        /* teal */
  --accent-2: #3b82f6;      /* blue */
  --accent-soft: #d9f5f1;
  --line: #20313f;
  --hill-back: #bfe6f7;
  --hill-front: #a6eadb;
  --sparkle: #7dd3c8;
  --shadow: rgba(32, 49, 63, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a26;
    --bg-top: #0b131d;
    --window: #172636;
    --titlebar: #0a1119;
    --titlebar-text: #e6f6f4;
    --text: #e6f0f4;
    --muted: #93a7b5;
    --accent: #5eead4;
    --accent-2: #7cb7ff;
    --accent-soft: #163c3c;
    --line: #c9e4ee;
    --hill-back: #173a55;
    --hill-front: #145049;
    --sparkle: #2f8f86;
    --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1a26;
  --bg-top: #0b131d;
  --window: #172636;
  --titlebar: #0a1119;
  --titlebar-text: #e6f6f4;
  --text: #e6f0f4;
  --muted: #93a7b5;
  --accent: #5eead4;
  --accent-2: #7cb7ff;
  --accent-soft: #163c3c;
  --line: #c9e4ee;
  --hill-back: #173a55;
  --hill-front: #145049;
  --sparkle: #2f8f86;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(var(--bg-top), var(--bg) 60%);
  background-color: var(--bg);
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}

a { color: var(--accent); }
a:hover { color: var(--accent-2); }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- toolbar (theme + sound) ---------- */

.toolbar {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 16px;
  display: flex;
  gap: 6px;
  z-index: 1000;
}

.tool {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none;
  border: 0;
  border-radius: 10px;
}
.tool:hover { background: var(--accent-soft); }
.tool svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--text);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-moon, .icon-sound-off { display: none; }
.is-dark .icon-sun { display: none; }
.is-dark .icon-moon { display: block; }
.muted .icon-sound-on { display: none; }
.muted .icon-sound-off { display: block; }

/* ---------- background ---------- */

.ground {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 42vh;
  z-index: 0;
  pointer-events: none;
}
.ground svg { width: 100%; height: 100%; display: block; }
.hill-back  { fill: var(--hill-back);  transition: fill .3s; }
.hill-front { fill: var(--hill-front); transition: fill .3s; }

.sparkles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  fill: var(--sparkle);
  animation: float 6s ease-in-out infinite;
}
.s1 { width: 26px; top: 14%; left: 14%; }
.s2 { width: 16px; top: 24%; right: 16%; animation-delay: -2s; }
.s3 { width: 12px; top: 62%; left: 8%;  animation-delay: -4s; }
.s4 { width: 20px; top: 10%; right: 32%; animation-delay: -1s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(20deg); }
}

/* ---------- desktop + windows ---------- */

.desktop {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 72px 16px 24px;
}

.window {
  background: var(--window);
  border: 2px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 0 var(--shadow), 0 18px 40px var(--shadow);
  overflow: hidden;
  transition: background-color .3s, border-color .3s;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: var(--titlebar);
  color: var(--titlebar-text);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 14px;
  user-select: none;
}

.close {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--titlebar-text);
  font-size: 20px;
  line-height: 1;
}
.close:hover { background: #ff6b81; color: #fff; }

.win-body { padding: 24px; }

/* home window */

.home {
  width: min(640px, 100%);
}
.home-body {
  text-align: center;
  padding: clamp(40px, 9vw, 72px) 20px clamp(28px, 6vw, 44px);
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.2rem, 7.5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.accent { color: var(--accent); font-weight: 600; }

.tagline {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
}
.sep { color: var(--accent); margin: 0 4px; }

.icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 3vw, 24px);
  margin-top: clamp(32px, 7vw, 52px);
}

.icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  padding: 8px 4px;
  background: none;
  border: 0;
  border-radius: 10px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
}
.icon-btn svg {
  width: 44px; height: 44px;
  fill: none; stroke: var(--text);
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), stroke .2s;
}
.icon-btn .fill, .card-art .fill { fill: currentColor; stroke: none; }
.icon-btn:hover svg { transform: translateY(-4px) rotate(-6deg); stroke: var(--accent); }
.icon-btn:hover { color: var(--accent); }

/* popup windows */

.popup {
  position: fixed;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  animation: pop .22s cubic-bezier(.3, 1.4, .5, 1);
}
.popup .titlebar { cursor: grab; touch-action: none; }
.popup.dragging .titlebar { cursor: grabbing; }
.popup .win-body { overflow-y: auto; }

@keyframes pop {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

h2 {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--accent);
}
.win-body p { line-height: 1.6; margin: 0 0 12px; }

.facts {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}
.facts li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: baseline;
}
.k {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

/* links window */

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.link-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: transform .15s, background-color .15s;
}
.link-list a:hover {
  background: var(--accent-soft);
  transform: translateX(4px);
}
.link-list svg { width: 26px; height: 26px; flex: none; }
.link-list .brand { fill: var(--text); }
.link-list .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.link-list span { display: flex; flex-direction: column; min-width: 0; }
.link-list small { color: var(--muted); overflow-wrap: anywhere; }

/* work window */

.card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
}
.card h3 { margin: 0 0 6px; font-weight: 600; }
.card p { margin: 0; }
.card-art { flex: none; color: var(--accent); }
.card-art svg {
  width: 64px; height: 64px;
  fill: none; stroke: currentColor;
  stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  animation: wiggle 2.4s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}

/* contact window */

.email-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.email {
  font-family: "Space Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.copy {
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--window);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
}
.copy:hover { background: var(--accent-soft); }

/* ---------- footer ---------- */

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  color: var(--text);
}
footer p { margin: 4px 0; }
.credit { color: var(--text); opacity: .85; }
.credit a { color: inherit; font-weight: 600; }

.socials { display: flex; justify-content: center; gap: 10px; margin-bottom: 6px; }
.socials a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--titlebar);
  transition: transform .15s;
}
.socials a:hover { transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; fill: var(--titlebar-text); fill-rule: evenodd; }

/* ---------- phones ---------- */

@media (max-width: 640px) {
  .popup {
    left: 16px !important;
    right: 16px;
    top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    width: auto;
    max-height: calc(100dvh - 96px);
  }
  .popup .titlebar { cursor: default; }
  .icons { gap: 2px; }
  .icon-btn { width: 68px; font-size: 12px; }
  .icon-btn svg { width: 38px; height: 38px; }
  .sparkle.s2, .sparkle.s4 { display: none; }
}

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