/* =========================================================
   Shierra Cabangahan portfolio: dashboard layout
   Palette: evergreen (primary), clay (hire/attention), honey (details)
   Type: one weight only (400) everywhere; no bold.
   ========================================================= */

:root {
  /* light mode is deliberately muted: soft sage-grey ground, no pure white */
  --paper: #E3E8E1;
  --surface: #EDF1EB;
  --surface-2: #DFE6DD;
  --ink: #1C2421;
  --ink-soft: #49564F;
  --line: #CAD3C9;

  --green: #1F4D3F;
  --green-ink: #F1F4EF;
  --green-tint: #D6E4DA;
  --clay: #9C4624;
  --clay-ink: #FFFFFF;
  --honey: #D9A441;
  --honey-tint: #EDDFBF;
  --live: #2A8452;

  --shadow: 0 1px 2px rgb(28 36 33 / .05), 0 10px 28px -16px rgb(28 36 33 / .22);
  --focus: #9C4624;

  --font-head: "Gabarito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --pad: clamp(1.15rem, 2vw, 1.75rem);
  --gap: clamp(.75rem, 1.2vw, 1rem);

  color-scheme: light;
}

/* Dark palette: follows the system setting unless the visitor picks a theme with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101614;
    --surface: #171F1C;
    --surface-2: #1E2824;
    --ink: #E6ECE8;
    --ink-soft: #A3B1AA;
    --line: #2A3631;
    --green: #8CC4AE;
    --green-ink: #0F1D17;
    --green-tint: #1C3028;
    --clay: #E39A78;
    --clay-ink: #1A0F0A;
    --honey: #E2B45A;
    --honey-tint: #33291A;
    --live: #5BD08F;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -16px rgb(0 0 0 / .7);
    --focus: #E2B45A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101614;
  --surface: #171F1C;
  --surface-2: #1E2824;
  --ink: #E6ECE8;
  --ink-soft: #A3B1AA;
  --line: #2A3631;
  --green: #8CC4AE;
  --green-ink: #0F1D17;
  --green-tint: #1C3028;
  --clay: #E39A78;
  --clay-ink: #1A0F0A;
  --honey: #E2B45A;
  --honey-tint: #33291A;
  --live: #5BD08F;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -16px rgb(0 0 0 / .7);
  --focus: #E2B45A;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 1rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}

/* One weight everywhere */
h1, h2, h3, h4, dt, strong, b, th, label, button, input, textarea { font-weight: 400; }

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--green); text-underline-offset: .2em; text-decoration-thickness: 1px; }

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

:where(ul[class], ol[class]) { list-style: none; margin: 0; padding: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--green); color: var(--green-ink);
  padding: .7rem 1rem; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.mono-label {
  font-family: var(--font-mono);
  font-size: .76rem;
  line-height: 1.4;
  color: var(--ink-soft);
  letter-spacing: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem;
  padding: .6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: 400 .98rem/1.2 var(--font-head);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color .15s ease, color .15s ease, border-color .15s ease,
    transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
}
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--green) 86%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-clay { background: var(--clay); color: var(--clay-ink); }
.btn-clay:hover { background: color-mix(in srgb, var(--clay) 86%, var(--ink)); }

/* Buttons float up on hover and settle when pressed */
.btn:hover, .icon-btn:hover, .nav-toggle:hover, .modal-close:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -10px rgb(0 0 0 / .45);
}
.btn:active, .icon-btn:active, .nav-toggle:active, .modal-close:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -6px rgb(0 0 0 / .4);
}

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 2.4rem; height: 2.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--green); border-color: var(--green); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  min-height: 100vh;
}
.main {
  display: grid;
  gap: var(--gap);
  align-content: start;
  padding: var(--gap) clamp(.75rem, 2vw, 1.5rem) var(--gap) var(--gap);
  min-width: 0;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 1.4rem 1rem 1.2rem;
  border-right: 1px solid var(--line);
  background: var(--paper);
  z-index: 40;
}
.sidebar-top { display: flex; align-items: center; gap: .5rem; padding-inline: .5rem; }
.sidebar-top .wordmark { margin-right: auto; }

.wordmark {
  font: 400 1.3rem/1 var(--font-head);
  letter-spacing: .2em;
  color: var(--green);
  text-decoration: none;
}
.wordmark-letters { display: inline-flex; }
.wordmark-letters span {
  display: inline-block;
  animation:
    wm-in .6s cubic-bezier(.2, .7, .2, 1) both,
    wm-wave 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms), calc(1.4s + var(--i) * 90ms);
}
/* text-fill-color wins over the animated color, so hover works mid-wave */
.wordmark:hover .wordmark-letters span { -webkit-text-fill-color: var(--clay); }
@keyframes wm-in { from { opacity: 0; transform: translateY(.55em); } }
@keyframes wm-wave {
  0%, 10%, 100% { transform: none; color: var(--green); }
  5% { transform: translateY(-4px); color: var(--clay); }
}

.side-nav { display: flex; flex-direction: column; flex: 1; margin-top: 2rem; min-height: 0; }
.nav-links { display: grid; gap: .15rem; }
.nav-links a {
  position: relative;
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .6rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font: 400 .97rem/1.2 var(--font-head);
  transition: background-color .15s ease, color .15s ease;
}
.nav-links svg {
  width: 1.1rem; height: 1.1rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.is-active { background: var(--green-tint); color: var(--green); }
.nav-links a.is-active::before {
  content: ""; position: absolute; left: -1rem; top: 25%; bottom: 25%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--green);
}

.side-foot { margin-top: auto; display: grid; gap: .9rem; padding-inline: .5rem; }
.side-clock { display: grid; gap: .15rem; }
.clock-main {
  font: 400 1.45rem/1.2 var(--font-mono); color: var(--ink); letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.clock-date { margin-bottom: .45rem; }
.world-clock { display: grid; border-top: 1px solid var(--line); }
.world-clock li {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .4rem; align-items: baseline;
  padding-block: .28rem; border-bottom: 1px solid var(--line);
  font: 400 .74rem/1.3 var(--font-mono); color: var(--ink-soft);
}
.world-clock .tz { color: var(--green); }
.world-clock .city { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world-clock time { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

.nav-toggle {
  display: none;
  align-items: center; gap: .55rem;
  height: 2.4rem; padding: 0 .9rem;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-sm);
  font: 400 .95rem/1 var(--font-head);
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 15px; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Tiles and panels ---------- */
.tile, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  min-width: 0;
}
.tile-head, .panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem;
  flex-wrap: wrap;
}
.tile-head { margin-bottom: 1rem; }
.tile-head h2 { font-size: 1.05rem; }
.panel-head { margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }
.panel-head h2 { font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.3rem); letter-spacing: -0.02em; }
.tile-link { text-decoration: none; }
.tile-link:hover { color: var(--green); text-decoration: underline; }

/* ---------- Overview (landing) ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--gap);
  min-height: calc(100dvh - 2 * var(--gap));
}
/* Landing fits one screen: hero on the left, profile and runs on the right, tools carousel along the bottom */
.tile-hero    { grid-column: 1 / 8; grid-row: 1 / 3; }
.tile-profile { grid-column: 8 / -1; grid-row: 1; }
.tile-feed    { grid-column: 8 / -1; grid-row: 2; }
.tile-tools   { grid-column: 1 / -1; grid-row: 3; }

/* Hero: dot grid with a soft spotlight that follows the cursor */
.tile-hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  background:
    radial-gradient(420px circle at var(--mx, 78%) var(--my, 20%), color-mix(in srgb, var(--green) 14%, transparent), transparent 70%),
    radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.3px) 0 0 / 18px 18px,
    var(--surface);
  overflow: hidden;
}
.tile-hero h1 {
  font-size: clamp(2.2rem, min(1.2rem + 3.4vw, 7.5vh), 4.3rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  max-width: 13ch;
  margin-top: auto;
}
.hero-sub { margin-top: 1rem; max-width: 34rem; color: var(--ink-soft); font-size: clamp(1.02rem, .95rem + .3vw, 1.15rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }

/* Profile */
.tile-profile { display: flex; flex-direction: column; gap: 1rem; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-head img {
  width: 4.75rem; height: 4.75rem; flex: none;
  object-fit: cover; object-position: center 20%;
  border-radius: 14px;
  background: #C2A26A;
}
.profile-name { font-size: 1.1rem; line-height: 1.25; }
.profile-role { color: var(--ink-soft); font-size: .93rem; margin-top: .15rem; }
.profile-facts { display: grid; }
.profile-facts > div {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .75rem;
  align-items: baseline;
  padding-block: .45rem;
  border-top: 1px solid var(--line);
}
.profile-facts dt { font: 400 .76rem/1.4 var(--font-mono); color: var(--ink-soft); }
.profile-facts dd { margin: 0; font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.profile-facts .clock { font-family: var(--font-mono); font-size: .95rem; }

.pulse {
  position: relative; flex: none;
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--live);
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--live);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* Feed of sample automation runs */
.tile-feed { display: flex; flex-direction: column; }
.feed { display: grid; align-content: start; gap: .4rem; flex: 1; min-height: 0; overflow: hidden; }
.feed .run {
  width: 100%;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: .75rem;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: .93rem;
}
.feed .run-dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--line);
  transition: background-color .4s ease;
}
.feed li.is-new .run-dot { background: var(--live); }
.feed li.is-new .run { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.feed .run:hover { border-color: var(--green); background: var(--surface-2); }
.feed .run:hover .run-text { color: var(--green); }
.feed .run-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .run-arrow { color: var(--green); margin-inline: .35rem; }
.feed .run-tool { font: 400 .72rem/1 var(--font-mono); color: var(--ink-soft); white-space: nowrap; }
.feed li.entering { animation: feed-in .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes feed-in { from { opacity: 0; transform: translateY(-10px); } }

/* Tools carousel */
.tile-tools { padding-bottom: calc(var(--pad) - .25rem); }
.marquee-pause {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: .2rem .5rem; cursor: pointer;
}
.marquee-pause:hover { color: var(--green); border-color: var(--green); }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee + .marquee { margin-top: .6rem; }
.marquee-track {
  display: flex; width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee[data-direction="right"] .marquee-track { animation-direction: reverse; animation-duration: 54s; }
.marquee:hover .marquee-track,
.tile-tools.is-paused .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.logos { display: flex; gap: .6rem; padding-right: .6rem; }
.logo {
  display: flex; align-items: center;
  height: 3rem; padding-inline: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  transition: border-color .2s ease, transform .22s cubic-bezier(.2, .7, .2, 1);
}
.logo svg { width: 1.45rem; height: 1.45rem; flex: none; fill: var(--brand); }
.logo-name {
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0;
  font: 400 .8rem/1 var(--font-mono); color: var(--ink);
  transition: max-width .35s ease, margin .35s ease, opacity .25s ease;
}
.logo:hover { border-color: color-mix(in srgb, var(--brand, var(--green)) 50%, var(--line)); transform: translateY(-2px); }
.logo:hover .logo-name { max-width: 12rem; margin-left: .6rem; opacity: 1; }
.logo-word { font: 400 1rem/1 var(--font-head); color: var(--ink); }

:root[data-theme="dark"] .logo.mono-dark svg { fill: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo.mono-dark svg { fill: var(--ink); }
}

/* ---------- Services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.service {
  position: relative;
  padding: 1.4rem 1.4rem 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.service:not(:nth-child(3n + 1)) { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.service::before {
  content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 0;
  background: var(--green);
  transition: width .4s cubic-bezier(.2, .7, .2, 1);
}
.service:hover::before { width: 100%; }
.service h3 { font-size: 1.12rem; transition: color .2s ease; }
.service:hover h3 { color: var(--green); }
.service p { margin-top: .5rem; color: var(--ink-soft); font-size: .97rem; }

/* ---------- Case studies ---------- */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.case {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
  transition: border-color .2s ease;
}
.case:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.case-media {
  display: block; width: 100%; padding: 0; border: 0;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
}
.case-media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.case:hover .case-media img { transform: scale(1.03); }
.case-body { display: flex; flex-direction: column; flex: 1; padding: 1.15rem 1.25rem 1.3rem; }
.case-body h3 { font-size: 1.35rem; }
.case-summary { margin-top: .4rem; color: var(--ink-soft); font-size: .97rem; }
.case-open { align-self: flex-start; margin-top: auto; }
.case-body .tags { margin-bottom: 1.1rem; }

.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.tags li {
  font: 400 .72rem/1 var(--font-mono);
  padding: .35rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface);
}

.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  width: 100%; height: 100%; min-height: 12rem; padding: 1.5rem;
  text-align: center; color: var(--ink-soft); font-size: .9rem;
  background:
    repeating-linear-gradient(-45deg, transparent 0 12px, color-mix(in srgb, var(--line) 55%, transparent) 12px 13px),
    var(--surface-2);
}
.placeholder-title { font: 400 1.1rem/1.2 var(--font-head); color: var(--ink); }

/* ---------- Automations carousel ---------- */
.carousel-controls { display: flex; align-items: center; gap: .4rem; }
.carousel-controls .mono-label { margin-right: .6rem; }
.carousel-controls .icon-btn { width: 2.1rem; height: 2.1rem; }
.carousel-pause .icon-play { display: none; }
.carousel-pause[aria-pressed="true"] .icon-play { display: block; }
.carousel-pause[aria-pressed="true"] .icon-pause { display: none; }

.auto-carousel {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin-inline: calc(-1 * var(--pad));
  padding: .35rem var(--pad) .5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
}
.auto-carousel::-webkit-scrollbar { display: none; }
.auto-list { display: flex; gap: var(--gap); width: max-content; }
.auto-list li { flex: 0 0 clamp(15.5rem, 23vw, 19.5rem); display: flex; }
.auto {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%;
  padding: .6rem .6rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: inherit; font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
}
.auto img {
  width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover; object-position: left top;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: .75rem;
}
.auto-tool { font: 400 .72rem/1.5 var(--font-mono); color: var(--clay); padding-inline: .2rem; }
.auto-title { font: 400 1.05rem/1.3 var(--font-head); color: var(--ink); padding-inline: .2rem; margin-top: .15rem; }
.auto-desc {
  color: var(--ink-soft); font-size: .9rem; line-height: 1.5; margin-top: .4rem; padding-inline: .2rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.auto:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); transform: translateY(-3px); box-shadow: var(--shadow); }
.auto:hover .auto-title { color: var(--green); }

/* ---------- Process pipeline: a live "run" of the four steps ---------- */
.pipeline-wrap { position: relative; }
.pipeline {
  position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem;
  padding-top: 2rem;
}
/* the connecting line (placed by script between the first and last dot) */
.pipeline-track { position: absolute; left: 0; top: 0; background: var(--line); border-radius: 2px; pointer-events: none; }
.pipeline-fill {
  position: absolute; left: 0; top: 0;
  width: 0; height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--green) 30%, transparent), var(--green));
  transition: width .9s cubic-bezier(.45, 0, .25, 1), height .9s cubic-bezier(.45, 0, .25, 1), opacity .45s ease;
}
/* the data packet riding at the front of the line */
.pipeline-fill::after {
  content: ""; position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-tint), 0 0 16px 3px color-mix(in srgb, var(--green) 55%, transparent);
}
.pipeline-wrap.is-vertical .pipeline-fill {
  width: 100%; height: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 30%, transparent), var(--green));
}
.pipeline-wrap.is-vertical .pipeline-fill::after { right: auto; left: 50%; top: auto; bottom: -6px; margin: 0 0 0 -6px; }

.node { position: relative; }
.node-dot {
  position: absolute; top: -2rem; left: 0;
  width: .9rem; height: .9rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--ink-soft);
  z-index: 1;
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.node.is-running .node-dot { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
.node.is-running .node-dot::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--green);
  animation: ping 1.3s cubic-bezier(0, 0, .2, 1) infinite;
}
.node.is-done .node-dot { background: var(--green); border-color: var(--green); }
.node.is-done .node-dot::before {
  content: ""; position: absolute; left: .27rem; top: .12rem;
  width: .22rem; height: .42rem;
  border: solid var(--green-ink); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.node-key.is-done .node-dot { background: var(--honey); border-color: var(--honey); }
.node-key.is-done .node-dot::before { border-color: #1C1608; }

.node-status { font: 400 .72rem/1.5 var(--font-mono); color: var(--ink-soft); min-height: 1.1rem; margin-bottom: .2rem; }
.node.is-running .node-status { color: var(--green); }
.node.is-running .node-status::after { content: "_"; margin-left: .15rem; animation: blink 1s steps(1) infinite; }
.node.is-done .node-status { color: var(--green); }
@keyframes blink { 50% { opacity: 0; } }

.node h3 { font-size: 1.12rem; transition: color .3s ease; }
.node.is-running h3 { color: var(--green); }
.node-desc { margin-top: .45rem; color: var(--ink-soft); font-size: .96rem; }

.node-tasks { margin-top: .9rem; display: grid; gap: .35rem; }
.node-tasks li {
  display: flex; align-items: center; gap: .55rem;
  font: 400 .74rem/1.4 var(--font-mono); color: var(--ink-soft);
  transition: color .3s ease;
}
.node-tasks li::before {
  content: ""; flex: none;
  width: .7rem; height: .7rem; border-radius: 3px;
  border: 1px solid var(--ink-soft); background: transparent;
  transition: background-color .25s ease, border-color .25s ease, transform .25s cubic-bezier(.2, .7, .2, 1.6);
}
.node-tasks li.is-checked { color: var(--green); }
.node-tasks li.is-checked::before {
  background: var(--green); border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--surface);
  transform: scale(1.1);
}

.pipeline-log { margin-top: 1.75rem; display: flex; align-items: center; gap: .6rem; min-height: 1.2rem; }

/* ---------- Certifications ---------- */
/* one row of five that fills the panel; scrolls sideways on narrow screens */
.cert-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.cert {
  display: grid; gap: .2rem; align-content: start;
  width: 100%; height: 100%;
  padding: .6rem .6rem .9rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); text-align: left; font: inherit; cursor: zoom-in;
  transition: border-color .2s ease, transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
}
.cert img {
  width: 100%; aspect-ratio: 1200 / 848; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
  margin-bottom: .55rem;
}
.cert-title { font: 400 1rem/1.3 var(--font-head); padding-inline: .2rem; }
.cert-meta { font: 400 .72rem/1.5 var(--font-mono); color: var(--ink-soft); padding-inline: .2rem; }
.cert:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); transform: translateY(-3px); box-shadow: var(--shadow); }
.cert:hover .cert-title { color: var(--green); }

/* ---------- About + contact ---------- */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--gap); }
.about-text p { font-size: 1.05rem; line-height: 1.7; max-width: 40rem; }
.about-close { margin-top: 1rem; color: var(--green); font-family: var(--font-head); }
.training { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; color: var(--ink-soft); font-size: .95rem !important; }

.panel-contact { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
.contact-info h2 { font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.3rem); letter-spacing: -0.02em; }
.contact-intro { color: var(--ink-soft); margin-top: .75rem; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field { display: grid; gap: .35rem; align-content: start; }
.field-wide, .form-actions { grid-column: 1 / -1; }
.field label { font: 400 .76rem/1.4 var(--font-mono); color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.field [aria-invalid="true"] { border-color: var(--clay); }
.field-error { color: var(--clay); font-size: .88rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.form-note { font-size: .88rem; color: var(--ink-soft); }
.form-note[data-state="ok"] { color: var(--green); }
.form-note[data-state="error"] { color: var(--clay); }
.btn:disabled { opacity: .7; cursor: progress; transform: none; box-shadow: none; }
.contact-links { margin-top: 1.75rem; border-top: 1px solid var(--line); }
.contact-links li {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; align-items: baseline;
  padding-block: .65rem; border-bottom: 1px solid var(--line);
}
.contact-links a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem;
  padding: 1rem .25rem .5rem;
  font: 400 .78rem/1.5 var(--font-mono); color: var(--ink-soft);
}
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--green); }

/* ---------- Modal ---------- */
.modal {
  width: min(100% - 2rem, 58rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .5);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgb(10 16 14 / .6); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }

.modal-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: .75rem .75rem 0; pointer-events: none; }
.modal-close {
  pointer-events: auto;
  font: 400 .9rem/1 var(--font-head);
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
}
.modal-content { padding: 0 clamp(1.25rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem); margin-top: -1.5rem; }
.dialog-title { font-size: clamp(1.7rem, 1.25rem + 1.8vw, 2.4rem); padding-right: 6rem; letter-spacing: -0.02em; }
.dialog-summary { margin-top: .5rem; color: var(--ink-soft); font-size: 1.05rem; max-width: 42rem; }
.dialog-shot { margin-top: 1.5rem; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
div.dialog-shot { min-height: 12rem; }
img.dialog-shot.fit { max-height: min(65vh, 36rem); object-fit: contain; }
img.dialog-shot.crop { max-height: min(55vh, 30rem); object-fit: cover; object-position: top center; }
.shot-link { display: inline-block; margin-top: .6rem; font-size: .9rem; }
.shot-caption { margin-top: 1rem; color: var(--ink-soft); max-width: 42rem; }

.detail { margin: 1.75rem 0 0; }
.detail > div {
  display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: .4rem 2rem;
  padding-block: 1rem; border-top: 1px solid var(--line);
}
.detail dt { font: 400 .78rem/1.8 var(--font-mono); color: var(--ink-soft); }
.detail dd { margin: 0; max-width: 42rem; }
.detail .tags { margin-top: 0; }
.detail > div:last-child dt { color: var(--green); }

body.modal-open { overflow: hidden; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .wordmark-letters span, .pulse::after, .feed li.entering, .node-dot::after, .node-status::after { animation: none; }
  .marquee-track { animation: none; width: auto; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .logos { flex-wrap: wrap; padding-right: 0; }
  .logos[aria-hidden="true"] { display: none; }
  .marquee-pause { display: none; }
  .btn:hover, .icon-btn:hover, .nav-toggle:hover, .modal-close:hover,
  .btn:active, .icon-btn:active, .nav-toggle:active, .modal-close:active,
  .logo:hover, .cert:hover, .auto:hover { transform: none; }
  .carousel-pause { display: none; }
  .case:hover .case-media img { transform: none; }
  .modal[open] { animation: none; }
}

/* ---------- Medium screens ---------- */
@media (max-width: 80rem) {
  .tile-hero { grid-column: 1 / 7; }
  .tile-profile, .tile-feed { grid-column: 7 / -1; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .service:nth-child(even) { padding-left: 1.4rem; border-left: 1px solid var(--line); }
}

/* ---------- Tablet and phone: sidebar becomes a top bar ---------- */
@media (max-width: 64rem) {
  .layout { display: block; }
  .main { padding: var(--gap); }
  .sidebar {
    position: sticky; top: 0; height: auto;
    padding: .7rem var(--gap);
    border-right: 0; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .sidebar-top { padding-inline: 0; }
  .nav-toggle { display: inline-flex; }
  .side-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    margin-top: 0;
    padding: .75rem var(--gap) 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .js .side-nav:not(.is-open) { display: none; }
  .nav-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; }
  .nav-links a.is-active::before { display: none; }
  .side-foot { margin-top: 1rem; padding-inline: 0; grid-template-columns: 1fr auto; align-items: end; }

  .overview-grid { min-height: 0; grid-template-rows: none; }
  .tile-hero, .tile-profile, .tile-feed, .tile-tools { grid-row: auto; }
  .tile-hero { grid-column: 1 / -1; min-height: 22rem; }
  .tile-profile { grid-column: 1 / 7; }
  .tile-feed { grid-column: 7 / -1; }
  .panel-contact { grid-template-columns: 1fr; }
  .cert-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
    padding-bottom: .5rem;
  }
  .cert-grid li { flex: 0 0 min(15rem, 72%); scroll-snap-align: start; }
  .carousel-controls .mono-label { display: none; }
}

@media (max-width: 44rem) {
  .tile-hero, .tile-profile, .tile-feed { grid-column: 1 / -1; }
  .tile-hero { min-height: 0; }
  .service-grid, .cases { grid-template-columns: 1fr; }
  .service:nth-child(even) { padding-left: 0; border-left: 0; }
  .service { padding-right: 0; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-links li { grid-template-columns: 1fr; gap: .1rem; }
  .detail > div { grid-template-columns: 1fr; }

  /* the pipeline turns vertical; the script runs the line down the left side */
  .pipeline { grid-template-columns: 1fr; gap: 1.6rem; padding-top: 0; padding-left: 2rem; }
  .node-dot { top: .3rem; left: -2rem; }
}

/* ---------- Short laptop screens: keep the whole landing (with the tools carousel) in one view ---------- */
@media (min-width: 64.01rem) and (max-height: 52rem) {
  :root { --pad: 1rem; --gap: .7rem; }
  .tile-hero { padding: 1.4rem 1.75rem; gap: 1rem; }
  .hero-actions { margin-top: 1.1rem; }
  .profile-head img { width: 3.6rem; height: 3.6rem; }
  .tile-profile { gap: .6rem; }
  .profile-facts > div { padding-block: .3rem; }
  .tile-head { margin-bottom: .6rem; }
  .feed { gap: .3rem; }
  .feed .run { padding: .4rem .7rem; }
  .logo { height: 2.6rem; }
  .marquee + .marquee { margin-top: .45rem; }
  .side-nav { margin-top: 1.25rem; }
  .nav-links a { padding-block: .45rem; }
  .clock-main { font-size: 1.25rem; }
}

/* ---------- Phones and tablets: headline fills the first screen with the tools carousel along its bottom ---------- */
@media (max-width: 64rem) {
  .tile-tools { order: 2; }
  .tile-profile, .tile-feed { order: 3; }
}
@media (max-width: 44rem) {
  .tile-hero { min-height: calc(100svh - 18rem); justify-content: space-between; }
}
