/* ============================================================
   louismestas.com — Learning MORE
   Strict monochrome system. Two modes, exact opposites.
   Light: paper white / ink black.  Dark: ink black / paper white.
   ============================================================ */

:root {
  /* The correct black and the correct white */
  --paper: #FAFAF7;        /* warm-neutral paper white — elegant, not clinical */
  --ink:   #0C0C0D;        /* near-black ink with a cool drop — reads true black */

  --bg: var(--paper);
  --fg: var(--ink);
  --fg-soft: #565654;
  --line: #E2E2DC;
  --line-strong: #C9C9C2;
  --surface: #FFFFFF;
  --dots: rgba(12, 12, 13, 0.16);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1080px;
  --pad: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: var(--ink);
  --fg: #F4F4F0;
  --fg-soft: #A0A09B;
  --line: #232326;
  --line-strong: #3A3A3E;
  --surface: #121214;
  --dots: rgba(244, 244, 240, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

::selection { background: var(--fg); color: var(--bg); }

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

a { color: inherit; }

/* ---------- header / nav ---------- */

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

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.02em;
  font-size: 15px;
  text-transform: uppercase;
}

.nav-logo svg { width: 34px; height: 28px; }
.nav-logo svg path { fill: var(--fg); transition: fill 0.35s ease; }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--fg-soft);
  padding: 7px 11px;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover, .nav-links a:focus-visible { color: var(--fg); }

.nav-links a.is-active {
  color: var(--fg);
  border-color: var(--line-strong);
}

.theme-toggle {
  margin-left: 8px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover { background: var(--fg); color: var(--bg); }
.theme-toggle svg { width: 16px; height: 16px; }

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* mobile nav */
.nav-burger { display: none; }

@media (max-width: 760px) {
  .nav { gap: 12px; }
  .nav-burger {
    display: grid;
    place-items: center;
    margin-left: auto;
    width: 38px; height: 38px;
    border: 1px solid var(--line-strong);
    background: transparent; color: var(--fg); cursor: pointer;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--pad) 20px;
    margin-left: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border: none; border-bottom: 1px solid var(--line); }
  .theme-toggle { margin-left: 0; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  display: grid;
  place-items: center;
  overflow: hidden;
  /* point-cloud dot field — a nod to LiDAR returns */
  background-image: radial-gradient(var(--dots) 1px, transparent 1.5px);
  background-size: 26px 26px;
}

.hero::after {
  /* fade the dot field toward the edges */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 65% at 50% 45%, transparent 30%, var(--bg) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 64px var(--pad);
}

.lm-anim { width: clamp(180px, 26vw, 280px); margin: 0 auto; }

.hero-name {
  margin-top: 40px;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s var(--ease) 2.5s forwards;
}

.hero-tagline {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.4vw, 22px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--fg-soft);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s var(--ease) 2.8s forwards;
}

.hero-tagline em { font-style: italic; font-weight: 300; }
.hero-tagline strong { font-style: normal; font-weight: 900; color: var(--fg); }

.hero-roles {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  opacity: 0;
  animation: rise 0.8s var(--ease) 3.15s forwards;
}

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

/* ---------- LM logo animation (the LiDAR scan) ----------
   1. outline draws on            (0.0s – 1.4s)
   2. scan line sweeps bottom→top (1.2s – 2.4s)
   3. fill reveals behind the scan line                       */

.lm-anim .lm-outline {
  fill: none;
  stroke: var(--fg);
  stroke-width: 10;
  stroke-dasharray: 10950;
  stroke-dashoffset: 10950;
  animation: lm-draw 1.5s var(--ease) 0.15s forwards;
}

.lm-anim .lm-fill {
  fill: var(--fg);
  clip-path: inset(100% 0 0 0);
  animation: lm-reveal 1.2s var(--ease) 1.25s forwards;
}

.lm-anim .lm-scanline {
  stroke: var(--fg);
  stroke-width: 7;
  opacity: 0;
  transform: translateY(0);
  animation: lm-scan 1.2s var(--ease) 1.25s forwards;
}

@keyframes lm-draw { to { stroke-dashoffset: 0; } }
@keyframes lm-reveal { to { clip-path: inset(-2% 0 0 0); } }
@keyframes lm-scan {
  0%   { opacity: 1; transform: translateY(0); }
  92%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-1370px); }
}

@media (prefers-reduced-motion: reduce) {
  .lm-anim .lm-outline { animation: none; stroke-dashoffset: 0; }
  .lm-anim .lm-fill { animation: none; clip-path: none; }
  .lm-anim .lm-scanline { display: none; }
  .hero-name, .hero-tagline, .hero-roles { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 11vh, 120px) var(--pad);
  border-top: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: 18px;
}

.eyebrow::before { content: "/ "; }

.section h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.08;
  margin-bottom: 28px;
  max-width: 18ch;
}

.section .lede {
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.6;
  max-width: 62ch;
  color: var(--fg);
}

.section p + p { margin-top: 1em; }
.muted { color: var(--fg-soft); }

/* expertise grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  margin-top: 44px;
}

.grid-3 > article {
  padding: 32px 28px 36px;
  border-right: 1px solid var(--line);
  transition: background 0.25s ease;
}

.grid-3 > article:last-child { border-right: none; }
.grid-3 > article:hover { background: var(--surface); }

.grid-3 h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  font-size: 19px;
  margin: 14px 0 12px;
}

.grid-3 .tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
}

.grid-3 p { font-size: 15.5px; color: var(--fg-soft); }

.grid-3 ul {
  margin-top: 16px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-soft);
}

.grid-3 li { padding: 5px 0; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-3 > article { border-right: none; border-bottom: 1px solid var(--line); }
  .grid-3 > article:last-child { border-bottom: none; }
}

/* philosophy */
.philosophy blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.35;
  max-width: 26ch;
  margin: 36px 0;
}

.philosophy blockquote strong { font-weight: 900; }

.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
  margin-top: 40px;
}

.principles h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 2px solid var(--fg);
  padding-top: 12px;
  margin-bottom: 8px;
}

.principles p { font-size: 15.5px; color: var(--fg-soft); }

/* resume */
.timeline { margin-top: 36px; border-top: 1px solid var(--line); }

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item .when {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  padding-top: 4px;
}

.timeline-item h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.timeline-item .where {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-soft);
  margin: 4px 0 10px;
}

.timeline-item p { font-size: 15.5px; color: var(--fg-soft); max-width: 60ch; }

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 1fr; gap: 6px; }
}

.skills-row {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-row span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  color: var(--fg-soft);
}

/* buttons */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 26px;
  border: 1px solid var(--fg);
  color: var(--fg);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover, .btn:focus-visible { background: var(--fg); color: var(--bg); }

.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: transparent; color: var(--fg); }

/* consulting page */
.consult-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 14vh, 140px) var(--pad) clamp(56px, 9vh, 90px);
}

.consult-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(36px, 6.4vw, 72px);
  line-height: 1.04;
  max-width: 16ch;
}

.services { margin-top: 44px; border-top: 1px solid var(--line); }

.service {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.service .mark {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-soft);
  padding-top: 5px;
}

.service h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  font-size: 21px;
  margin-bottom: 10px;
}

.service p { color: var(--fg-soft); max-width: 64ch; font-size: 15.5px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--pad);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-soft);
}

.footer-inner svg { width: 30px; height: 24px; }
.footer-inner svg path { fill: var(--fg-soft); }
.footer-inner .spacer { margin-left: auto; }
.footer-inner a { color: var(--fg-soft); text-decoration: none; }
.footer-inner a:hover { color: var(--fg); }
