/* ======================================================================
   Look and feel. The whole palette lives in :root — tweak colors here.
   Zone tints are the .zone.sand / .peach / .clay / .amber rules below.
   ====================================================================== */

:root {
  --paper: #f2e9d9;                          /* board background */
  --dot: #cfbd9f;                            /* background dot grid */
  --ink: #54422d;                            /* main text */
  --ink-soft: #7c6549;                       /* secondary text */
  --zone-border: rgba(124, 94, 60, 0.5);     /* dashed zone outline */
  --chip-bg: rgba(255, 252, 245, 0.72);
  --chip-border: rgba(124, 94, 60, 0.28);
  --note-bg: #f3dfa6;                        /* sticky note */
  --shadow: 0 4px 10px rgba(102, 76, 44, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden; /* the board is the page; nothing scrolls outside it */
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

/* The fullscreen viewport. The dot grid is a background that board.js
   shifts and scales together with the world, which is what makes it
   read as an infinite board surface. */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.3px, transparent 1.8px);
  background-size: 26px 26px; /* board.js keeps this in sync with zoom */
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#viewport.grabbing { cursor: grabbing; }

#world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

/* ----- zones ----- */

.zone {
  position: absolute;
  border: 2.5px dashed var(--zone-border);
  border-radius: 18px;
  padding: 20px 22px 26px;
}
.zone.sand  { background: rgba(228, 212, 178, 0.55); }
.zone.peach { background: rgba(238, 207, 170, 0.55); }
.zone.clay  { background: rgba(226, 192, 158, 0.55); }
.zone.amber { background: rgba(235, 206, 150, 0.50); }

.zone-title {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.zone-title::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-soft);
  opacity: 0.55;
  margin-right: 9px;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}

/* ----- sticky notes ----- */

.note {
  position: relative;
  width: 210px;
  padding: 24px 16px 16px;
  background: var(--note-bg);
  border-radius: 4px;
  box-shadow: var(--shadow);
  font-size: 14.5px;
  line-height: 1.5;
}
.note::before,
.photo::before { /* piece of tape holding the card down */
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 52px;
  height: 16px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 250, 235, 0.55);
  border: 1px solid rgba(124, 94, 60, 0.15);
  border-radius: 2px;
}
.cards .note:nth-child(odd)  { transform: rotate(-0.9deg); }
.cards .note:nth-child(even) { transform: rotate(0.8deg); }

/* ----- badges and links ----- */

.badge,
.card-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 11px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 600;
}

.badge-logo { display: flex; }
.badge-logo svg {
  width: 26px;
  height: 26px;
  display: block;
}
.badge-letter {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink-soft);
  color: #fdf8ee;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-link {
  color: #8a5a2b;
  text-decoration: none;
}

/* project card: linked title + description + tech-stack tags, together */
.project {
  position: relative;
  overflow: hidden;
  width: 250px;
  padding: 14px 16px 13px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.project-bg { /* the project's thumbnail, blurred behind the content */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px) saturate(0.85);
  opacity: 0.22;
  transform: scale(1.08); /* hides the blur's soft edges */
}
.project-body { position: relative; }
.project-video { margin: 9px 0 10px; }
.project-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 7px;
}
.project-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #8a5a2b;
  text-decoration: none;
}
a.project-title:hover { text-decoration: underline; }
.project-text {
  margin: 7px 0 9px;
  font-size: 13px;
  line-height: 1.45;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(124, 94, 60, 0.13);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

/* polaroid-style photo card */
.photo {
  position: relative;
  margin: 0;
  padding: 9px 9px 7px;
  background: #fdf8ee;
  border: 1px solid rgba(124, 94, 60, 0.18);
  border-radius: 3px;
  box-shadow: var(--shadow);
  transform: rotate(1.1deg);
}
.photo img {
  display: block;
  width: 170px;
  border-radius: 2px;
}
.photo figcaption {
  padding-top: 6px;
  font-size: 12.5px;
  text-align: center;
  color: var(--ink-soft);
}

/* forces the next card onto a new row inside a zone */
.break {
  flex-basis: 100%;
  height: 6px;
}

/* compact grouped-facts card */
.list-card {
  width: 205px;
  padding: 12px 14px 13px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.list-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.list-items {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.45;
}
.list-items li + li { margin-top: 4px; }
.list-items li.has-icon {
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-left: -16px;
}
.li-icon { flex: none; margin-top: 2px; }
.li-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}
.li-letter {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--ink-soft);
  color: #fdf8ee;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-link:hover { text-decoration: underline; }

/* ----- board chrome (title, controls, hint) ----- */

.title-chip {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  padding: 9px 15px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 11px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
  font-size: 13.5px;
  font-weight: 600;
}

.controls {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 11px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
  overflow: hidden;
}
.controls button {
  border: none;
  background: none;
  padding: 9px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.controls button:hover { background: rgba(124, 94, 60, 0.1); }
#zoom-label {
  font-size: 12.5px;
  min-width: 52px;
}

#hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 8px 14px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--ink-soft);
  transition: opacity 0.6s;
  pointer-events: none;
}
#hint.hidden { opacity: 0; }

/* ----- dark theme — follows the visitor's system setting ----- */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #221b11;
    --dot: #463a28;
    --ink: #e9ddc7;
    --ink-soft: #b59c79;
    --zone-border: rgba(213, 178, 131, 0.42);
    --chip-bg: rgba(48, 40, 29, 0.82);
    --chip-border: rgba(213, 178, 131, 0.24);
    --note-bg: #6b5b2d;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }

  .zone.sand  { background: rgba(124, 102, 66, 0.26); }
  .zone.peach { background: rgba(143, 98, 60, 0.26); }
  .zone.clay  { background: rgba(132, 86, 50, 0.28); }
  .zone.amber { background: rgba(142, 112, 52, 0.24); }

  .note::before,
  .photo::before {
    background: rgba(255, 245, 220, 0.12);
    border-color: rgba(213, 178, 131, 0.18);
  }

  .photo {
    background: #2f271b;
    border-color: rgba(213, 178, 131, 0.2);
  }

  .project-title,
  .card-link { color: #d9a35e; }

  .tag { background: rgba(213, 178, 131, 0.16); }

  .badge-letter,
  .li-letter { color: #2a2118; }

  .controls button:hover { background: rgba(213, 178, 131, 0.14); }

  /* Near-black brand marks (Unity, Unreal, Matrix, Outline, three.js,
     ONLYOFFICE, Keycloak, MariaDB) would vanish on a dark board — swap
     them to a light cream, matching their official white variants. */
  .zone svg path[fill="#222C37"],
  .zone svg path[fill="#0E1128"],
  .zone svg path[fill="#000000"],
  .zone svg path[fill="#444444"],
  .zone svg path[fill="#4D4D4D"],
  .zone svg path[fill="#003545"] { fill: #e9ddc7; }
}
