/* Pierre Medina · Portafolio estático. Diseño responsivo sin frameworks ni fuentes externas. */
:root {
  color-scheme: dark;
  --bg: #0b1016;
  --bg-soft: #101720;
  --panel: #111a24;
  --panel-alt: #131e29;
  --text: #eaf0f1;
  --muted: #a4b2be;
  --quiet: #80909f;
  --line: #2a3541;
  --accent: #8bdfbc;
  --accent-ink: #081810;
  --accent-soft: rgba(139,223,188,.09);
  --container: 1180px;
  --radius: 8px;
}
/* Un atributo en HTML permite el modo claro sin duplicar estilos. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f7;
  --bg-soft: #f0f3f0;
  --panel: #ffffff;
  --panel-alt: #f6f8f6;
  --text: #16222b;
  --muted: #42525c;
  --quiet: #5c6b73;
  --line: #d9e0dc;
  --accent: #187752;
  --accent-ink: #ffffff;
  --accent-soft: rgba(24,119,82,.065);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--accent-ink); background: var(--accent); }
.shell { width: min(var(--container), calc(100% - 88px)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 1000; left: 20px; top: -100px; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.skip-link:focus { top: 12px; }

/* Encabezado estable, con navegación y alternancia de tema accesibles. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav-shell { display: flex; align-items: center; min-height: 76px; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 14px; margin-right: auto; font-size: 14px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: inline-flex; justify-content: center; align-items: center; width: 39px; height: 39px; background: var(--accent); color: var(--accent-ink); border-radius: 5px; letter-spacing: -.12em; font-size: 21px; padding-right: 3px; font-weight: 800; }
.brand-mark span { color: var(--accent-ink); }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 34px); }
.site-nav a, .theme-toggle { color: var(--muted); font-size: 12px; letter-spacing: .025em; font-weight: 600; }
.site-nav a:hover, .site-nav a:focus-visible, .theme-toggle:hover { color: var(--accent); }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 0 8px 18px; background: none; color: var(--muted); border: 0; border-left: 1px solid var(--line); cursor: pointer; }
.theme-toggle-icon { display: inline-block; font-size: 22px; line-height: 1; }

/* Cabecera editorial y pequeña tarjeta de principios. */
.hero { min-height: 695px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); align-items: center; gap: clamp(42px, 7vw, 100px); padding-block: 90px 110px; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; margin: 0 0 48px; }
.signal { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.eyebrow-separator { color: var(--quiet); }
.hero-label, .section-kicker, .project-category, .project-number, .project-state, .fact-label, .terminal-top, .terminal-comment, .terminal-foot, .hero-aside-caption, .architecture-figure figcaption, .node-index, .expertise-index { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.hero-label { color: var(--accent); font-size: 11px; letter-spacing: .105em; font-weight: 700; margin: 0 0 18px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.052em; line-height: 1.12; }
h1 { font-size: clamp(52px, 5.5vw, 82px); font-weight: 710; margin-bottom: 27px; }
h1 em, h2 em { color: var(--accent); font-style: normal; }
.hero-intro { max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.88; margin-bottom: 33px; }
.hero-actions, .hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: space-between; gap: 26px; border-radius: 5px; padding: 10px 20px; font-size: 12px; font-weight: 750; border: 1px solid var(--line); transition: background .15s ease, border-color .15s ease, color .15s ease; }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button-primary:hover { filter: brightness(1.1); }
.button-secondary { background: transparent; border-color: var(--line); color: var(--text); }
.button-secondary:hover { border-color: var(--accent); color: var(--accent); }
.hero-links { gap: 23px; margin-top: 31px; }
.hero-links a { color: var(--quiet); font-size: 12px; font-weight: 650; }
.hero-links a:hover { color: var(--accent); }
.hero-aside { margin-top: 62px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.08); }
.terminal-top { display: flex; align-items: center; gap: 16px; min-height: 45px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--quiet); font-size: 10px; }
.terminal-dots { display: inline-flex; gap: 5px; }
.terminal-dots i { width: 7px; height: 7px; border: 1px solid var(--quiet); border-radius: 50%; }
.terminal-right { margin-left: auto; }
.terminal-content { padding: 26px 25px 20px; font-size: 12px; line-height: 1.5; }
.terminal-content p { margin: 0 0 22px; }
.terminal-content p:not(.terminal-comment):not(.terminal-foot) { display: flex; flex-wrap: wrap; gap: 7px; }
.terminal-comment { color: var(--quiet); font-size: 11px; margin-bottom: 26px !important; }
.terminal-key { color: var(--quiet); padding-right: 6px; }
.terminal-accent { color: var(--accent); }
.terminal-rule { height: 1px; background: var(--line); margin: 7px 0 21px; }
.terminal-foot { font-size: 11px; color: var(--muted); margin: 0 !important; }
.terminal-prompt { color: var(--accent); margin-right: 8px; }
.cursor { color: var(--accent); }
.hero-aside-caption { display: flex; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 9px; letter-spacing: .045em; }
.hero-aside-caption span:last-child { color: var(--muted); }

/* Estructura general de secciones. */
.section { padding: 112px 0; border-top: 1px solid var(--line); }
.section-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(50px, 8vw, 136px); }
.section-kicker { display: flex; align-items: center; gap: 14px; color: var(--quiet); font-size: 11px; letter-spacing: .095em; font-weight: 650; margin-bottom: 25px; }
.section-kicker span { color: var(--accent); }
h2 { font-size: clamp(38px, 4vw, 58px); font-weight: 700; }
.section-heading h2 { max-width: 510px; }
.section-body p { color: var(--muted); line-height: 1.85; margin-bottom: 20px; }
.section-body p:first-child { color: var(--text); font-size: 18px; line-height: 1.77; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 38px; border-top: 1px solid var(--line); }
.fact-grid > div { display: flex; flex-direction: column; gap: 6px; padding: 20px 10px 23px 0; border-bottom: 1px solid var(--line); }
.fact-label { color: var(--quiet); font-size: 10px; letter-spacing: .06em; }
.fact-grid strong { color: var(--text); font-size: 13px; font-weight: 650; }

/* Proyectos con diagramas de arquitectura hechos solo con HTML y CSS. */
.work-section { background: var(--bg-soft); }
.section-intro { display: flex; justify-content: space-between; align-items: end; gap: 60px; margin-bottom: 42px; }
.section-intro h2 { margin-bottom: 0; }
.section-intro > p { color: var(--muted); font-size: 14px; max-width: 390px; margin-bottom: 6px; line-height: 1.9; }
.project { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); }
.project-featured { padding: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 52px; margin-bottom: 17px; }
.project-topline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.project-number { color: var(--quiet); font-size: 10px; letter-spacing: .07em; }
.project-state { font-size: 10px; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.state-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.project-state-muted { color: var(--quiet); }
.project-category { font-size: 10px; color: var(--accent); letter-spacing: .075em; margin-bottom: 14px; }
.project h3 { font-size: clamp(29px, 3vw, 45px); font-weight: 680; margin-bottom: 18px; }
.project-summary { color: var(--muted); font-size: 14px; line-height: 1.85; max-width: 480px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tag-list span { border: 1px solid var(--line); color: var(--muted); border-radius: 4px; padding: 5px 9px; font-size: 10px; font-weight: 600; }
.project-actions { margin-top: 34px; }
.text-link { color: var(--accent); font-size: 13px; font-weight: 750; display: inline-flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--accent); padding-bottom: 5px; }
.text-link:hover { color: var(--text); border-color: var(--text); }
.project-side { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.architecture-figure { margin: 0; border: 1px solid var(--line); border-radius: 6px; padding: 21px; background: var(--bg); }
.architecture-figure figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--quiet); font-size: 9px; letter-spacing: .06em; margin-bottom: 23px; }
.architecture-figure figcaption span:first-child { color: var(--accent); }
.flow-diagram { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 0; margin: 0; }
.flow-diagram li { min-height: 92px; display: flex; flex-direction: column; justify-content: center; padding: 16px; background: var(--panel-alt); border: 1px solid var(--line); border-radius: 4px; position: relative; }
.flow-diagram li:nth-child(1)::after, .flow-diagram li:nth-child(3)::after { content: '→'; position: absolute; right: -19px; top: calc(50% - 14px); color: var(--accent); font-size: 19px; }
.flow-diagram li:nth-child(2)::after { content: '↙'; position: absolute; bottom: -28px; left: calc(50% - 7px); color: var(--accent); font-size: 19px; }
.node-index { color: var(--accent); font-size: 9px; letter-spacing: .09em; margin-bottom: 7px; }
.flow-diagram strong { font-size: 12px; font-weight: 650; letter-spacing: -.02em; }
.flow-diagram small { font-size: 10px; color: var(--quiet); margin-top: 5px; }
.case-detail { border-top: 1px solid var(--line); margin-top: 4px; }
.case-detail summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 0 0; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.case-detail summary::-webkit-details-marker { display: none; }
.case-detail summary span { color: var(--accent); font-size: 18px; line-height: 1; }
.case-detail[open] summary span { transform: rotate(45deg); }
.case-detail > div { color: var(--muted); font-size: 12px; line-height: 1.75; padding-top: 12px; }
.case-detail > div p { margin: 0 0 12px; }
.case-detail > div strong { color: var(--text); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.project-card { padding: 29px 25px 24px; display: flex; flex-direction: column; }
.project-card .project-topline { margin-bottom: 42px; }
.project-card h3 { font-size: clamp(28px, 2.55vw, 37px); }
.project-card .project-summary { font-size: 13px; margin-bottom: 0; }
.project-card .tag-list { margin: 22px 0; }
.project-card .architecture-figure { margin-top: auto; }
.architecture-small { padding: 15px; }
.architecture-small figcaption { font-size: 8px; margin-bottom: 17px; }
.flow-diagram-small { gap: 14px; }
.flow-diagram-small li { min-height: 62px; padding: 9px 8px; text-align: center; }
.flow-diagram-small li strong { font-size: 10px; }
.flow-diagram-small li:nth-child(1)::after, .flow-diagram-small li:nth-child(3)::after { right: -13px; font-size: 15px; }
.flow-diagram-small li:nth-child(2)::after { bottom: -22px; font-size: 15px; }
.project-card .case-detail { margin-top: 20px; }

/* Experiencia agrupada por problemas; no barras de nivel arbitrarias. */
.expertise-section { border-top: 1px solid var(--line); }
.section-heading-note { color: var(--muted); font-size: 14px; max-width: 330px; line-height: 1.85; margin-top: 28px; }
.expertise-list { border-top: 1px solid var(--line); }
.expertise-item { padding: 26px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 46px 1fr; gap: 10px; }
.expertise-index { color: var(--accent); font-size: 11px; }
.expertise-item h3 { font-size: 21px; font-weight: 670; letter-spacing: -.04em; margin: 0 0 9px; }
.expertise-item p { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0; }

/* CTA de contacto, sin procesar datos ni depender de un backend. */
.contact-section { padding: 105px 0; background: var(--panel); border-block: 1px solid var(--line); }
.contact-content { display: flex; justify-content: space-between; align-items: end; gap: 35px; }
.contact-content h2 { font-size: clamp(44px, 4.8vw, 70px); }
.contact-content p:not(.section-kicker) { color: var(--muted); max-width: 610px; margin-bottom: 0; font-size: 14px; line-height: 1.9; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; padding-bottom: 6px; }
.button-large { min-width: 210px; min-height: 57px; font-size: 13px; }
.contact-actions > span { color: var(--quiet); font-size: 12px; }
.site-footer { padding: 30px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.footer-inner > span, .footer-inner a { color: var(--quiet); font-size: 11px; }
.footer-inner > div { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-inner a:hover { color: var(--accent); }

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 10px; min-height: auto; }
  .hero-aside { max-width: 560px; margin-top: 34px; }
  .section-grid { gap: 56px; }
  .project-featured { gap: 32px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 740px) {
  .shell { width: min(100% - 40px, var(--container)); }
  .nav-shell { min-height: 68px; gap: 14px; flex-wrap: wrap; padding-block: 10px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .site-nav { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
  .site-nav a { font-size: 11px; }
  .theme-toggle { margin-left: auto; }
  .hero { padding-block: 54px 70px; }
  .eyebrow { margin-bottom: 33px; font-size: 11px; }
  .hero-label { font-size: 10px; }
  h1 { font-size: clamp(43px, 10vw, 66px); }
  .hero-intro { font-size: 15px; }
  .hero-aside { width: 100%; }
  .section { padding-block: 78px; }
  .section-grid { grid-template-columns: 1fr; gap: 25px; }
  .section-heading h2 { max-width: 630px; }
  .section-intro { display: block; margin-bottom: 34px; }
  .section-intro > p { max-width: 600px; margin-top: 22px; }
  .project-featured { grid-template-columns: 1fr; padding: 27px 23px; }
  .project-featured .project-topline { margin-bottom: 34px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card:last-child { grid-column: auto; }
  .project-card { padding: 27px 23px; }
  .contact-content { align-items: flex-start; flex-direction: column; gap: 28px; }
  .contact-content h2 { font-size: clamp(43px, 10vw, 60px); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 390px) {
  .shell { width: calc(100% - 30px); }
  .brand-name { display: none; }
  h1 { font-size: 42px; }
  .button { gap: 12px; padding-inline: 13px; }
  .hero-actions { gap: 8px; }
  .hero-links { gap: 16px; }
  .fact-grid { grid-template-columns: 1fr; }
  .flow-diagram li { padding: 12px 8px; }
  .flow-diagram strong { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
