:root {
  --bg: #f3f1ec;
  --surface: rgba(255, 255, 255, 0.86);
  --text: #1d2126;
  --muted: #5d646d;
  --border: rgba(20, 24, 30, 0.1);
  --accent: #dd5a2b;
  --accent-soft: rgba(221, 90, 43, 0.08);
  --shadow: 0 1px 2px rgba(20, 24, 30, 0.05), 0 18px 50px -12px rgba(20, 24, 30, 0.16);

  /* robot floor (read by js/floor.js) */
  --floor-line: rgba(40, 46, 56, 0.085);
  --floor-node: rgba(40, 46, 56, 0.25);
  --floor-bay: rgba(40, 46, 56, 0.2);
  --crate: #dcb98a;
  --crate-edge: #a88053;
  --bot-1: #557ca8;
  --bot-2: #5f9475;
  --bot-3: #8a76ad;
  --bot-4: #4a8b96;
  --bot-5: #6b7280;
  --bot-top: rgba(255, 255, 255, 0.16);
  --bot-led: #fff4cc;
  --bot-shadow: rgba(20, 24, 30, 0.14);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121519;
    --surface: rgba(24, 28, 34, 0.86);
    --text: #e6e8eb;
    --muted: #9ba4ae;
    --border: rgba(255, 255, 255, 0.09);
    --accent: #ff7d4a;
    --accent-soft: rgba(255, 125, 74, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 50px -12px rgba(0, 0, 0, 0.6);

    --floor-line: rgba(255, 255, 255, 0.07);
    --floor-node: rgba(255, 255, 255, 0.2);
    --floor-bay: rgba(255, 255, 255, 0.2);
    --crate: #8c6c47;
    --crate-edge: #c79f6c;
    --bot-1: #6c92be;
    --bot-2: #74aa87;
    --bot-3: #a28dc6;
    --bot-4: #5ea4af;
    --bot-5: #8a929e;
    --bot-top: rgba(255, 255, 255, 0.12);
    --bot-led: #ffe7a3;
    --bot-shadow: rgba(0, 0, 0, 0.4);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------------ */
/* Stage: the robot floor spans the whole page, the card sits on top of it. */
/* ------------------------------------------------------------------------ */

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(84px, 13vh, 150px) 16px clamp(150px, 18vh, 190px);
  cursor: crosshair;
  overflow: hidden;
}

#floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.card {
  position: relative;
  width: 100%;
  max-width: 620px;
  padding: 36px 40px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: auto;
}

@media (max-width: 560px) {
  .card {
    padding: 26px 22px 22px;
    border-radius: 16px;
  }
}

.card > p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s, border-color 0.15s, background-color 0.15s;
}

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

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

/* Intro */

.intro {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}

.portrait {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border);
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4.5vw, 2.05rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline,
h2 {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 420px) {
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* Projects */

h2 {
  margin: 30px 0 8px;
}

.projects {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
}

.projects li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.projects li:last-child {
  border-bottom: 0;
}

.projects a {
  font-weight: 600;
  min-width: 7.5em;
}

.projects span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Links */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
}

.links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* Notes */

.bots-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.bots-note strong {
  color: var(--text);
  font-weight: 600;
}

.card > .signoff {
  margin: 0;
}

/* ------------------------------------------------------------------------ */
/* Floor controls                                                           */
/* ------------------------------------------------------------------------ */

.floor-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: auto;
}

.stats {
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.floor-controls button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: 500 0.8rem/1 var(--font);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.floor-controls button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.floor-controls button[aria-pressed="true"]#btn-paths {
  background: var(--accent-soft);
  color: var(--accent);
}

.floor-controls svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

#btn-pause[data-state="playing"] .i-play,
#btn-pause[data-state="paused"] .i-pause {
  display: none;
}

@media (max-width: 640px) {
  .floor-controls {
    left: 16px;
    right: 16px;
    justify-content: flex-end;
  }
  .stats {
    margin-right: auto;
    white-space: normal;
    line-height: 1.3;
  }
  .floor-controls .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .floor-controls button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}

@media print {
  #floor,
  .floor-controls {
    display: none;
  }
  .card {
    box-shadow: none;
    border: 0;
  }
}
