/* ────────────────────────────────────────────
   VARIABLES — warm off-white / cream light theme
──────────────────────────────────────────── */
:root {
  --bg:           #F0EAE0;
  --surface:      #E9E2D7;
  --surface-2:    #E0D8CB;
  --surface-hover:#D8CFBF;
  --text:         #1A1610;
  --text-muted:   #6D655C;
  --text-dim:     #B5ADA4;
  --accent:       #8C5F2C;
  --accent-light: rgba(140, 95, 44, 0.09);
  --border:       rgba(26, 22, 16, 0.10);
  --border-light: rgba(26, 22, 16, 0.16);
  --max:          1120px;
  --px:           clamp(22px, 5.5vw, 88px);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Subtle vertical grid — parallel line motif */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent calc((100vw - 1px) / 12 - 1px),
    rgba(26, 22, 16, 0.032) calc((100vw - 1px) / 12 - 1px),
    rgba(26, 22, 16, 0.032) calc((100vw - 1px) / 12)
  );
  pointer-events: none;
  z-index: 0;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--px);
  position: relative;
  z-index: 1;
}
section { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* ── Scroll animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up[data-d="1"] { transition-delay: 0.08s; }
.fade-up[data-d="2"] { transition-delay: 0.16s; }
.fade-up[data-d="3"] { transition-delay: 0.24s; }

/* ── Section label ── */
.label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.label::before {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ────────────────────────────────────────────
   TOP BAR
──────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2;
  background: var(--bg);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  gap: 20px;
}
.topbar-brand { display: flex; flex-direction: column; line-height: 1; }
.topbar-name {
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--text);
}
.topbar-sub {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 5px;
}
.topbar-nav { display: flex; align-items: center; gap: 26px; }
.topbar-nav a {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.topbar-nav a:hover { color: var(--accent); }
.topbar-nav a.active { color: var(--text); }

/* ── Language switcher (mismo estilo que el de la home) ── */
.lang {
  display: flex;
  align-items: center;
  padding-left: 18px;
  border-left: 1px solid var(--border-light);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
/* Padding para que el área táctil llegue a ~44 px sin agrandar el texto */
.topbar-nav .lang a {
  padding: 14px 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.topbar-nav .lang a[aria-current="page"] { color: var(--text); }

/* ────────────────────────────────────────────
   PAGE HEADER
──────────────────────────────────────────── */
.page-hero {
  padding: clamp(70px, 9vw, 110px) 0 clamp(56px, 7vw, 88px);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-hero .hero-mark {
  position: absolute;
  right: -0.04em;
  bottom: -0.18em;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(160px, 24vw, 380px);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26, 22, 16, 0.055);
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
  z-index: 0;
}
.page-hero h1 {
  font-size: clamp(46px, 7vw, 92px);
  font-weight: 600;
  margin-bottom: 26px;
}
.page-hero h1 em { font-style: italic; font-weight: 300; }
.page-hero p {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-muted);
  line-height: 1.78;
  max-width: 620px;
}
.hero-strip {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: clamp(44px, 6vw, 70px);
}
.strip-item {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  white-space: nowrap;
}
.strip-div { flex: 1; height: 1px; background: var(--border-light); margin: 0 20px; }

/* ────────────────────────────────────────────
   GROUPS & PROJECTS
──────────────────────────────────────────── */
.group {
  padding-top: clamp(64px, 8vw, 100px);
}
.group-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.group-header h2 {
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 600;
}
.group-count {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  white-space: nowrap;
}

.project {
  padding: clamp(48px, 6vw, 72px) 0 clamp(56px, 7vw, 84px);
  border-bottom: 1px solid var(--border);
}
.group .project:last-child { border-bottom: none; }
.group { border-bottom: 1px solid var(--border); }

.p-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 40px;
  align-items: baseline;
  margin-bottom: 14px;
}
.p-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}
.project h3 {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 600;
}
.project h3 em { font-style: italic; font-weight: 300; }
.p-live {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  border-bottom: 1px solid rgba(140, 95, 44, 0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}
.p-live:hover { border-color: var(--accent); }

.p-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 660px;
  margin-bottom: 22px;
}

.p-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}
.p-stack span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}

/* ── Media ── */
figure {
  border: 1px solid var(--border-light);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
figure:hover img { transform: scale(1.015); }
figcaption {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* layout: 1 wide + 2 below */
.media-main2 { display: grid; gap: 14px; }
.media-main2 .m-main { aspect-ratio: 16 / 10; }
.media-main2 .m-main img { aspect-ratio: 16 / 10; }
.media-main2 .m-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.media-main2 .m-row figure { aspect-ratio: 16 / 10; display: flex; flex-direction: column; }
.media-main2 .m-row figure img { flex: 1; min-height: 0; }

/* layout: 2 side by side */
.media-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.media-duo figure { aspect-ratio: 16 / 10; display: flex; flex-direction: column; }
.media-duo figure img { flex: 1; min-height: 0; }

/* layout: desktop + phone */
.media-desk-phone { display: grid; grid-template-columns: 2.2fr 1fr; gap: 14px; align-items: stretch; }
.media-desk-phone .m-desk { display: flex; flex-direction: column; }
.media-desk-phone .m-desk img { flex: 1; min-height: 0; }
.media-desk-phone .m-phone { display: flex; flex-direction: column; }
.media-desk-phone .m-phone img { flex: 1; min-height: 0; object-position: center top; }

/* layout: phones */
.media-phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.media-phones figure { display: flex; flex-direction: column; }
.media-phones figure img { flex: 1; min-height: 0; }

/* layout: stacked wide strips */
.media-strips { display: grid; gap: 14px; }
.media-strips figure img { width: 100%; height: auto; }
.media-strips .strip-crop { display: flex; flex-direction: column; }
.media-strips .strip-crop img { aspect-ratio: 2.5 / 1; object-fit: cover; object-position: center; }
.media-strips .strip-top { display: flex; flex-direction: column; }
.media-strips .strip-top img { aspect-ratio: 2 / 1; object-fit: cover; object-position: top center; }

/* ── Terminal panel (headless systems) ── */
.terminal {
  background: #211C15;
  border: 1px solid var(--border-light);
  font-family: 'Consolas', 'SF Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.85;
  color: #C9BFB0;
  padding: 22px 24px 26px;
  overflow-x: auto;
}
.terminal .t-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
}
.terminal .t-bar i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(240, 234, 224, 0.18);
}
.terminal .t-cmd { color: #F0EAE0; }
.terminal .t-dim { color: #7A7164; }
.terminal .t-ok { color: #9FB98A; }
.terminal .t-accent { color: #D2A368; }
.terminal div { white-space: pre; }

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 14px;
}
.stat-tiles .tile {
  background: var(--bg);
  padding: 22px 22px 24px;
  transition: background 0.3s ease;
}
.stat-tiles .tile:hover { background: var(--surface); }
.tile b {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 6px;
}
.tile span {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sys-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; align-items: stretch; }
.sys-grid .terminal { height: 100%; }
.sys-grid .stat-col { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 0; }

/* ────────────────────────────────────────────
   CTA + FOOTER
──────────────────────────────────────────── */
.cta {
  padding: clamp(80px, 11vw, 130px) 0;
  position: relative;
  overflow: hidden;
}
.cta::after {
  content: '31';
  position: absolute;
  right: -0.06em;
  bottom: -0.18em;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(150px, 22vw, 320px);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26, 22, 16, 0.04);
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
}
.cta h2 {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 600;
  margin-bottom: 18px;
  max-width: 600px;
}
.cta p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 34px;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.cta-btn:hover { background: var(--accent); border-color: var(--accent); }

footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: baseline; gap: 14px; }
.footer-name { font-family: 'Raleway', sans-serif; font-size: 18px; font-weight: 300; }
.footer-tagline {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-right { display: flex; align-items: center; gap: 28px; }
.footer-right a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.footer-right a:hover { color: var(--accent); }

/* ────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────── */
@media (max-width: 900px) {
  .media-desk-phone { grid-template-columns: 1fr; }
  .media-desk-phone .m-phone { display: none; }
  .media-phones { grid-template-columns: 1fr 1fr; }
  .sys-grid { grid-template-columns: 1fr; }
  .media-strips .m-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --px: 20px; }
  .media-main2 .m-row { grid-template-columns: 1fr; }
  .media-duo { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: 1fr; }
  .p-top { grid-template-columns: 1fr; gap: 10px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .topbar-nav { gap: 16px; }
  /* A 390 px no cabe todo: el logo ya lleva a la home */
  .topbar-nav .nav-home { display: none; }
  .topbar-sub { display: none; }
  .lang { padding-left: 10px; }
  /* La tira no cabe en una línea: se reparte en varias */
  .hero-strip { flex-wrap: wrap; gap: 4px 22px; }
  .strip-div { display: none; }
}
