/* ============================================================
   LEO ROMERO — Creative Technologist
   Shared stylesheet for index.html + project pages
   Palette: gallery white / ink / ultramarine / warm grey
   ============================================================ */

:root {
  --bg: #f4f5f3;
  --ink: #16181c;
  --ink-soft: #4c4f55;
  --line: #d8dad5;
  --accent: #2b3cf0;
  --ph: #e6e3dc;        /* image placeholder */
  --ph-line: #c9c5bb;
  --max: 1120px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- type roles ---------- */

.display {
  font-family: "Bricolage Grotesque", "Archivo", sans-serif;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 18px;
}

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

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

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-decoration: none;
}
.brand b { color: var(--accent); }

nav.main { display: flex; gap: 28px; }
nav.main a {
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-soft);
}
nav.main a:hover { color: var(--ink); }
nav.main a.lang {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--ink);
}
nav.main a.lang:hover { border-color: var(--accent); color: var(--accent); }

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

.hero { padding: 96px 0 72px; border-bottom: 1px solid var(--line); }

.hero h1 {
  font-size: clamp(44px, 7vw, 84px);
  max-width: 14ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lede {
  margin-top: 28px;
  max-width: 52ch;
  font-size: 19px;
  color: var(--ink-soft);
}

/* signature: system diagram */
.diagram {
  margin-top: 56px;
  width: 100%;
  max-width: 720px;
}
.diagram text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  fill: var(--ink);
}
.diagram .node { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.diagram .node.accent { stroke: var(--accent); }
.diagram .flow {
  stroke: var(--ink-soft);
  stroke-width: 1.2;
  stroke-dasharray: 5 6;
  fill: none;
  animation: flow 1.6s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -11; } }

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

section.block { padding: 88px 0; border-bottom: 1px solid var(--line); }

.block h2.display { font-size: clamp(30px, 4vw, 46px); margin-bottom: 12px; }
.block .intro { max-width: 56ch; color: var(--ink-soft); margin-bottom: 48px; }

/* ---------- stage icons ---------- */

.ic {
  width: 19px;
  height: 19px;
  stroke: var(--stage, var(--accent));
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.stage-head .stage-n { margin-bottom: 0; }

/* ---------- diagrams (inline figures) ---------- */

/* unified diagram language (Wycliffe style) */
.dg text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.07em;
  fill: var(--ink);
}
.dg .sub { font-size: 9.5px; fill: var(--ink-soft); }
.dg .bx { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.dg .bx.hl { stroke: var(--stage, var(--accent)); stroke-width: 1.8; }
.dg .ln {
  stroke: var(--stage, var(--accent));
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
  fill: none;
}
.dg .ah { stroke: var(--stage, var(--accent)); stroke-width: 1.4; fill: none; }

.diafig { margin: 30px 0 10px; max-width: 720px; }
.diafig svg { width: 100%; height: auto; display: block; }
.diafig figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* overview diagram above the accordion */
.diafig.overview {
  max-width: 760px;
  margin: 0 0 44px;
}

/* full-width diagram (gallery opener) */
.diafig.full { max-width: 100%; margin: 40px 0 12px; }

/* stage vignette: floats right of the text on wide screens */
.diafig.side {
  float: right;
  width: 290px;
  margin: 6px 0 18px 30px;
}
.diafig.side figcaption { font-size: 10.5px; }
.acc-body::after { content: ""; display: block; clear: both; }

@media (max-width: 760px) {
  .diafig.side {
    float: none;
    width: 100%;
    max-width: 420px;
    margin: 20px 0 10px;
  }
}

/* ---------- masonry gallery (photos certify the story) ---------- */

.gallery {
  columns: 2 300px;
  column-gap: 20px;
  margin-top: 40px;
}
.gallery figure {
  break-inside: avoid;
  margin: 0 0 20px;
}
.gallery img {
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color .15s;
}
.gallery figure:hover img { outline-color: var(--accent); }
.gallery img,
.gallery video {
  width: 100%;
  display: block;
  border: 1px solid var(--ph-line);
  background: var(--ph);
  border-radius: 10px;
}
.gallery figcaption,
.mediafig figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 8px 2px 0;
}
.gallery figcaption b,
.mediafig figcaption b {
  color: var(--accent);
  font-weight: 500;
  margin-right: 6px;
}

/* archive section on project pages */
.archive {
  border-top: 1px solid var(--line);
  padding: 64px 0 84px;
}
.archive h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 8px;
}
.archive .intro { max-width: 56ch; color: var(--ink-soft); }

/* ---------- toolbox ---------- */

.certs { list-style: none; margin: 26px 0 8px; max-width: 720px; }
.certs li {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.certs li span { color: var(--ink-soft); }

.tb-line { margin-top: 26px; max-width: 66ch; }
.tb-line .mono { color: var(--accent); display: block; margin-bottom: 6px; }
.tb-line p { color: var(--ink-soft); font-size: 15.5px; }

/* ---------- how I work (the path) ---------- */

.path {
  position: relative;
  padding-left: 36px;
}

/* the rail: same dashed flow language as the hero diagram */
.path::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 34px;
  width: 0;
  border-left: 1.5px dashed var(--ink-soft);
}

.stage {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 28px 28px 32px;
  margin-bottom: 28px;
}

/* node dot on the rail */
.stage::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 32px;
  width: 11px;
  height: 11px;
  background: var(--bg);
  border: 2px solid var(--stage, var(--ink));
  border-radius: 50%;
}

.stage .stage-n { color: var(--stage, var(--accent)); display: block; }
.stage h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 21px;
  margin-bottom: 10px;
  max-width: 30ch;
}
.stage p { font-size: 15.5px; color: var(--ink-soft); max-width: 62ch; }
.stage .proof {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink);
  border-left: 2px solid var(--stage, var(--accent));
  padding-left: 12px;
}

/* stage 02: two tracks side by side */
.stage.parallel { border-color: var(--stage, var(--accent)); }
.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 6px;
}
.track { border-top: 1px solid var(--line); padding-top: 18px; }

.stage.result {
  border-style: dashed;
  margin-bottom: 0;
}

/* ---------- projects grid ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 32px;
}

.card { text-decoration: none; display: block; }
.card:hover .ph { border-color: var(--accent); }
.card:hover h3 { color: var(--accent); }

.card h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-top: 16px;
  transition: color .15s;
}
.card .meta { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- image placeholders ----------
   Replace any .ph block with: <img src="..." alt="...">
   Keep the same aspect-ratio class for layout stability. */

.ph {
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(0,0,0,.025) 14px 28px),
    var(--ph);
  border: 1px solid var(--ph-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #97928a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color .15s;
}
.r43 { aspect-ratio: 4 / 3; }
.r169 { aspect-ratio: 16 / 9; }
.r11 { aspect-ratio: 1 / 1; }
.r32 { aspect-ratio: 3 / 2; }

/* real images: same layout slots, any source size (object-fit crops cleanly) */
.phimg {
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--ph);
  border: 1px solid var(--ph-line);
  border-radius: 10px;
  transition: border-color .15s;
}

/* looping mini-videos: same visual treatment as photos */
.phvid {
  display: block;
  width: 100%;
  background: var(--ph);
  border: 1px solid var(--ph-line);
  border-radius: 10px;
}
.card:hover .phimg { border-color: var(--accent); }

/* ---------- contact / footer ---------- */

.contact { padding: 88px 0 96px; }
.contact h2 { font-size: clamp(30px, 4vw, 46px); }
.contact p { margin-top: 16px; color: var(--ink-soft); max-width: 50ch; }

.cta {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 26px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 15px;
  border: 1px solid var(--ink);
  transition: background .15s, color .15s;
}
.cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ============================================================
   PROJECT PAGE
   ============================================================ */

.proj-hero { padding: 80px 0 56px; border-bottom: 1px solid var(--line); }
.proj-hero h1 { font-size: clamp(36px, 5.5vw, 64px); max-width: 18ch; }

.proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 36px;
}
.proj-meta div span { display: block; }
.proj-meta .mono { color: var(--ink-soft); margin-bottom: 4px; }
.proj-meta .val { font-size: 15px; }

.proj-hint { margin-top: 36px; color: var(--ink-soft); }

.proj-body { padding: 56px 0 72px; }

/* ---------- process accordion ---------- */

.acc-list { display: flex; flex-direction: column; gap: 14px; }

.acc {
  border: 1px solid var(--line);
  background: var(--bg);
}
.acc[open] { border-left: 3px solid var(--stage, var(--accent)); }

.acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover .acc-title { color: var(--stage, var(--accent)); }

.acc .acc-n {
  color: var(--stage, var(--accent));
  flex: none;
  width: 150px;
}

.acc .acc-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  transition: color .15s;
}

/* plus that becomes minus when open */
.acc-plus {
  margin-left: auto;
  flex: none;
  position: relative;
  width: 16px;
  height: 16px;
}
.acc-plus::before, .acc-plus::after {
  content: "";
  position: absolute;
  background: var(--ink);
  top: 50%; left: 0;
  width: 16px; height: 1.7px;
  transform: translateY(-50%);
}
.acc-plus::after { transform: translateY(-50%) rotate(90deg); transition: transform .18s; }
.acc[open] .acc-plus::after { transform: translateY(-50%) rotate(0deg); }

.acc-body {
  padding: 4px 22px 32px;
  border-top: 1px dashed var(--line);
}
.acc-body > p:first-child { margin-top: 20px; }
.acc-body p { max-width: 62ch; color: var(--ink-soft); margin-bottom: 14px; }
.acc-body .figure { margin: 28px 0 4px; }

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0 4px;
}

/* the decision callout — inherits the stage colour */
.decision {
  border-left: 3px solid var(--stage, var(--accent));
  padding: 6px 0 6px 22px;
  margin: 28px 0;
  max-width: 56ch;
}
.decision .mono { color: var(--stage, var(--accent)); display: block; margin-bottom: 8px; }
.decision p {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}

.proj-next {
  border-top: 1px solid var(--line);
  padding: 56px 0 80px;
}
.proj-next a {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  text-decoration: none;
}
.proj-next a:hover { color: var(--accent); }
.proj-next .mono { display: block; margin-bottom: 10px; color: var(--ink-soft); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .tracks { grid-template-columns: 1fr; }
  .path { padding-left: 26px; }
  .stage::before { left: -24px; }
  .acc summary { flex-wrap: wrap; gap: 10px 14px; padding: 18px; }
  .acc .acc-n { width: auto; }
  .acc .acc-title { width: 100%; order: 3; }
  .acc-body { padding: 4px 18px 26px; }
  .grid { grid-template-columns: 1fr; }
  .two-up { grid-template-columns: 1fr; }
  nav.main { gap: 18px; }
  nav.main a { font-size: 13px; }
  .hero { padding: 64px 0 56px; }
  section.block { padding: 64px 0; }
}


/* ---------- phone mockups & live demo (apps page) ---------- */

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 44px;
  margin-top: 44px;
  max-width: 780px;
}
.app-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 21px;
  margin-top: 52px;
}
.app-title .mono {
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}
.demo-grid.phones-4 {
  grid-template-columns: 1fr 1fr;
  max-width: 760px;
  gap: 40px;
  margin-top: 28px;
}
.phones-4 .phone { max-width: 320px; padding: 10px; border-radius: 34px; }
@media (max-width: 560px) {
  .demo-grid.phones-4 { grid-template-columns: 1fr; }
}
.phones-4 .phone-notch { width: 64px; height: 13px; margin: -9px auto 7px; }
.phones-4 .phone-screen { min-height: 0; border-radius: 16px; }
.phones-4 .phone-screen img { aspect-ratio: 720 / 1480; object-fit: cover; }

.phonefig { margin: 0; }
.phonefig.wide { grid-column: 1 / -1; }
.phonefig.wide .phone { max-width: 360px; }
.phonefig.wide .phone-screen { min-height: 520px; }
.phonefig.wide figcaption { max-width: 360px; }
.phonefig figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 12px 2px 0;
  max-width: 300px;
  margin: 0 auto;
}
.phonefig figcaption b { color: var(--accent); font-weight: 500; margin-right: 6px; }

.phone {
  border: 2px solid var(--ink);
  border-radius: 38px;
  padding: 12px;
  background: var(--bg);
  max-width: 300px;
  margin: 0 auto;
  box-shadow: 10px 10px 0 rgba(22, 24, 28, 0.07);
}
.phone-notch {
  width: 86px;
  height: 16px;
  border: 2px solid var(--ink);
  border-top: none;
  border-radius: 0 0 11px 11px;
  margin: -12px auto 8px;
  background: var(--bg);
}
.phone-screen {
  border: 1px solid var(--line);
  border-radius: 20px;
  min-height: 460px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}
.phone-screen > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* demo UI */
.vt-bar {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.vt-bar b { color: var(--accent); }
.vt-body { padding: 18px 16px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.vt-chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink-soft);
}
.vt-chip b { color: var(--ink); font-weight: 600; }
.vt-sentence {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14.5px;
  line-height: 1.75;
  cursor: text;
  word-break: break-word;
}
.vt-sentence .t-pend { color: #b9b6ae; }
.vt-sentence .t-ok { color: var(--ink); }
.vt-sentence .t-cur { border-left: 2px solid var(--accent); margin-left: -2px; animation: vtblink 1s steps(1) infinite; }
.vt-sentence .t-bad { color: #c2570b; }
@keyframes vtblink { 50% { border-color: transparent; } }
.vt-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: auto;
}
.vt-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  cursor: pointer;
}
.vt-btn:hover { background: var(--accent); }
.vt-done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.vt-done .big {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--ink);
}
.vt-done .langs {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--ink-soft);
}
.vt-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
}


/* ---------- lightbox (native dialog) ---------- */

dialog#lb {
  margin: auto;
  border: none;
  padding: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 90vh;
  outline: none;
}
dialog#lb::backdrop {
  background: rgba(22, 24, 28, 0.88);
  backdrop-filter: blur(3px);
}
dialog#lb img {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 10px;
  cursor: zoom-out;
}
dialog#lb figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #d8dad5;
  padding: 12px 4px 0;
  text-align: center;
}
.gallery img { cursor: zoom-in; }


/* ---------- wide & embedded media (videos, YouTube, Vimeo) ---------- */

.mediafig { margin: 24px 0 0; }
.mediafig.gwide { width: 100%; }

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--ph-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ph);
}
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.phvid.sq { aspect-ratio: 1 / 1; object-fit: cover; }

@media (max-width: 760px) {
  .media-2col { grid-template-columns: 1fr; }
}


/* aligned grid gallery (even photo counts, no masonry holes) */
.gallery.grid2 {
  columns: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.gallery.grid2 figure { margin: 0; }
@media (max-width: 560px) {
  .gallery.grid2 { grid-template-columns: 1fr; }
}
