/* Francisco Miranda — personal technical notebook */
:root {
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --paper: #f4f5ef;
  --surface: #fafbf7;
  --ink: #172019;
  --muted: #667068;
  --faint: #8e9890;
  --line: #cfd5cf;
  --line-strong: #aeb8b0;
  --green: #087331;
  --green-bright: #39ff64;
  --green-soft: #e4eee6;
  --header: rgba(244, 245, 239, 0.92);
  --measure: 1080px;
  --radius: 2px;
}

[data-theme="dark"] {
  --paper: #0a0e0b;
  --surface: #101512;
  --ink: #e8eee9;
  --muted: #9aa69d;
  --faint: #6f7b72;
  --line: #273029;
  --line-strong: #3a463c;
  --green: #39ff64;
  --green-bright: #39ff64;
  --green-soft: #13251a;
  --header: rgba(10, 14, 11, 0.92);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: color 160ms ease, background 160ms ease;
}

::selection { color: var(--paper); background: var(--green); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
a:hover { color: var(--green); text-decoration-color: currentColor; }
img { max-width: 100%; }
button { font: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-150%);
  padding: 8px 12px;
  color: var(--paper);
  background: var(--green);
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(calc(100% - 40px), var(--measure)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav-container { min-height: 68px; display: flex; align-items: center; gap: 28px; }
.brand {
  margin-right: auto;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover { color: var(--green); text-decoration: none; }
.brand-prompt { color: inherit; }
.nav-links, .mobile-nav-links, .footer-nav { margin: 0; padding: 0; list-style: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-link {
  display: block;
  padding: 22px 0 19px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active, .nav-link[aria-current="page"] { color: var(--green); border-color: var(--green); }
.nav-link.active::before { content: none; }
.nav-actions { display: flex; gap: 8px; }
.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.btn-icon:hover { color: var(--green); border-color: var(--green); }
.menu-toggle { display: none; }
.language-toggle {
  min-width: 42px;
  height: 36px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.language-toggle:hover { color: var(--green); border-color: var(--green); }
.mobile-nav { display: none; border-top: 1px solid var(--line); }
.mobile-nav.open { display: block; }
.mobile-nav-links { padding: 10px 20px 18px; }
.mobile-nav-links a { display: block; padding: 8px 0; color: var(--muted); text-decoration: none; }
.mobile-nav-links a.active, .mobile-nav-links a[aria-current="page"] { color: var(--green); }

main { flex: 1; padding: 72px 0 96px; }

/* Intro and portrait */
.profile-hero {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  align-items: end;
  gap: clamp(40px, 7vw, 88px);
  margin-bottom: 104px;
}
.profile-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
  object-position: 50% 24%;
  filter: saturate(0.86) contrast(1.02);
}
.hero-copy { padding-bottom: 6px; }
.eyebrow {
  margin: 0 0 20px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-name, .page-title {
  margin: 0;
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(2.65rem, 7vw, 5.8rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.92;
}
.hero-role {
  margin: 24px 0 0;
  max-width: 620px;
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.hero-bio-text, .page-summary {
  margin: 24px 0 0;
  max-width: 650px;
  color: var(--muted);
  font-size: 1rem;
}
.hero-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px; }
.text-link {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
}
.text-link::after { content: " ↗"; color: var(--green); }
.text-link:hover { color: var(--green); }
.personal-note {
  grid-column: 2;
  margin: -50px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.page-intro { margin: 8px 0 96px; }
.page-intro .page-title { max-width: 900px; }
.page-intro .page-summary { max-width: 720px; font-size: 1.1rem; }

/* Sections */
.section-block { margin: 0 0 96px; }
.section-titlebar {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
  margin: 0 0 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}
.section-heading, .section-prompt {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 740;
  letter-spacing: -0.02em;
}
.section-prompt::before { content: none; }
.section-meta-tag {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  margin: 0;
  padding: 28px 0 30px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.item-card:hover { background: transparent; border-color: var(--line); }
.item-header { display: block; margin: 0; }
.item-title { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 720; line-height: 1.35; }
.item-subtitle { margin: 6px 0 0; color: var(--green); font-size: 0.82rem; font-weight: 620; line-height: 1.4; }
.item-date { display: block; margin-top: 9px; padding: 0; color: var(--faint); background: transparent; border: 0; font-family: var(--mono); font-size: 0.7rem; }
.item-body { color: var(--muted); font-size: 0.94rem; }
.item-body p { margin: 0 0 12px; }
.item-body p:last-child { margin-bottom: 0; }
.item-body ul { margin: 10px 0 0; padding-left: 18px; }
.item-body li { padding: 0; }
.item-body li::before { content: none; }
.detail-summary { color: var(--ink); font-weight: 580; }
.detail-list { margin-top: 14px !important; }
.detail-list li { padding-left: 3px; line-height: 1.6; }
.detail-list li + li { margin-top: 8px; }
.detail-list li::marker { color: var(--green); }
.tags-row { grid-column: 2; display: flex; flex-wrap: wrap; gap: 7px 14px; margin: -12px 0 0; }
.tech-tag, .tech-tag.accent {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.69rem;
}
.tech-tag::before { content: "· "; color: var(--green); }
.item-card > div[style*="margin-top"] { grid-column: 2; margin-top: -8px !important; }

/* Buttons are used only for primary document actions */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--green); border-color: var(--green); text-decoration: none; }
.btn-primary { color: var(--paper); background: var(--green); border-color: var(--green); }
.btn-primary:hover { color: var(--paper); background: var(--green); filter: brightness(0.94); }
.citation {
  padding-left: 18px;
  border-left: 2px solid var(--green);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.65;
}

/* Skills */
.skills-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.skill-category-card { padding: 24px 0 28px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.skill-cat-title { margin: 0 0 12px; color: var(--ink); font-family: var(--sans); font-size: 0.9rem; font-weight: 720; }
.skill-category-card .tags-row { display: flex; margin: 0; }

/* Projects */
.project-showcase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 38px; }
.showcase-card { display: block; min-width: 0; background: transparent; border: 0; border-radius: 0; overflow: visible; }
.showcase-card:hover { background: transparent; border: 0; box-shadow: none; transform: none; }
.showcase-card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
  filter: saturate(0.82);
  transition: filter 180ms ease;
}
.showcase-card-img.is-diagram {
  object-fit: contain;
  background: #0d1117;
}
.showcase-card:hover .showcase-card-img { filter: saturate(1); }
.showcase-card-body { display: block; padding: 18px 0 0; }
.showcase-cat-badge { display: block; margin: 0 0 8px; color: var(--green); font-family: var(--mono); font-size: 0.68rem; font-weight: 650; letter-spacing: 0.04em; }
.showcase-title { margin: 0; color: var(--ink); font-size: 1.22rem; font-weight: 740; letter-spacing: -0.025em; }
.showcase-desc { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.showcase-card .tags-row { display: flex; margin: 14px 0 0; }
.showcase-actions { display: flex; gap: 18px; margin-top: 18px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.action-link { color: var(--ink); font-family: var(--mono); font-size: 0.72rem; font-weight: 650; text-decoration: none; }
.action-link:hover { color: var(--green); }
.page-projects .section-block:last-of-type > div[style] {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 34px !important;
}
.page-projects .section-block:last-of-type .item-card {
  display: block;
  padding-top: 20px;
}
.page-projects .section-block:last-of-type .tags-row,
.page-projects .section-block:last-of-type .item-card > div[style*="margin-top"] {
  margin-top: 14px !important;
}

/* Media */
.video-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 18px 0; overflow: hidden; background: #000; border: 1px solid var(--line); border-radius: 0; }
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-illustration { margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.article-illustration a { display: block; }
.article-illustration img { width: 100%; max-height: 520px; display: block; object-fit: contain; }
.illustration-caption { padding: 8px 12px; color: var(--faint); background: transparent; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.68rem; }

/* Footer */
.site-footer { margin-top: auto; padding: 28px 0; background: transparent; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--faint); font-family: var(--mono); font-size: 0.68rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--green); }
.toast-notice { position: fixed; right: 20px; bottom: 20px; z-index: 1000; padding: 9px 12px; color: var(--paper); background: var(--green); font-family: var(--mono); font-size: 0.72rem; opacity: 0; transform: translateY(8px); pointer-events: none; transition: 160ms ease; }
.toast-notice.show { opacity: 1; transform: none; }

/* Legacy terminal markup is deliberately neutralized while pages migrate. */
.terminal-window { margin: 0 0 96px; background: transparent; border: 0; box-shadow: none; }
.terminal-titlebar, .terminal-dots, .hero-status-pill { display: none; }
.terminal-body { padding: 0; }
.hero-layout { display: grid; grid-template-columns: minmax(220px, 310px) minmax(0, 1fr); gap: clamp(40px, 7vw, 88px); align-items: end; }
.hero-avatar { width: 100%; height: auto; aspect-ratio: 3 / 4; display: block; object-fit: cover; object-position: 50% 24%; border: 0; border-radius: 0; filter: saturate(0.86); }
.hero-prompt-line { display: none; }
.hero-tagline { margin: 22px 0 0; color: var(--ink); font-family: var(--sans); font-size: 1.35rem; font-weight: 560; }
.hero-tagline::first-letter { color: inherit; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--measure)); }
  .nav-container { min-height: 60px; }
  .nav-links { display: none; }
  .menu-toggle { display: inline-grid; }
  main { padding: 44px 0 72px; }
  .profile-hero, .hero-layout { grid-template-columns: 1fr; gap: 34px; align-items: start; }
  .profile-photo, .hero-avatar { width: min(72vw, 300px); }
  .hero-name, .page-title { font-size: clamp(2.65rem, 15vw, 4.6rem); }
  .personal-note { grid-column: 1; margin: 0; }
  .page-intro, .terminal-window { margin-bottom: 68px; }
  .section-block { margin-bottom: 72px; }
  .section-titlebar, .item-card { grid-template-columns: 1fr; gap: 12px; }
  .tags-row, .item-card > div[style*="margin-top"] { grid-column: 1; margin-top: 2px !important; }
  .project-showcase-grid, .skills-container { grid-template-columns: 1fr; }
  .project-showcase-grid { gap: 52px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .page-projects .section-block:last-of-type > div[style] {
    grid-template-columns: 1fr !important;
  }
}

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