/* ==========================================================================
   pedrocreatuweb.com — Pedro Rodríguez
   Rejilla estricta, líneas finas, esquinas rectas. Colores de la tarjeta.
   ========================================================================== */

:root {
  --paper: #ECE9DC;
  --paper-2: #E4E1D2;
  --paper-3: #D2CDB7;
  --ink: #1C2723;
  --ink-2: #26332E;
  --muted: #5F665B;
  --accent: #2E5A4F;
  --accent-light: #6FB39F;
  --line: #1C2723;
  --line-soft: rgba(28, 39, 35, .18);

  --f-display: 'Unbounded', 'Arial Narrow', sans-serif;
  --f-body: 'Karla', -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Consolas', monospace;

  --pad: clamp(16px, 4vw, 48px);
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
em { font-style: normal; color: var(--accent); }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Brand mark ---------- */
.mark {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.mark svg { width: 70%; height: 70%; fill: var(--accent-light); }
.mark-xl { width: min(220px, 50vw); height: min(220px, 50vw); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.brand-name span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-weight: 600; font-size: 15px; text-decoration: none;
  padding: 8px 12px;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--ink); color: var(--paper); }
.nav-links .nav-cta { background: var(--accent); color: var(--paper); margin-left: 8px; }
.nav-links .nav-cta:hover { background: var(--ink); }

.lang { display: flex; border: 1px solid var(--line); }
.lang button {
  font: 500 12px/1 var(--f-mono);
  background: transparent; color: var(--ink);
  border: 0; padding: 8px 9px; cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang button:hover:not([aria-pressed="true"]) { background: var(--paper-3); }

.burger { display: none; }
.lang-menu { display: none; }
@media (max-width: 560px) {
  .lang-bar { display: none; }
  .lang-menu { display: flex; align-self: flex-start; margin: 18px var(--pad); }
  .lang-menu button { padding: 12px 16px; font-size: 14px; }
}

@media (max-width: 900px) {
  .nav { gap: 12px; }
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 42px; height: 42px; padding: 0 10px;
    background: var(--ink); border: 0; cursor: pointer;
  }
  .burger span { display: block; height: 2px; background: var(--paper); transition: transform .2s var(--ease); }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 18px var(--pad); border-top: 1px solid var(--line-soft); font-size: 18px; }
  .nav-links .nav-cta { margin: 0; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 12.5px; }
  .mark { width: 34px; height: 34px; }
}

/* ---------- Grid system (lines = gap over ink background) ---------- */
.grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.cell { background: var(--paper); padding: clamp(24px, 3.5vw, 48px) var(--pad); min-width: 0; }

.kicker {
  font: 500 13px/1.2 var(--f-mono);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
  display: flex; gap: 12px; align-items: center;
}
.num { color: var(--accent); }
.num::after { content: ""; display: inline-block; width: 28px; height: 1px; background: currentColor; vertical-align: middle; margin-left: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  font-weight: 700; font-size: 16px; text-decoration: none;
  border: 1px solid var(--ink);
  transition: background .15s, color .15s, transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */
.hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(40px, 7vw, 96px); }
.hero-title {
  font-size: clamp(2.5rem, 6.2vw, 5.6rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.03em;
  text-wrap: balance;
  max-width: 12ch;
  margin-bottom: 28px;
}
.hero-title em { position: relative; white-space: nowrap; }
.hero-title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .09em;
  background: var(--accent-light);
  transform-origin: left; transform: scaleX(0);
  animation: underline 1s .5s var(--ease) forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.hero-lead { font-size: clamp(17px, 1.5vw, 20px); max-width: 46ch; color: var(--ink-2); margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual {
  background: var(--paper-2);
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}

/* Browser frame */
.browser { border: 1px solid var(--ink); background: var(--ink); }
.browser-bar {
  display: flex; align-items: center; gap: 12px;
  height: 34px; padding: 0 12px;
  background: var(--ink); color: var(--paper);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; background: var(--accent-light); opacity: .9; }
.dots i:nth-child(2) { opacity: .55; }
.dots i:nth-child(3) { opacity: .3; }
.url {
  flex: 1; min-width: 0;
  font: 400 12px/22px var(--f-mono);
  background: var(--ink-2); color: #C9CDBF;
  padding: 0 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser-view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink-2); }
.browser-view img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease), transform 6s linear; transform: scale(1.04); }
.slide.is-active { opacity: 1; transform: scale(1); }

.preview-bar { height: 5px; background: var(--paper-3); position: relative; }
.preview-fill { position: absolute; inset: 0 auto 0 0; width: 62%; background: var(--accent); }
.preview-fill::after { content: ""; position: absolute; right: -4px; top: -2.5px; width: 10px; height: 10px; background: var(--accent); }
.preview-caption { margin-top: 12px; font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Facts */
.facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fact { display: flex; flex-direction: column; gap: 8px; padding-top: 28px; padding-bottom: 28px; }
.fact-num { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 2.6vw, 36px); line-height: 1; color: var(--accent); }
.fact-label { font-size: 15px; color: var(--muted); line-height: 1.4; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-title { max-width: 14ch; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; background: var(--ink); color: var(--paper); border-bottom: 1px solid var(--line); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track span {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(20px, 2.6vw, 34px);
  padding: 18px 0; padding-right: .5em; white-space: nowrap;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { border-bottom: 1px solid var(--line); }
.section-head { padding: clamp(56px, 8vw, 112px) var(--pad) clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: clamp(1.9rem, 4.2vw, 3.6rem); max-width: 20ch; text-wrap: balance; }
.section-lead { margin-top: 22px; max-width: 56ch; font-size: 18px; color: var(--muted); }

/* Services */
.services { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 0; }
.service { position: relative; min-height: 260px; display: flex; flex-direction: column; gap: 14px; transition: background .2s, color .2s; }
.service-num { font: 500 13px/1 var(--f-mono); color: var(--accent); margin-bottom: auto; padding-bottom: 36px; }
.service h3 { font-size: clamp(20px, 1.8vw, 26px); }
.service p { color: var(--muted); font-size: 16px; transition: color .2s; }
.service:hover { background: var(--ink); color: var(--paper); }
.service:hover p { color: #C9CDBF; }
.service:hover .service-num { color: var(--accent-light); }
@media (max-width: 900px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .services { grid-template-columns: 1fr; } .service { min-height: 0; } .service-num { padding-bottom: 12px; } }

/* Dark section */
.section-dark { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.section-dark .section-head { border-bottom-color: rgba(228, 225, 210, .2); }
.section-dark .kicker { color: #A7AD9F; }
.section-dark .num { color: var(--accent-light); }
.section-dark .section-lead { color: #B9BEB0; }
.section-dark em { color: var(--accent-light); }

/* Work / cases */
.work { display: grid; }
.case {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border-bottom: 1px solid rgba(228, 225, 210, .2);
}
.case:last-child { border-bottom: 0; }
.case:nth-child(even) .case-shot { order: 2; border-left: 1px solid rgba(228, 225, 210, .2); border-right: 0; }
.case-shot {
  display: block; padding: clamp(24px, 4vw, 56px) var(--pad);
  border-right: 1px solid rgba(228, 225, 210, .2);
  text-decoration: none;
}
.browser-dark { border-color: rgba(228, 225, 210, .35); }
.browser-dark .browser-bar { background: #111816; }
.browser-dark .url { background: #1A2420; }
.case-shot .browser-view img { transition: transform .8s var(--ease); }
.case-shot:hover .browser-view img { transform: scale(1.035); }
.case-shot:hover .browser { border-color: var(--accent-light); }

.case-info { padding: clamp(24px, 4vw, 56px) var(--pad); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.case-meta { font: 500 13px/1.3 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: #A7AD9F; display: flex; gap: 12px; align-items: center; }
.case-meta .num { color: var(--accent-light); }
.case h3 { font-size: clamp(26px, 3vw, 42px); }
.case-info > p { color: #C9CDBF; max-width: 48ch; }
.tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 500 12px/1 var(--f-mono); border: 1px solid rgba(228, 225, 210, .35); padding: 7px 9px; color: var(--paper); }
.case-link {
  align-self: flex-start; margin-top: 8px;
  font-weight: 700; text-decoration: none;
  padding: 12px 18px; border: 1px solid var(--accent-light); color: var(--accent-light);
  transition: background .15s, color .15s;
}
.case-link:hover { background: var(--accent-light); color: var(--ink); }

.work-more {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  padding: clamp(32px, 4vw, 56px) var(--pad);
  border-top: 1px solid rgba(228, 225, 210, .2);
}
.work-more p { font-family: var(--f-display); font-weight: 700; font-size: clamp(19px, 2vw, 26px); line-height: 1.25; max-width: 32ch; }
.work-more .case-link { margin-top: 0; align-self: center; }

@media (max-width: 900px) {
  .case { grid-template-columns: minmax(0, 1fr); }
  .case-shot, .case:nth-child(even) .case-shot { order: 0; border: 0; padding-bottom: 0; }
}

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 0; }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-num { font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--paper-3); margin-bottom: 18px; transition: color .3s; }
.step:hover .step-num { color: var(--accent); }
.step h3 { font-size: 20px; }
.step p { font-size: 15.5px; color: var(--muted); }
.step-key { background: var(--accent); color: var(--paper); }
.step-key .step-num { color: var(--accent-light); }
.step-key p { color: #DCE7E1; }
.step-key:hover .step-num { color: var(--paper); }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .step:last-child { grid-column: 1 / -1; } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }

/* About */
.section-paper .cell { background: var(--paper-2); }
.about { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); border-bottom: 0; }
.about-mark { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding-top: 64px; padding-bottom: 64px; }
.coords { font: 500 13px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.about-copy { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(56px, 7vw, 96px); }
.about-copy h2 { font-size: clamp(1.8rem, 3.6vw, 3rem); max-width: 18ch; margin-bottom: 26px; text-wrap: balance; }
.about-copy p { max-width: 58ch; color: var(--ink-2); margin-bottom: 16px; }
.about-list { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--line); }
.about-list li { padding: 14px 0 14px 28px; border-bottom: 1px solid var(--line-soft); position: relative; font-weight: 600; }
.about-list li::before { content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: var(--accent); }
@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-mark { flex-direction: row; align-items: center; padding-top: 40px; padding-bottom: 40px; }
  .mark-xl { width: 96px; height: 96px; }
}

/* Contact */
.contact-title { font-size: clamp(2.3rem, 6vw, 5.2rem) !important; max-width: 14ch !important; }
.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); background: rgba(228, 225, 210, .2); border-top: 1px solid rgba(228, 225, 210, .2); border-bottom: 1px solid rgba(228, 225, 210, .2); }
.contact-card { background: var(--ink); color: var(--paper); display: flex; flex-direction: column; gap: 10px; }
@supports (grid-template-rows: subgrid) {
  .contact-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 10px; align-content: start; }
}
.contact-name { font-family: var(--f-display); font-weight: 700; font-size: clamp(20px, 2vw, 26px); }
.contact-role { color: #B9BEB0; font-size: 15px; max-width: 40ch; margin-bottom: 14px; }
.contact-value { font-family: var(--f-display); font-weight: 700; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.1; color: var(--accent-light); align-self: end; }
.contact-actions, .contact-mail { align-self: start; justify-self: start; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.contact-btn {
  min-height: 46px; padding: 0 22px; display: inline-flex; align-items: center;
  font-weight: 700; text-decoration: none;
  border: 1px solid var(--accent-light); color: var(--accent-light);
  transition: background .15s, color .15s;
}
.contact-btn:hover { background: var(--accent-light); color: var(--ink); }
.contact-mail { margin-top: 10px; font: 400 14px/1.4 var(--f-mono); color: #C9CDBF; overflow-wrap: anywhere; text-underline-offset: 3px; }
.contact-mail:hover { color: var(--accent-light); }
.contact-where { padding: 28px var(--pad) 40px; color: #A7AD9F; font-size: 15px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 22px var(--pad);
  font: 400 13px/1.4 var(--f-mono); color: var(--muted);
}
.footer a { text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--accent); }

/* ---------- Reveal (con red de seguridad) ---------- */
/* Se animan los hijos, no la celda: así las líneas de la rejilla nunca asoman como bloques oscuros */
.js .reveal > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: inherit; }
.js .reveal.is-visible > * { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* Solo se desactiva lo intrusivo */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-duration: 90s; }
  .slide { transition: opacity .6s; transform: none !important; }
}

/* ---------- Legal page ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--pad); }
.legal h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-bottom: 28px; }
.legal h2 { font-size: 20px; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 12px; }
.legal a { color: var(--accent); }
