/* ─── TOKENS — dark (default) ─────────────────────────────── */
:root {
  --bg:          hsl(220 15% 13%);
  --bg-card:     hsl(220 15% 17%);
  --bg-elevated: hsl(220 15% 21%);
  --primary:     hsl(355 76% 54%);
  --primary-dim: hsla(355,76%,54%,0.12);
  --text:        hsl(220 14% 68%);
  --text-strong: hsl(220 14% 90%);
  --text-muted:  hsl(220 12% 42%);
  --border:      hsl(230 12% 24%);
  --green:  hsl(142 71% 45%);
  --blue:   hsl(209 79% 60%);
  --yellow: hsl(45 93% 47%);
  --radius: 0.45rem;
  --nav-w:  210px;
  --mono: "Fira Mono", ui-monospace, monospace;
  --sans: "Manrope", sans-serif;
  --serif: "Cormorant Garamond", serif;
}

/* ─── TOKENS — light ──────────────────────────────────────── */
[data-theme="light"] {
  --bg:          hsl(220 20% 98%);
  --bg-card:     #ffffff;
  --bg-elevated: hsl(220 15% 95%);
  --primary:     hsl(355 76% 54%);
  --primary-dim: hsla(355,76%,54%,0.18);
  --text:        hsl(220 15% 30%);
  --text-strong: hsl(220 25% 12%);
  --text-muted:  hsl(220 10% 55%);
  --border:      hsl(220 14% 90%);
  --green:  hsl(142 60% 40%);
  --blue:   hsl(209 70% 50%);
  --yellow: hsl(45 85% 45%);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: hsl(220 14% 88%); border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb,
:root ::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }

::selection { background: var(--primary-dim); color: var(--text-strong); }

/* Smooth theme transitions */
body, .nav, section, footer, .acard, .svc, .cap-col, .ci, .lang-cell, .quote, .projects, .proj, .grid-block, .lang-btn, .btn-ghost, .theme-toggle {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

/* ─── LANG TOGGLE ─────────────────────────────────────────── */
[data-lang="en"] .es { display: none !important; }
[data-lang="es"] .en { display: none !important; }

.lang-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.75rem;
  z-index: 200;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
[data-theme="light"] .lang-btn {
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.lang-btn button {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.42rem 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.lang-btn button.active {
  background: var(--primary);
  color: #fff;
}

/* ─── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .2s, color .2s;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.5;
}

/* Icon visibility: button shows the *target* theme */
[data-theme="dark"] .theme-sun,
[data-theme="light"] .theme-moon { display: block; }
[data-theme="dark"] .theme-moon,
[data-theme="light"] .theme-sun { display: none; }

.theme-toggle-desktop { margin-top: 0.75rem; }
.theme-toggle-mobile  { display: none; }

/* ─── NAV ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-w);
  height: 100vh;
  padding: 2.75rem 2rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 100;
  background: var(--bg);
}

.nav-brand a {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
  transition: color .2s;
}
.nav-brand a:hover { color: var(--primary); }

.nav-controls {
  display: none;
  align-items: center;
  gap: 0.75rem;
}
@media (max-width: 900px) {
  .nav-controls { display: flex; }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  flex-direction: column;
  gap: 4px;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-strong);
  border-radius: 1px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.cursor {
  color: var(--primary);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity:0; } }

.nav-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.4rem;
  margin-bottom: 2.5rem;
}

.nav-links { display:flex; flex-direction:column; gap:.2rem; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color .2s;
}
.nav-links a::before {
  content: "";
  width: 16px; height: 1px;
  background: var(--border);
  transition: background .2s, width .2s;
  flex-shrink: 0;
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); }
.nav-links a.active::before { background: var(--primary); width: 22px; }

.nav-foot { margin-top:auto; display:flex; flex-direction:column; gap:.75rem; }
.nav-status {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.4; transform:scale(.82); }
}
.nav-social { display:flex; gap:.9rem; }
.nav-social a {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.nav-social a:hover { color: var(--primary); }

/* ─── LAYOUT ─────────────────────────────────────────────── */
main { margin-left: var(--nav-w); }

section {
  padding: 5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sec-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2.5rem;
  display: block;
}

h2 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  margin-bottom: 1.75rem;
}

.brand-dot {
  display: inline-block;
  width: .22em; height: .22em;
  border-radius: 50%;
  background: var(--primary);
  margin-left: .06em;
  vertical-align: .12em;
}
h2 .brand-dot { width:.16em; height:.16em; vertical-align:.18em; }

.under {
  color: var(--primary);
  animation: blink 1.1s steps(1) infinite;
  font-style: normal;
}

p.lead {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
}
strong { color: var(--text-strong); font-weight: 600; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .85s ease, transform .85s ease;
}
.reveal.in { opacity:1; transform:translateY(0); }

/* ─── HERO ───────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(355,76%,54%,.07) 0%, transparent 65%);
  top: 50%; right: -150px;
  transform: translateY(-50%);
  pointer-events: none;
}
[data-theme="light"] .hero-glow {
  background: radial-gradient(circle, hsla(355,76%,54%,.04) 0%, transparent 65%);
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.hero-eyebrow .live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.hero-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  margin-bottom: 1.8rem;
}
.hero-title .dim { color: var(--text-muted); }

.hero-sub {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-style: italic;
  color: var(--text);
  line-height: 1.35;
  max-width: 720px;
  margin-bottom: 3rem;
}
.hero-sub em { color: var(--text-strong); font-style: italic; }

.hero-pills {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .38rem .9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.pill .d { color: var(--primary); font-size: .5rem; }

/* ─── TERMINAL — always dark ─────────────────────────────── */
.terminal {
  background: hsl(220 15% 13%);
  border: 1px solid hsl(230 12% 24%);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 600px;
  font-family: var(--mono);
  font-size: 0.8rem;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.5);
}
.tbar {
  background: hsl(220 15% 17%);
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  border-bottom: 1px solid hsl(230 12% 24%);
}
.tbar .c { width:10px; height:10px; border-radius:50%; }
.tbar .c.r { background:#ff5f57; }
.tbar .c.y { background:#febc2e; }
.tbar .c.g { background:#28c840; }
.tbar .ttl {
  margin-left:.75rem;
  font-size: .62rem;
  color: hsl(220 12% 42%);
  letter-spacing: .08em;
}
.tbody {
  padding: 1.25rem 1.4rem;
  line-height: 2;
  color: hsl(220 14% 68%);
}
.tbody .cm  { color: hsl(220 12% 42%); }
.tbody .cmd { color: hsl(355 76% 54%); }
.tbody .flg { color: hsl(209 79% 60%); }
.tbody .grn { color: hsl(142 71% 45%); }

.scroll-hint {
  position: absolute;
  bottom: 3rem; right: 5rem;
  writing-mode: vertical-lr;
  font-family: var(--mono);
  font-size: .57rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.scroll-hint::after {
  content: "";
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  display: block;
  animation: pulse-line 2.5s ease-in-out infinite;
}
@keyframes pulse-line {
  0%,100% { opacity:.3; }
  50% { opacity:1; }
}

/* ─── SHARED GRID PATTERN ─────────────────────────────────── */
.grid-block {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 3.5rem;
}
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-5 { grid-template-columns: repeat(5,1fr); }

/* ─── ABOUT ──────────────────────────────────────────────── */
.acard {
  background: var(--bg-card);
  padding: 3rem 2.5rem;
  transition: background .25s;
}
.acard:hover { background: var(--bg-elevated); }
.acard-num {
  font-family: var(--mono);
  font-size: .57rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.1rem;
}
.acard-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: .65rem;
  line-height: 1.3;
}
.acard-desc {
  font-size: .87rem;
  color: var(--text);
  line-height: 1.75;
  max-width: 68ch;
}

.quote {
  border-left: 2px solid var(--primary);
  padding: 1.5rem 2.2rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 3rem;
  max-width: 800px;
}
.quote-text {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-style: italic;
  color: var(--text-strong);
  line-height: 1.4;
  margin-bottom: .85rem;
}
.quote-author {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── SERVICES ───────────────────────────────────────────── */
.svc {
  background: var(--bg-card);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  transition: background .25s;
}
.svc:hover { background: var(--bg-elevated); }
.svc-num {
  font-family: var(--mono);
  font-size: .57rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--primary);
}
.svc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.3;
}
.svc-desc {
  font-size: .87rem;
  color: var(--text);
  line-height: 1.75;
  flex: 1;
  max-width: 68ch;
}
.svc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}
.tag {
  font-family: var(--mono);
  font-size: .62rem;
  padding: .2rem .6rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

.cta-row {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.75rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--mono);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity .2s, transform .2s;
}
.btn-primary:hover { opacity:.88; transform:translateY(-1px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.75rem;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: .73rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ─── PROJECTS ───────────────────────────────────────────── */
.projects {
  display:flex; flex-direction:column;
  gap:1px; margin-top:3.5rem;
  background:var(--border);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
}
.proj {
  display: grid;
  grid-template-columns: 108px 1fr 28px;
  gap: 2.5rem;
  align-items: start;
  padding: 2.25rem 2.5rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: background .25s;
}
.proj:hover { background: var(--bg-elevated); }
a.proj:hover .proj-arrow { color: var(--primary); transform: translate(3px,-3px); }

/* Highlighted project (yoHost) with preview image */
.proj-highlight {
  grid-template-columns: 108px 1fr 380px 28px;
  align-items: stretch;
}
.proj-preview {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: transform .25s, border-color .25s;
}
.proj-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-highlight:hover .proj-preview {
  transform: scale(1.02);
  border-color: var(--text-muted);
}

/* yoHost logo theming */
.yoHost-logo {
  color: var(--text-strong);
  height: 1.6rem;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}
.yoHost-logo-footer {
  color: var(--text-strong);
  height: 1.4rem;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -0.15rem;
}

.proj-meta {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: .3rem;
}
.proj-status {
  display: block;
  margin-top: .4rem;
}
.proj-status::before { content:"● "; font-size:.6em; }
.proj-status.live   { color: var(--green); }
.proj-status.dev    { color: var(--yellow); }
.proj-status.planned{ color: var(--text-muted); }

.proj-body h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: .55rem;
  line-height: 1.15;
}
.proj-body p {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.75;
  max-width: 68ch;
  margin-bottom: 1rem;
}
.proj-tags { display:flex; flex-wrap:wrap; gap:.4rem; }
.proj-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  padding-top: .1rem;
  transition: color .25s, transform .25s;
  align-self: flex-start;
}

/* ─── CAPABILITIES ───────────────────────────────────────── */
.cap-col {
  background: var(--bg-card);
  padding: 2.25rem 2rem;
}
.cap-col h4 {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.3rem;
}
.cap-col ul { list-style:none; display:flex; flex-direction:column; gap:.5rem; }
.cap-col li {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.cap-col li::before { content:"›"; color:var(--primary); flex-shrink:0; }

/* Languages mini row */
.lang-cell {
  background: var(--bg-card);
  padding: 1.5rem 1.4rem;
}
.lang-flag { font-size:1.3rem; margin-bottom:.5rem; }
.lang-name {
  font-family: var(--mono);
  font-size: .67rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: .2rem;
}
.lang-level {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text-muted);
}

/* ─── CONTACT ────────────────────────────────────────────── */
.contact-intro { max-width:780px; margin-bottom:3rem; }
.contact-intro .serif-lead {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
  margin-top: 1rem;
}

.ci {
  background: var(--bg-card);
  padding: 2rem 1.75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  position: relative;
  transition: background .25s;
}
.ci:hover { background: var(--bg-elevated); }
.ci:hover .ci-arrow { color: var(--primary); transform:translate(3px,-3px); }
.ci-label {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .35rem;
}
.ci-val {
  font-family: var(--mono);
  font-size: .88rem;
  color: var(--text-strong);
  font-weight: 500;
}
.ci-handle {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-muted);
}
.ci-arrow {
  position: absolute;
  top: 1.4rem; right: 1.4rem;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color .25s, transform .25s;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  margin-left: var(--nav-w);
  padding: 3rem 5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-brand {
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.footer-meta {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer-link {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
  letter-spacing: .02em;
}
.footer-link:hover { color: var(--primary); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  section, footer { padding-left:4rem; padding-right:4rem; }
  #hero { padding-left:4rem; padding-right:4rem; }
  .scroll-hint { right:4rem; }
  .grid-4 { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 900px) {
  :root { --nav-w:0px; }
  .nav {
    position: sticky;
    top:0; left:0;
    width:100%; height:auto;
    padding:0.875rem 1rem;
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    border-right:none;
    border-bottom:1px solid var(--border);
    gap:1rem;
    flex-wrap: wrap;
  }
  .nav-sub, .nav-foot { display:none; }
  .nav-toggle { display: flex; }
  .theme-toggle-mobile { display: inline-flex; }
  .theme-toggle-desktop { display: none; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.6rem 0;
    font-size: 0.72rem;
    border-bottom: 1px solid hsl(230 12% 20%);
  }
  [data-theme="light"] .nav-links a { border-bottom-color: hsl(220 14% 85%); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a::before { display:none; }
  main, footer { margin-left:0; }
  section, #hero, footer { padding:3rem 1.25rem; }
  #hero {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns:1fr; }
  .proj { grid-template-columns:1fr; gap:1rem; }
  .proj-highlight { grid-template-columns:1fr; }
  .proj-preview { display:none; }
  .proj-arrow { display:none; }
  .scroll-hint { display:none; }
  .acard, .svc, .cap-col { padding: 1.5rem 1.25rem; }
  .proj { padding: 1.5rem 1.25rem; }
  .ci { padding: 1.5rem 1.25rem; }
  .lang-cell { padding: 1.25rem 1rem; }
  .terminal { max-width: 100%; }
  .lang-btn { top:auto; bottom:1.5rem; right:1.5rem; }
}

/* ─── PRINCIPLES ─────────────────────────────────────────── */
.principles-grid { grid-template-columns: repeat(2, 1fr); }
.principle-card { padding: 3.5rem 3rem; }

@media (max-width: 900px) {
  .principles-grid { grid-template-columns: 1fr; }
  .principle-card { padding: 2.5rem 1.5rem; }
}
@media (max-width:480px) {
  .hero-title { font-size:2.1rem; }
  h2 { font-size:1.9rem; }
  .terminal { font-size:.74rem; }
  .grid-5 { grid-template-columns:repeat(2,1fr); }
  .principle-card { padding: 2rem 1.25rem; }
}
