/* ==========================================================================
   OLVIN DUARTE — "FICHA TÉCNICA"
   Sistema visual tipo plano de ingeniería / datasheet / bitácora de laboratorio.
   ========================================================================== */

:root {
    --navy: #0b1e33;
    --navy-deep: #06121f;
    --navy-soft: #10263f;
    --paper: #f5efe1;
    --paper-deep: #ece3cf;
    --paper-ink: #1c2b3d;
    --line: rgba(148, 197, 255, 0.22);
    --line-strong: rgba(148, 197, 255, 0.42);
    --trace: #5eead4;
    --trace-2: #7dd3fc;
    --copper: #fb923c;
    --copper-soft: rgba(251, 146, 60, 0.16);
    --text: #edf3ff;
    --muted: #93a8c6;
    --muted-paper: #5c6b80;
    --radius: 4px;
    --font-display: "Fraunces", "Georgia", serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
    --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--navy);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

::selection { background: var(--trace); color: var(--navy-deep); }

/* -------------------------------------------------------------------------
   TEXTURA DE PAPEL CUADRICULADO
   ------------------------------------------------------------------------- */

.grid-field {
    position: relative;
}

.grid-field::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 92%);
    mask-image: linear-gradient(to bottom, black, transparent 92%);
    pointer-events: none;
}

.sheet-paper {
    background: var(--paper);
    color: var(--paper-ink);
}

.sheet-paper::before {
    background-image:
        linear-gradient(rgba(28, 43, 61, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 43, 61, 0.08) 1px, transparent 1px);
    -webkit-mask-image: none;
    mask-image: none;
}

/* -------------------------------------------------------------------------
   TIPOGRAFÍA / MARCAS DE PLANO
   ------------------------------------------------------------------------- */

.mono {
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.eyebrow-line {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--trace);
}

.sheet-paper .eyebrow-line { color: #b45309; }

.eyebrow-line::before {
    content: "";
    width: 26px;
    height: 1px;
    background: currentColor;
}

.eyebrow-line .tick {
    opacity: 0.6;
}

.display-heading {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.02;
}

.display-heading em {
    font-style: italic;
    font-weight: 500;
    color: var(--trace);
}

.sheet-paper .display-heading em { color: #b45309; }

.sheet-copy {
    color: var(--muted);
    line-height: 1.75;
    max-width: 54ch;
}

.sheet-paper .sheet-copy { color: var(--muted-paper); }

.sheet-number {
    position: absolute;
    top: 2rem;
    right: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.sheet-paper .sheet-number { color: var(--muted-paper); }

/* -------------------------------------------------------------------------
   NAV
   ------------------------------------------------------------------------- */

.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
    background: rgba(6, 18, 31, 0.62);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.site-nav.is-scrolled {
    background: rgba(6, 18, 31, 0.92);
    border-color: var(--line-strong);
}

.nav-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text);
}

.nav-mark .cursor {
    display: inline-block;
    width: 9px;
    height: 1.05rem;
    background: var(--trace);
    animation: blink 1.15s steps(1) infinite;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.1rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0.3rem 0;
}

.nav-links a::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--trace);
    transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before {
    width: 100%;
}

.nav-links .nav-cta {
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--trace);
}

.nav-links .nav-cta::before { display: none; }

.nav-links .nav-cta:hover {
    background: rgba(94, 234, 212, 0.1);
    color: var(--text);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* -------------------------------------------------------------------------
   BOTONES
   ------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-plug {
    background: var(--trace);
    color: var(--navy-deep);
}

.btn-plug:hover {
    transform: translateY(-2px);
    background: #8ff2e1;
}

.btn-outline {
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--trace);
    color: var(--trace);
    transform: translateY(-2px);
}

.sheet-paper .btn-outline {
    border-color: rgba(28, 43, 61, 0.3);
    color: var(--paper-ink);
}

.sheet-paper .btn-outline:hover {
    border-color: #b45309;
    color: #b45309;
}

/* -------------------------------------------------------------------------
   HERO
   ------------------------------------------------------------------------- */

.hero {
    position: relative;
    padding: clamp(7rem, 14vw, 9.5rem) clamp(1.25rem, 4vw, 3rem) clamp(4rem, 8vw, 6rem);
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: end;
    max-width: 1320px;
    margin: 0 auto;
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--trace);
}

.hero-kicker .dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

.hero-title {
    font-size: clamp(2.6rem, 6.6vw, 5.4rem);
    max-width: 15ch;
}

.hero-lede {
    margin-top: 1.6rem;
    max-width: 46ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2.1rem;
}

.hero-panel {
    position: relative;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(16, 38, 63, 0.55);
    padding: 1.4rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.84rem;
}

.hero-panel .panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed var(--line-strong);
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-panel .panel-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    color: var(--text);
}

.hero-panel .panel-row span:first-child {
    color: var(--muted);
}

.hero-panel .panel-row strong {
    color: var(--trace);
    font-weight: 500;
    text-align: right;
}

.corner-frame {
    position: relative;
}

.corner-frame::before,
.corner-frame::after,
.corner-frame > .cf-tr,
.corner-frame > .cf-br {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--trace);
    opacity: 0.85;
    pointer-events: none;
}

.corner-frame::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.corner-frame::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.corner-frame > .cf-tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.corner-frame > .cf-br { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }

/* -------------------------------------------------------------------------
   SECCIONES / RITMO
   ------------------------------------------------------------------------- */

.sheet {
    position: relative;
    padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 4vw, 3rem);
}

.sheet-inner {
    max-width: 1320px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.sheet-header {
    max-width: 62ch;
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

/* -------------------------------------------------------------------------
   ESQUEMA — SOBRE MÍ
   ------------------------------------------------------------------------- */

.schema-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.schema-copy p {
    text-align: justify;
    hyphens: auto;
}

.schema-copy p + p { margin-top: 1rem; }

.schema-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.6rem;
}

.schema-tags span {
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(28, 43, 61, 0.22);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted-paper);
}

.schema-diagram {
    position: relative;
    width: 100%;
    aspect-ratio: 6 / 5;
}

.schema-diagram svg { width: 100%; height: 100%; }

.trace-path {
    fill: none;
    stroke: var(--trace-2);
    stroke-width: 1.6;
    stroke-dasharray: 6 6;
    opacity: 0.55;
}

.trace-pulse {
    fill: none;
    stroke: var(--trace);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-dasharray: 14 320;
    stroke-dashoffset: 334;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.schema-diagram.is-visible .trace-pulse {
    opacity: 1;
    animation: dash-travel 3.6s linear infinite;
}

.schema-node circle {
    fill: var(--navy);
    stroke: var(--trace-2);
    stroke-width: 1.6;
}

.schema-node.hub circle {
    fill: var(--copper);
    stroke: var(--copper);
}

.schema-node text {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--muted-paper);
    letter-spacing: 0.03em;
}

.schema-node.hub text {
    fill: var(--paper-ink);
    font-weight: 600;
    font-size: 12px;
}

@keyframes dash-travel {
    to { stroke-dashoffset: 0; }
}

/* -------------------------------------------------------------------------
   TARJETAS BLUEPRINT (proyectos)
   ------------------------------------------------------------------------- */

.blueprint-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 230px;
    grid-auto-flow: dense;
    gap: 1.1rem;
}

.blueprint-card {
    position: relative;
    overflow: hidden;
    grid-column: span 3;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--navy-soft);
}

.blueprint-card.is-lead {
    grid-column: span 4;
}

.blueprint-card.is-support {
    grid-column: span 2;
}

.blueprint-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92) contrast(1.02);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.blueprint-card:hover img {
    transform: scale(1.045);
    filter: saturate(1.05) contrast(1.05);
}

.blueprint-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 18, 31, 0.05) 30%, rgba(6, 18, 31, 0.92) 100%);
    z-index: 1;
}

.blueprint-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(6, 18, 31, 0.55);
    backdrop-filter: blur(8px);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--trace);
}

.blueprint-copy {
    position: absolute;
    z-index: 2;
    left: 1.3rem;
    right: 1.3rem;
    bottom: 1.2rem;
    color: var(--text);
}

.blueprint-copy h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    letter-spacing: -0.01em;
}

.blueprint-copy p {
    margin: 0;
    max-width: 52ch;
    color: rgba(237, 243, 255, 0.78);
    font-size: 0.92rem;
    line-height: 1.55;
}

.blueprint-copy .arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--trace);
}

.blueprint-card.is-cta {
    display: flex;
    align-items: flex-end;
    background:
        radial-gradient(circle at 15% 10%, rgba(94, 234, 212, 0.16), transparent 55%),
        radial-gradient(circle at 90% 90%, rgba(251, 146, 60, 0.14), transparent 55%),
        var(--navy-soft);
}

.blueprint-card.is-cta .blueprint-copy { position: static; padding: 1.3rem; }

/* -------------------------------------------------------------------------
   BITÁCORA (blog teaser + índice)
   ------------------------------------------------------------------------- */

.log-list {
    display: flex;
    flex-direction: column;
}

.log-entry {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    gap: clamp(1rem, 3vw, 2.5rem);
    align-items: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
}

.log-list .log-entry:last-child { border-bottom: 1px solid var(--line); }

.sheet-paper .log-entry { border-top-color: rgba(28, 43, 61, 0.15); }
.sheet-paper .log-list .log-entry:last-child { border-bottom-color: rgba(28, 43, 61, 0.15); }

.log-timestamp {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.sheet-paper .log-timestamp { color: var(--muted-paper); }

.log-body h3 {
    margin: 0 0 0.3rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    color: var(--text);
}

.sheet-paper .log-body h3 { color: var(--paper-ink); }

.log-body p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    max-width: 62ch;
}

.sheet-paper .log-body p { color: var(--muted-paper); }

.log-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.log-go {
    justify-self: end;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--trace);
    white-space: nowrap;
}

.sheet-paper .log-go { color: #b45309; }

/* -------------------------------------------------------------------------
   COMPONENT LEGEND (stack tecnico)
   ------------------------------------------------------------------------- */

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 38, 63, 0.4);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.legend-item:hover {
    border-color: var(--line-strong);
    background: rgba(16, 38, 63, 0.7);
    transform: translateY(-2px);
}

.legend-index {
    color: var(--trace);
    opacity: 0.7;
    font-size: 0.72rem;
}

.legend-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* -------------------------------------------------------------------------
   TERMINAL DE CONEXIÓN (contacto)
   ------------------------------------------------------------------------- */

.terminal-block {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.terminal-intro p {
    text-align: justify;
    hyphens: auto;
}

.terminal-intro p + p { margin-top: 1rem; }

.terminal-meta {
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.terminal-meta a {
    color: var(--trace);
}

.terminal-meta a:hover { text-decoration: underline; }

.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.social-row a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 38, 63, 0.4);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.social-row a svg {
    width: 15px;
    height: 15px;
    flex: none;
    display: block;
}

.social-row a:hover {
    border-color: var(--trace);
    color: var(--trace);
    background: rgba(94, 234, 212, 0.08);
    transform: translateY(-2px);
}

.terminal-form {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(6, 18, 31, 0.5);
    padding: clamp(1.4rem, 3vw, 2.2rem);
}

.terminal-form .field {
    margin-bottom: 1.15rem;
}

.terminal-form label {
    display: block;
    margin-bottom: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.terminal-form input,
.terminal-form textarea {
    width: 100%;
    padding: 0.78rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--navy-deep);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: vertical;
}

.terminal-form input::placeholder,
.terminal-form textarea::placeholder {
    color: rgba(147, 168, 198, 0.55);
}

.terminal-form input:focus,
.terminal-form textarea:focus {
    outline: none;
    border-color: var(--trace);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.14);
}

.terminal-form .btn { width: 100%; justify-content: center; margin-top: 0.3rem; }

.form-note {
    margin-top: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted);
}

.alert-line {
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.alert-line.ok {
    border: 1px solid rgba(94, 234, 212, 0.4);
    color: var(--trace);
    background: rgba(94, 234, 212, 0.08);
}

.alert-line.err {
    border: 1px solid rgba(251, 113, 133, 0.4);
    color: #fda4af;
    background: rgba(251, 113, 133, 0.08);
}

/* -------------------------------------------------------------------------
   MODAL (sin dependencias)
   ------------------------------------------------------------------------- */

.modal-veil {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(6, 18, 31, 0.72);
    backdrop-filter: blur(4px);
}

.modal-veil.is-open { display: flex; }

.modal-box {
    width: min(420px, 100%);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--navy-soft);
    padding: 1.6rem;
}

.modal-box h3 {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
}

.modal-box p {
    margin: 0 0 1.3rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 0.7rem;
    justify-content: flex-end;
}

/* -------------------------------------------------------------------------
   FOOTER — BARRA DE ESTADO
   ------------------------------------------------------------------------- */

.status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
    border-top: 1px solid var(--line);
    background: var(--navy-deep);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted);
}

.status-bar .status-left,
.status-bar .status-right {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.status-bar .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
    display: inline-block;
    margin-right: 0.4rem;
}

.status-bar a:hover { color: var(--trace); }

/* -------------------------------------------------------------------------
   BLOG — ÍNDICE Y DETALLE
   ------------------------------------------------------------------------- */

.blog-hero-sheet {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
}

.blog-hero-sheet .frame-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
}

.blog-hero-sheet .frame-img img {
    width: 100%; height: 100%; object-fit: cover;
}

.search-row {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}

.search-row input {
    flex: 1;
    min-width: 220px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--navy-soft);
    color: var(--text);
    font-family: var(--font-body);
}

.search-row input::placeholder { color: var(--muted); }

.search-row input:focus {
    outline: none;
    border-color: var(--trace);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 2.2rem;
}

.tag-chip {
    padding: 0.38rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.tag-chip.active,
.tag-chip:hover {
    border-color: var(--trace);
    color: var(--trace);
}

.sheet-paper .tag-chip {
    border-color: rgba(28, 43, 61, 0.22);
    color: var(--muted-paper);
}

.sheet-paper .tag-chip.active,
.sheet-paper .tag-chip:hover {
    border-color: #b45309;
    color: #b45309;
}

.post-header {
    max-width: 74ch;
}

.post-header h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    margin-bottom: 0.8rem;
}

.post-hero-frame {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 70vh;
}

.post-hero-frame img { width: 100%; height: 100%; object-fit: cover; }

.post-body {
    max-width: 74ch;
    margin: 0 auto;
    font-size: 1.06rem;
    line-height: 1.85;
    color: rgba(237, 243, 255, 0.92);
}

.post-body p {
    margin-bottom: 1.2rem;
    text-align: justify;
    hyphens: auto;
}

.post-body h2, .post-body h3 { font-family: var(--font-display); color: var(--trace); }

.post-body img { border-radius: var(--radius); margin: 1.5rem 0; }

.related-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 3rem;
}

.related-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy-soft);
    color: var(--text);
}

.related-card .frame-img { aspect-ratio: 16/10; overflow: hidden; }
.related-card .frame-img img { width: 100%; height: 100%; object-fit: cover; }
.related-card .related-body { padding: 1rem; }
.related-card h4 { margin: 0 0 0.5rem; font-family: var(--font-display); font-size: 1.05rem; }

/* -------------------------------------------------------------------------
   REVEAL / MOVIMIENTO
   ------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes blink {
    0%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

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

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .nav-links {
        position: fixed;
        inset: 64px 0 auto 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 1.5rem;
        background: rgba(6, 18, 31, 0.97);
        border-bottom: 1px solid var(--line);
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .nav-links.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links li { width: 100%; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); }
    .nav-links li:last-child { border-bottom: 0; }
    .nav-links .nav-cta { display: inline-block; margin-top: 0.6rem; }

    .nav-toggle { display: flex; }

    .hero-grid,
    .schema-layout,
    .terminal-block,
    .blog-hero-sheet {
        grid-template-columns: 1fr;
    }

    .schema-diagram { max-width: 420px; margin: 0 auto; }

    .blueprint-card.is-lead { grid-column: span 6; grid-row: span 2; }
    .blueprint-card.is-support,
    .blueprint-card.is-cta { grid-column: span 3; }

    .log-entry { grid-template-columns: minmax(0,1fr); }
    .log-go { justify-self: start; }
}

@media (max-width: 575.98px) {
    .blueprint-grid { grid-auto-rows: 220px; }
    .blueprint-card.is-lead,
    .blueprint-card.is-support,
    .blueprint-card.is-cta { grid-column: span 6; }
    .blueprint-card.is-lead { grid-row: span 2; }

    .hero-actions .btn { width: 100%; justify-content: center; }
}




