/* ============================================================
   DEC · decanestesia.org — design system
   Paleta derivada de la ilustración de portada: verdes apagados,
   gris telaraña, madera de banca y hueso viejo.
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0e1517;
  --bg-deep: #0a0f11;
  --surface: #141e20;
  --surface-2: #182527;
  --line: #223230;
  --line-soft: #1a2628;
  --ink: #d8d3c3;
  --ink-dim: #b3af9f;
  --muted: #82968f;
  --teal: #6d8a86;
  --teal-bright: #93b5af;
  --amber: #b0803f;
  --amber-soft: #8a5f3d;
  --obscura: #060809;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --maxw: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Grano de película sobre todo — que el sitio respire el mismo aire que la ilustración */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--amber-soft); color: #0a0f11; }

a { color: var(--teal-bright); text-decoration: none; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1001;
  background: var(--amber); color: #0a0f11; padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: .04em;
  color: var(--ink);
}
.brand:hover { color: var(--teal-bright); }
.site-nav { display: flex; gap: 26px; align-items: center; }
.site-nav a { font-size: 14px; color: var(--ink-dim); letter-spacing: .02em; }
.site-nav a:hover { color: var(--ink); }
.lang { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.lang b { color: var(--ink); font-weight: 600; }
.lang a { color: var(--muted); }
.lang a:hover { color: var(--ink); }
@media (max-width: 720px) { .site-nav .hide-sm { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 88px; position: relative; overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.eyebrow {
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
h1 {
  font-family: var(--serif); font-weight: 560; font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.08; letter-spacing: -0.01em; margin-bottom: 8px;
}
h1 .alt { display: block; font-style: italic; font-weight: 380; color: var(--teal-bright); }
.hero-sub { color: var(--ink-dim); font-size: 18px; max-width: 46ch; margin: 22px 0 34px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 13px 26px; border-radius: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: #14100a; }
.btn-primary:hover { background: #c08f4c; color: #14100a; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--teal); color: var(--ink); }

.hero-figure { position: relative; margin: 0; }
.hero-art { position: relative; display: inline-block; width: 100%; }
.hero-art img.portada {
  display: block; width: 100%; height: auto; border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
.hero-art .overlay { position: absolute; inset: 0; z-index: 5; }
#heart-zone {
  position: absolute; top: 37%; left: 49%; width: 15%; height: 10%;
  cursor: pointer; z-index: 15; background: transparent; border: 0;
}
.hero-caption {
  margin-top: 14px; font-family: var(--serif); font-style: italic;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.heart-cloud {
  position: fixed; width: 110px; height: 110px; border-radius: 12px;
  object-fit: cover; opacity: 0; pointer-events: none; z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: floatUp 3s ease-out forwards;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) scale(.5) rotate(-2deg); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translate(-60px, -170px) scale(1) rotate(3deg); opacity: 0; }
}

/* Telaraña decorativa de esquina */
.web-corner {
  position: absolute; top: 0; right: 0; width: 220px; height: 220px;
  opacity: .5; pointer-events: none;
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-figure { order: -1; max-width: 420px; margin: 0 auto; }
  .hero { padding: 40px 0 64px; }
}

/* ---------- Secciones ---------- */
section { padding: 88px 0; }
section + section { border-top: 1px solid var(--line-soft); }
.sec-eyebrow {
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
h2 {
  font-family: var(--serif); font-weight: 540; font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: -0.01em; margin-bottom: 14px;
}
.sec-intro { color: var(--ink-dim); max-width: 58ch; margin-bottom: 40px; }

/* ---------- Ficha del autor ---------- */
.ficha {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 34px 38px; max-width: 720px;
}
.ficha-head {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  font-size: 14px; margin-bottom: 22px; padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.ficha dl { display: grid; grid-template-columns: 200px 1fr; row-gap: 0; }
.ficha dt {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 13px 0; border-bottom: 1px dotted var(--line-soft);
  align-self: center;
}
.ficha dd {
  padding: 13px 0; border-bottom: 1px dotted var(--line-soft);
  color: var(--ink); font-size: 15.5px;
}
.ficha dd.empty { color: var(--muted); font-style: italic; }
.ficha-foot { margin-top: 20px; font-size: 13px; color: var(--muted); font-style: italic; }
@media (max-width: 640px) {
  .ficha { padding: 24px; }
  .ficha dl { grid-template-columns: 1fr; }
  .ficha dt { padding-bottom: 2px; border-bottom: 0; }
  .ficha dd { padding-top: 2px; }
}

/* ---------- Proyectos ---------- */
.grid-proyectos {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}
@media (max-width: 820px) { .grid-proyectos { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 30px; transition: transform .2s ease, border-color .2s ease;
}
a.card:hover { transform: translateY(-3px); border-color: var(--teal); color: inherit; }
.card h3 {
  font-family: var(--serif); font-weight: 560; font-size: 24px; margin-bottom: 4px;
  color: var(--ink);
}
.card .domain { font-size: 12.5px; color: var(--muted); letter-spacing: .05em; margin-bottom: 14px; }
.card p.desc { color: var(--ink-dim); font-size: 15px; flex: 1; }
.card .chips { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 11.5px; letter-spacing: .06em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
}
.card .zinger {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-soft);
  font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted);
}
.card .go {
  position: absolute; top: 26px; right: 26px; color: var(--muted);
  font-size: 18px; transition: color .2s ease, transform .2s ease;
}
a.card:hover .go { color: var(--teal-bright); transform: translate(2px, -2px); }

/* DEC Obscura — la tarjeta que no explica nada */
.card.obscura {
  background: var(--obscura); border-color: #161d1f; overflow: hidden;
}
.card.obscura h3 { letter-spacing: .12em; }
.card.obscura p.desc { color: #6d7a76; }
.card.obscura .zinger { color: #55605d; }
.card.obscura .badge {
  position: absolute; top: 26px; right: 26px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #6d7a76; border: 1px solid #1d2628; border-radius: 999px; padding: 4px 10px;
}

/* ---------- Herramientas ---------- */
.grid-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 820px) { .grid-tools { grid-template-columns: 1fr; } }
.tool {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 24px; transition: border-color .2s ease, transform .2s ease;
}
.tool:hover { border-color: var(--teal); transform: translateY(-2px); color: inherit; }
.tool b { font-size: 16px; font-weight: 600; color: var(--ink); display: block; }
.tool span { font-size: 13.5px; color: var(--muted); }
.tool .go { color: var(--muted); }
.tool:hover .go { color: var(--teal-bright); }
.tools-disclaimer {
  margin-top: 28px; font-size: 13.5px; color: var(--muted);
  border-left: 2px solid var(--amber-soft); padding-left: 16px; max-width: 62ch;
}

/* ---------- Contacto ---------- */
.contacto-box { max-width: 620px; color: var(--ink-dim); }
.contacto-box .nota { font-family: var(--serif); font-style: italic; color: var(--muted); margin-top: 12px; font-size: 14.5px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line-soft); padding: 56px 0 40px;
  background: var(--bg-deep); position: relative;
}
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand { font-family: var(--serif); font-size: 20px; margin-bottom: 10px; }
.foot-tag { color: var(--muted); font-size: 14px; max-width: 40ch; }
.foot-list { list-style: none; }
.foot-list li { padding: 5px 0; font-size: 14px; }
.foot-list a { color: var(--ink-dim); }
.foot-list a:hover { color: var(--ink); }
.foot-list .dim { color: var(--muted); }
.foot-legal {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.foot-legal .serif { font-family: var(--serif); font-style: italic; }

/* ---------- 404 ---------- */
.page-404 {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.page-404 .code {
  font-family: var(--serif); font-weight: 300; font-size: clamp(90px, 18vw, 180px);
  line-height: 1; color: var(--teal); letter-spacing: .02em;
}
.page-404 h1 { font-size: clamp(24px, 4vw, 36px); margin: 18px 0 10px; }
.page-404 p { color: var(--ink-dim); max-width: 52ch; }
.page-404 .en { margin-top: 26px; font-size: 14px; color: var(--muted); }
.page-404 .btn { margin-top: 34px; }
