/* ==========================================================================
   yanisdev.com
   Light theme is a daytime sky, dark theme is the same level at night.
   Everything is driven by the tokens below, including the canvas level in
   the hero (script.js reads these custom properties when it draws).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #eef2f8;
  --surface: #f9fbfe;
  --ink: #1b2140;
  --muted: #4f5a7d;
  --line: #cdd6e6;
  --link: #187a50;
  --accent: #187a50;
  --accent-ink: #ffffff;
  --sun: #f4b83a;
  --sun-ink: #2a2000;
  --focus: #1b2140;

  /* The hero level */
  --sky-top: #dbe8fb;
  --sky-bottom: #b9d3f6;
  --cloud: rgba(255, 255, 255, 0.85);
  --grass: #3eae72;
  --grass-edge: #2f8f5b;
  --dirt: #4b4673;
  --dirt-fleck: #413c66;
  --dirt-ink: #f3f1ff;

  --radius: 10px;
  --wrap: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

:root[data-theme="dark"] {
  --bg: #12162b;
  --surface: #1a2040;
  --ink: #e9edfa;
  --muted: #a3aed0;
  --line: #2c3562;
  --link: #63d49c;
  --accent: #63d49c;
  --accent-ink: #0b1f15;
  --sun: #f6c755;
  --focus: #e9edfa;

  --sky-top: #12162b;
  --sky-bottom: #2a336e;
  --cloud: rgba(233, 237, 250, 0.14);
  --grass: #63d49c;
  --grass-edge: #3fa877;
  --dirt: #262c5c;
  --dirt-fleck: #20254f;
  --dirt-ink: #e9edfa;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

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

code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---------- Utilities ---------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 700 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn--small {
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.95rem;
}

.btn--on-dirt {
  border-color: var(--dirt-ink);
  color: var(--dirt-ink);
}
.btn--on-dirt:hover {
  background: var(--dirt-ink);
  border-color: var(--dirt-ink);
  color: var(--dirt);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-height: 3.75rem;
  padding-block: 0.5rem;
}

.brand {
  margin-right: auto;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.menu-toggle { display: none; }
.js .menu-toggle { display: inline-flex; }

.site-nav {
  order: 3;
  flex-basis: 100%;
}
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

.site-nav ul {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 0.55rem 0.25rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.4em;
}

@media (min-width: 52rem) {
  .site-nav { order: 0; flex-basis: auto; }
  .js .site-nav { display: block; }
  .js .menu-toggle { display: none; }
  .site-nav ul { flex-direction: row; gap: 0.15rem; }
  .site-nav a { padding: 0.45rem 0.7rem; font-size: 0.95rem; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

.hero__copy {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
  padding: 0.4rem 1rem 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}
.status__dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 35%, transparent);
}

.hero__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 12vw, 7.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
}
.hero__title span { display: inline-block; }

.hero__lead {
  max-width: 38rem;
  margin: 0 0 1.75rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* The generated level: canvas on top, "underground" control bar below.
   Without JavaScript the whole figure is hidden. */
.level { display: none; margin: 0; }
.js .level { display: block; }

.level__canvas { width: 100%; }

.level__bar {
  --focus: var(--sun);
  background: var(--dirt);
  color: var(--dirt-ink);
}

.level__inner {
  display: grid;
  gap: 1rem 2.5rem;
  align-items: center;
  padding-block: 1.25rem 1.5rem;
}
@media (min-width: 56rem) {
  .level__inner { grid-template-columns: auto minmax(0, 1fr); }
}

.seed-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.seed-form label { font-weight: 700; }
.seed-form input {
  width: 12.5rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid color-mix(in srgb, var(--dirt-ink) 55%, transparent);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  color: var(--dirt-ink);
  font: 600 1rem/1.2 var(--font-mono);
}
.seed-form input:focus-visible { outline-offset: 2px; }

.level__text p { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.level__text .level__note { max-width: 50rem; }
.level__text .level__stats {
  margin-top: 0.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}

.section__grid { display: grid; gap: 1.25rem 3rem; }
@media (min-width: 56rem) {
  .section__grid { grid-template-columns: 11rem minmax(0, 1fr); }
  .section__title { position: sticky; top: 5.5rem; align-self: start; }
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.section__body { max-width: 48rem; }
.section__body p { max-width: 62ch; margin: 0 0 1rem; }
.section__body > :last-child { margin-bottom: 0; }

.lede {
  font-size: 1.35rem;
  line-height: 1.45;
}

/* ---------- Label / value rows (about, skills, activities) ---------- */
.rows {
  margin: 2rem 0 0;
  border-top: 1px solid var(--line);
}
.section__body > .rows:first-child { margin-top: 0; }

.rows__item {
  display: grid;
  gap: 0.15rem 2rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 40rem) {
  .rows__item { grid-template-columns: 11rem minmax(0, 1fr); }
}
.rows__item dt { color: var(--muted); font-weight: 700; }
.rows__item dd { margin: 0; }

.rows__item--lead dd {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ---------- Projects ---------- */
.filters { display: none; flex-wrap: wrap; gap: 0.5rem; }
.js .filters { display: flex; }

.chip {
  min-height: 2.5rem;
  padding: 0.35rem 0.95rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 0.95rem/1.2 var(--font-body);
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.section__body .filter-status {
  min-height: 1.6em;
  margin: 0.75rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.projects {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.project {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.project[hidden] { display: none; }

.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
}
.project__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.project--featured .project__title { font-size: 2.1rem; }

.badge {
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--sun);
  color: var(--sun-ink);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}

.section__body .project__meta {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.project__link { font-weight: 700; }

/* ---------- Education timeline ---------- */
.timeline {
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
  border-left: 2px solid var(--line);
}
.timeline__item {
  position: relative;
  padding-bottom: 2.25rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: calc(-1.75rem - 7px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.section__body .timeline__date {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.timeline__title {
  margin: 0.1rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Teamwork ---------- */
.points {
  display: grid;
  gap: 1.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}
.points__lead {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ---------- Contact ---------- */
.contact-email {
  display: inline-block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.2em;
}
.contact-email:hover { text-decoration-thickness: 5px; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.copy-status { color: var(--muted); font-size: 0.95rem; font-weight: 700; }

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-footer p { margin: 0; }

/* ---------- 404 page ---------- */
.notfound {
  display: grid;
  align-content: center;
  gap: 1rem;
  min-height: 70vh;
  padding-block: 4rem;
  justify-items: start;
}
.notfound__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(5rem, 22vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.notfound p { margin: 0; max-width: 34rem; font-size: 1.25rem; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
