/* ==========================================================================
   Roberto Iriondo — Fractional CMO & Technical Marketing Advisor
   Dependency-free. System fonts only. Crisp white + authoritative blue.
   Developer/technical aesthetic: heavy sans headings, monospace metadata.
   ========================================================================== */

:root {
  --blue: #355877;
  --blue-deep: #24405a;
  --blue-press: #1b3247;
  --wash: #f4f7f9;
  --wash-2: #e9eef3;
  --panel: #f6f8fa;
  --ink: #10202e;
  --muted: #566573;
  --line: #dde5ec;
  --white: #ffffff;
  --code-key: #355877;
  --code-str: #2f7d54;
  --code-num: #9a5b1f;
  --maxw: 1140px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

/* Utilities ------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.eyebrow::before { content: "//"; color: var(--blue); opacity: 0.55; }
.mono { font-family: var(--mono); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

/* Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 650; font-size: 0.98rem;
  padding: 0.85rem 1.4rem; border-radius: 7px; border: 1.5px solid var(--blue);
  cursor: pointer; transition: background-color .18s ease, color .18s ease, transform .18s ease;
  text-decoration: none; line-height: 1; letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-fill { background: var(--blue); color: #fff; }
.btn-fill:hover { background: var(--blue-deep); color: #fff; }
.btn-fill:active { background: var(--blue-press); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--wash); }

/* Header / nav --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--mono); font-weight: 600; font-size: 1.02rem; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.nav-links a:hover { color: var(--blue); text-decoration: none; }
.nav-cta { padding: 0.55rem 1rem; font-size: 0.85rem; }

/* Hero ----------------------------------------------------------------- */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 6.2vw, 4.5rem); margin: 0 0 0.5rem; }
.hero .role { font-family: var(--sans); font-size: clamp(1.25rem, 2.5vw, 1.6rem); color: var(--blue); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.25rem; line-height: 1.22; }
.hero .lede { font-size: 1.18rem; color: var(--muted); max-width: 46ch; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 1.75rem; }
.hero-trust { font-size: 0.92rem; color: var(--muted); border-left: 3px solid var(--blue); padding-left: 0.9rem; }
.hero-trust strong { color: var(--ink); font-weight: 650; }

/* Profile console (JS-driven signature) -------------------------------- */
.console {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  overflow: hidden; box-shadow: 0 24px 48px -28px rgba(16,32,46,0.4);
  font-family: var(--mono);
}
.console-bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.7rem 1rem; background: var(--wash-2); border-bottom: 1px solid var(--line); }
.console-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #c6d0d9; }
.console-bar .fname { margin-left: 0.55rem; font-size: 0.76rem; color: var(--muted); }
.console-body { padding: 1.15rem 1.35rem 1.4rem; font-size: 0.86rem; line-height: 1.95; min-height: 340px; white-space: pre-wrap; word-break: break-word; }
.console .p { color: var(--muted); }
.console .k { color: var(--code-key); }
.console .s { color: var(--code-str); }
.console .n { color: var(--code-num); }
.console .c { color: var(--muted); opacity: 0.75; }
.console .cursor {
  display: inline-block; width: 8px; height: 1.05em; vertical-align: text-bottom;
  background: var(--blue); margin-left: 2px; animation: blink 1.05s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Sections ------------------------------------------------------------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--wash { background: var(--wash); border-block: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.95rem, 4vw, 2.85rem); margin: 0 0 0.75rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* Services ------------------------------------------------------------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.service {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.75rem; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.service:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 12px 30px -18px rgba(53,88,119,0.5); }
.service .num { font-family: var(--mono); font-size: 0.78rem; color: var(--blue); letter-spacing: 0.04em; }
.service h3 { font-size: 1.3rem; margin: 0.5rem 0 0.6rem; letter-spacing: -0.02em; }
.service p { color: var(--muted); font-size: 1rem; margin: 0; }

/* Track record (credential index) ------------------------------------- */
.ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.ledger-group h3 {
  font-family: var(--mono); font-size: 0.76rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--blue); margin: 0 0 1rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.ledger-group ul li {
  font-family: var(--sans); font-weight: 650; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink);
  padding: 0.5rem 0; border-bottom: 1px solid var(--wash-2);
}
.ledger-group ul li:last-child { border-bottom: 0; }
.ledger-group ul li span { display: block; font-family: var(--mono); font-weight: 400; font-size: 0.76rem; letter-spacing: 0; color: var(--muted); margin-top: 0.15rem; }

/* Launches ------------------------------------------------------------- */
.launches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.launch {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.launch:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(16,32,46,0.4); border-color: var(--blue); text-decoration: none; }
.launch img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--wash); }
.launch-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.launch-body h3 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 0.35rem; letter-spacing: -0.02em; }
.launch-body .blurb { font-size: 0.92rem; color: var(--muted); line-height: 1.5; margin: 0 0 0.6rem; }
.launch-body .src { font-family: var(--mono); font-size: 0.74rem; color: var(--blue); letter-spacing: 0.02em; margin-top: auto; }

/* Slider (Work in the wild + Featured posts) --------------------------- */
.slider { position: relative; }
.slider-track {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding: 0.25rem 0.25rem 1rem; margin: -0.25rem -0.25rem 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.slider-track::-webkit-scrollbar { height: 8px; }
.slider-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.slider-track::-webkit-scrollbar-track { background: transparent; }
.slider-track.launches { grid-template-columns: none; }
.slider-track .launch {
  scroll-snap-align: start; flex: 0 0 clamp(280px, 32%, 360px); min-width: 0;
}
.slider-nav { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.75rem; }
.slider-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 50%; color: var(--blue);
  cursor: pointer; transition: border-color .16s ease, background-color .16s ease, opacity .16s ease;
}
.slider-btn:hover { border-color: var(--blue); background: var(--wash); }
.slider-btn:disabled { opacity: 0.35; cursor: default; }
.slider-btn svg { width: 20px; height: 20px; }

/* About ---------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.4fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.about-portrait { position: relative; }
.about-portrait img { width: 100%; border-radius: 10px; border: 1px solid var(--line); aspect-ratio: 4 / 5; object-fit: cover; }
.about-portrait::after { content: ""; position: absolute; inset: 12px -12px -12px 12px; z-index: -1; border: 1.5px solid var(--blue); border-radius: 10px; }
.about-aside { margin-top: 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 1.25rem; }
.about-aside dl { margin: 0; display: grid; gap: 0.85rem; }
.about-aside dt { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); }
.about-aside dd { margin: 0.15rem 0 0; font-family: var(--sans); font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em; color: var(--ink); }
.about-body p { color: var(--muted); font-size: 1.08rem; }
.about-body p strong { color: var(--ink); font-weight: 650; }

/* FAQ ------------------------------------------------------------------ */
.faq { max-width: 800px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 2.5rem 1rem 0; position: relative;
  font-family: var(--sans); font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-weight: 400; font-size: 1.5rem; color: var(--blue); line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p { color: var(--muted); margin: 0 0 1rem; padding-right: 2rem; }

/* CTA / contact -------------------------------------------------------- */
.cta { text-align: center; }
.cta h2 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.75rem; }
.cta p { color: var(--muted); font-size: 1.15rem; max-width: 54ch; margin: 0 auto 2rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; margin-bottom: 1.75rem; }
.contact-line { font-family: var(--mono); font-size: 0.88rem; color: var(--muted); }
.contact-line a { color: var(--blue); }

/* Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-inner p { margin: 0; font-family: var(--mono); color: var(--muted); font-size: 0.82rem; }
.social { display: flex; gap: 0.5rem; }
.social a {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted); transition: all .18s ease;
}
.social a:hover { border-color: var(--blue); color: var(--blue); background: var(--wash); }
.social svg { width: 18px; height: 18px; }

/* Back to top ---------------------------------------------------------- */
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; width: 44px; height: 44px;
  background: var(--blue); color: #fff; border-radius: 50%; display: none;
  align-items: center; justify-content: center; box-shadow: 0 8px 22px -8px rgba(53,88,119,0.7); z-index: 40;
}
.to-top.show { display: inline-flex; }
.to-top:hover { background: var(--blue-deep); text-decoration: none; }
.to-top svg { width: 20px; height: 20px; }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: 1fr; gap: 1.75rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 320px; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .services { grid-template-columns: 1fr; }
  .launches { grid-template-columns: 1fr; }
}

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

/* Contact form -------------------------------------------------------- */
.contact-form { max-width: 720px; margin-inline: auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.03em; color: var(--ink); margin-bottom: 0.4rem;
}
.field .req { color: var(--blue); }
.field .opt { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--muted); letter-spacing: 0; }
.field input,
.field select,
.field textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 0.75rem 0.85rem; transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,88,119,0.12);
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23566573' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.4rem;
}
.field-consent { margin-top: 0.25rem; }
.consent { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; font-family: var(--sans); }
.consent input { width: auto; margin-top: 0.2rem; accent-color: var(--blue); }
.consent span { font-size: 0.95rem; color: var(--muted); line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.5rem; }
.form-status { font-family: var(--mono); font-size: 0.88rem; margin-top: 1rem; min-height: 1.2em; }
.form-status.ok { color: var(--code-str); }
.form-status.err { color: #b23b3b; }

/* FAQ toggle ----------------------------------------------------------- */
.faq-toggle { display: inline-flex; margin: 1.75rem auto 0; }
.faq { text-align: left; }
.faq > .faq-toggle { display: flex; width: max-content; margin-inline: auto; }

/* Footer legal links --------------------------------------------------- */
.footer-links { display: flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.82rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--blue); }
.footer-links .sep { color: var(--line); }

@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* Thanks note (easter egg above footer) -------------------------------- */
.thanks { padding: clamp(2rem, 5vw, 3.5rem) 0 0; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.thanks-console {
  max-width: 440px; margin-inline: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  font-family: var(--mono); opacity: 0.92;
}
.thanks-console .console-body {
  padding: 1.05rem 1.3rem 1.25rem; font-size: 0.8rem; line-height: 1.9;
  white-space: pre-wrap; word-break: break-word; min-height: 0;
}
.thanks-console .p { color: var(--muted); }
.thanks-console .k { color: var(--code-key); }
.thanks-console .s { color: var(--code-str); }
.thanks-console .c { color: var(--muted); opacity: 0.7; }

/* Why founders hire me ------------------------------------------------- */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.why-col h3 { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 0.9rem; }
.why-col p { color: var(--muted); font-size: 1.05rem; margin: 0 0 1rem; }
.why-col p strong { color: var(--ink); font-weight: 650; }
.flow { counter-reset: none; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.flow li {
  display: flex; gap: 1rem; align-items: baseline; padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.flow li:last-child { border-bottom: 0; }
.flow-n { font-family: var(--mono); font-size: 0.8rem; color: var(--blue); flex: 0 0 auto; letter-spacing: 0.04em; }
.flow-t { display: flex; flex-direction: column; gap: 0.15rem; }
.flow-t strong { font-family: var(--sans); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; color: var(--ink); }
.flow-t em { font-style: normal; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; gap: 2rem; }
}