:root {
  --bg: #06101b;
  --bg-soft: #0a1725;
  --panel: #0d1d2e;
  --panel-2: #102338;
  --line: rgba(154, 190, 219, .16);
  --line-strong: rgba(120, 222, 255, .3);
  --text: #edf7ff;
  --muted: #9fb4c6;
  --cyan: #52d6ff;
  --cyan-strong: #13bfe9;
  --green: #69e6a6;
  --amber: #ffc768;
  --danger: #ff7f8b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .32);
  --radius: 22px;
  --radius-sm: 14px;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(36, 177, 229, .12), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; transform: translateY(-150%); padding: 10px 16px; color: #001018; background: var(--cyan); border-radius: 10px; }
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid transparent;
  background: rgba(6, 16, 27, .72);
  backdrop-filter: blur(18px);
  transition: border-color .2s ease, background .2s ease;
}
.site-header.is-scrolled { border-color: var(--line); background: rgba(6, 16, 27, .92); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: 14px; background: linear-gradient(145deg, rgba(82, 214, 255, .15), rgba(82, 214, 255, .03)); box-shadow: inset 0 0 25px rgba(82, 214, 255, .06); }
.brand-mark svg { width: 31px; fill: var(--bg); stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { padding: 10px 13px; color: var(--muted); border-radius: 10px; font-size: .94rem; font-weight: 650; transition: color .2s, background .2s; }
.main-nav a:hover, .main-nav a.is-active { color: var(--text); background: rgba(82, 214, 255, .08); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.nav-toggle span:not(.sr-only) { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--text); }

.hero { position: relative; overflow: hidden; padding: 80px 0 94px; border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .4; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 52px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--cyan); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px var(--green); }
.hero h1, .page-hero h1, .project-detail-hero h1 { margin: 18px 0 20px; max-width: 760px; font-size: clamp(2.75rem, 6.2vw, 5.7rem); line-height: .98; letter-spacing: -.065em; }
.hero-copy > p { max-width: 660px; color: var(--muted); font-size: clamp(1.05rem, 1.7vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 19px; border: 1px solid transparent; border-radius: 12px; font-weight: 800; transition: transform .2s, border-color .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #00131c; background: var(--cyan); box-shadow: 0 12px 30px rgba(19, 191, 233, .2); }
.button-secondary { color: var(--text); border-color: var(--line-strong); background: rgba(82, 214, 255, .08); }
.button-ghost { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .025); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 38px; color: var(--muted); font-size: .85rem; }
.hero-facts span { display: grid; }
.hero-facts strong { color: var(--text); font-size: 1rem; }
.hero-board { position: relative; min-height: 500px; border: 1px solid var(--line); border-radius: 32px; background: linear-gradient(160deg, rgba(15, 38, 58, .9), rgba(5, 17, 29, .6)); box-shadow: var(--shadow); overflow: hidden; }
.hero-board::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 35px 35px; opacity: .38; }
.hero-board svg { position: relative; z-index: 2; width: 100%; height: 100%; min-height: 500px; fill: var(--bg); stroke: var(--cyan); stroke-width: 3; }
.hero-board .trace { fill: none; opacity: .8; filter: drop-shadow(0 0 6px rgba(82, 214, 255, .45)); }
.hero-board .trace-b, .hero-board .trace-d { stroke: var(--amber); }
.hero-board .chip { fill: #091b2a; stroke: var(--green); stroke-width: 2; }
.hero-board .chip-pins { fill: none; stroke: var(--green); }
.hero-board text { fill: var(--text); stroke: none; font-weight: 900; font-size: 28px; letter-spacing: .12em; }
.hero-board text.small { fill: var(--muted); font-size: 11px; letter-spacing: .22em; }
.board-glow { position: absolute; inset: 20% 17%; border-radius: 50%; background: rgba(41, 213, 255, .1); filter: blur(60px); }

.section { padding-block: 88px; }
.section-muted { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.section-heading h2, .workflow-panel h2 { margin: 9px 0 0; max-width: 720px; font-size: clamp(2rem, 3.8vw, 3.5rem); line-height: 1.05; letter-spacing: -.045em; }
.section-heading > p { max-width: 440px; margin: 0; color: var(--muted); }
.simulator-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.simulator-card { position: relative; min-height: 520px; display: flex; flex-direction: column; padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17, 42, 64, .92), rgba(8, 23, 37, .92)); overflow: hidden; }
.simulator-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 90% 0%, rgba(82, 214, 255, .13), transparent 40%); pointer-events: none; }
.analog-card::before { background: radial-gradient(circle at 90% 0%, rgba(255, 199, 104, .14), transparent 40%); }
.simulator-card > * { position: relative; z-index: 1; }
.simulator-icon { width: 88px; height: 64px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 45px; border: 1px solid var(--line-strong); border-radius: 17px; background: rgba(82, 214, 255, .07); color: var(--cyan); font: 900 1.45rem ui-monospace, monospace; }
.wave-icon { border-color: rgba(255, 199, 104, .35); background: rgba(255, 199, 104, .07); }
.wave-icon svg { width: 70px; fill: none; stroke: var(--amber); stroke-width: 3; }
.card-kicker { color: var(--cyan); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.analog-card .card-kicker { color: var(--amber); }
.simulator-card h3 { margin: 8px 0 10px; font-size: 2rem; letter-spacing: -.035em; }
.simulator-card p, .simulator-card li { color: var(--muted); }
.simulator-card ul { display: grid; gap: 8px; margin: 12px 0 30px; padding-left: 20px; }
.simulator-card .button { align-self: flex-start; margin-top: auto; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; transition: transform .22s ease, border-color .22s ease; }
.project-card:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.project-card[hidden] { display: none; }
.project-cover { position: relative; aspect-ratio: 1.62; overflow: hidden; background: #081421; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.project-card:hover .project-cover img { transform: scale(1.025); }
.demo-ribbon { position: absolute; top: 14px; right: 14px; padding: 6px 9px; border: 1px solid rgba(255, 199, 104, .32); border-radius: 9px; color: var(--amber); background: rgba(5, 14, 24, .86); font-size: .7rem; font-weight: 850; }
.project-card-body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .78rem; }
.status-chip { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--cyan); font-weight: 800; }
.status-prototipo, .status-pruebas { color: var(--amber); border-color: rgba(255,199,104,.28); }
.status-funcional, .status-terminado { color: var(--green); border-color: rgba(105,230,166,.28); }
.project-card h3 { margin: 14px 0 8px; font-size: 1.35rem; line-height: 1.16; }
.project-card p { margin: 0 0 18px; color: var(--muted); font-size: .94rem; }
.technology-list { display: flex; flex-wrap: wrap; gap: 6px; }
.technology-list span { padding: 5px 8px; border-radius: 8px; color: #bdd1e0; background: rgba(255,255,255,.045); font-size: .73rem; }
.technology-list.large span { padding: 7px 10px; font-size: .82rem; }
.text-link { margin-top: auto; padding-top: 20px; color: var(--cyan); font-weight: 800; }
.section-cta { display: flex; justify-content: center; margin-top: 32px; }

.workflow-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 52px; padding: 46px; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(135deg, rgba(18, 43, 66, .92), rgba(7, 21, 34, .92)); }
.workflow-panel.compact { align-items: center; }
.workflow-panel.compact p { color: var(--muted); }
.workflow-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin: 0; padding: 0; list-style: none; }
.workflow-list li { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0,0,0,.1); }
.workflow-list li > span { grid-row: 1 / 3; color: var(--cyan); font: 800 .75rem ui-monospace, monospace; }
.workflow-list small { color: var(--muted); }

.page-hero { padding: 72px 0 64px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 80% 0%, rgba(82,214,255,.1), transparent 28rem); }
.compact-hero h1 { font-size: clamp(2.5rem, 5vw, 4.8rem); }
.page-hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.12rem; }
.project-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 220px 190px auto; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 14px; top: 50%; width: 19px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; }
.project-filters input, .project-filters select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--text); background: #081624; }
.project-filters input { padding-left: 42px; }
.project-filters input:focus, .project-filters select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(82,214,255,.1); }
.filter-reset { min-height: 46px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: transparent; }
.result-summary { margin: 22px 0 18px; color: var(--muted); font-size: .9rem; }
.result-summary strong { color: var(--text); }
.empty-state { padding: 48px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 1.3rem; }
.empty-state.standalone { max-width: 680px; margin: 20px auto; }
.empty-state .button { margin-top: 16px; }
.error-code { display: block; margin-bottom: 8px; color: var(--cyan); font: 900 4rem/1 ui-monospace, monospace; }

.project-detail-hero { padding: 70px 0; border-bottom: 1px solid var(--line); }
.project-detail-grid { display: grid; grid-template-columns: 1fr .8fr; align-items: center; gap: 50px; }
.project-detail-hero h1 { font-size: clamp(2.6rem, 5vw, 5rem); }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--cyan); font-weight: 800; }
.project-lead { max-width: 720px; color: var(--muted); font-size: 1.16rem; }
.project-hero-cover { position: relative; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.project-content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 50px; align-items: start; }
.project-article { display: grid; gap: 42px; }
.project-article section, .longform-card { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.section-index { display: inline-block; margin-bottom: 8px; color: var(--cyan); font: 800 .78rem ui-monospace, monospace; }
.project-article h2, .longform-card h2 { margin: 0 0 12px; font-size: 1.8rem; letter-spacing: -.035em; }
.project-article p, .longform-card p, .longform-card li { color: var(--muted); }
.project-sidebar { position: sticky; top: 100px; display: grid; gap: 14px; }
.spec-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.spec-card h2 { margin: 0 0 12px; font-size: 1rem; }
.spec-card ul { display: grid; gap: 7px; margin: 0; padding-left: 18px; color: var(--muted); }
.muted { color: var(--muted); }

.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.resource-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.resource-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 26px; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--cyan); background: rgba(82,214,255,.06); font: 900 .86rem ui-monospace, monospace; }
.resource-card h2 { margin: 7px 0 8px; }
.resource-card p { color: var(--muted); }
.coming-soon { display: inline-block; margin-top: 10px; color: var(--amber); font-size: .8rem; font-weight: 800; }
.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.check-list { display: grid; gap: 9px; padding-left: 20px; }
.credit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.credit-grid article { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.credit-grid p { color: var(--muted); }
code { padding: .18em .4em; border: 1px solid var(--line); border-radius: 6px; color: #bde9f8; background: rgba(0,0,0,.18); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 17px 19px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.notice strong { white-space: nowrap; }
.notice span { color: var(--muted); }
.notice-warning { border-color: rgba(255,199,104,.3); }
.notice-warning strong { color: var(--amber); }
.notice-info strong { color: var(--cyan); }
.notice-error { border-color: rgba(255,127,139,.3); }
.notice-error strong { color: var(--danger); }

.site-footer { padding: 54px 0 24px; border-top: 1px solid var(--line); background: #040b13; }
.footer-grid { display: grid; grid-template-columns: 1.5fr .7fr .8fr; gap: 40px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-grid p, .footer-grid a, .footer-bottom { color: var(--muted); font-size: .86rem; }
.footer-grid a:hover { color: var(--cyan); }
.footer-brand { color: var(--text) !important; font-size: 1.12rem !important; font-weight: 850; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .hero-grid, .project-detail-grid, .workflow-panel, .project-content-layout { grid-template-columns: 1fr; }
  .hero-board { min-height: 380px; }
  .hero-board svg { min-height: 380px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project-sidebar { position: static; grid-template-columns: repeat(3, 1fr); }
  .project-filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --shell: min(100% - 28px, 1180px); }
  .header-inner { min-height: 68px; }
  .brand small { display: none; }
  .nav-toggle { display: block; }
  .main-nav { position: fixed; top: 68px; right: 14px; left: 14px; display: none; flex-direction: column; align-items: stretch; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #07131f; box-shadow: var(--shadow); }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 13px; }
  .hero { padding: 58px 0 68px; }
  .hero h1, .page-hero h1, .project-detail-hero h1 { letter-spacing: -.045em; }
  .hero-board { min-height: 300px; }
  .hero-board svg { min-height: 300px; }
  .section { padding-block: 64px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .simulator-cards, .project-grid, .resource-grid, .about-grid, .credit-grid { grid-template-columns: 1fr; }
  .simulator-card { min-height: auto; }
  .workflow-panel { padding: 28px; }
  .workflow-list { grid-template-columns: 1fr; }
  .project-filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .project-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .notice { flex-direction: column; }
  .notice strong { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
