/* Krozesta — hoja de estilo general */

:root {
  --bg: #1d1815;
  --bg-alt: #251f1a;
  --bg-contrast: #f1ebdf;
  --text: #eae4d8;
  --text-muted: #9a8f82;
  --text-contrast: #1d1815;
  --accent: #c08a45;
  --accent-2: #728a63;
  --line: rgba(154, 143, 130, 0.28);
  --line-contrast: rgba(29, 24, 21, 0.22);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --gap: 24px;
  --rhythm: 88px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.9;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(192, 138, 69, 0.45);
}

a:hover { border-bottom-color: var(--accent); }

a:focus-visible,
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.6em;
}

h1 { font-size: 44px; letter-spacing: -0.01em; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }

p { margin: 0 0 1.5em; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
}

/* ---------- marcas de escena ---------- */

.scene-mark {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--accent);
  display: block;
  margin: 0 0 10px;
}

.scene-mark::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  background: var(--accent-2);
  margin-top: 10px;
}

.caption {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  font-family: var(--sans);
}

/* ---------- perforaciones ---------- */

.perf {
  height: 12px;
  width: 100%;
  background-image: linear-gradient(to right, var(--line) 0 6px, transparent 6px 18px);
  background-size: 18px 6px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  margin: 0;
}

.perf--dark {
  background-image: linear-gradient(to right, rgba(29, 24, 21, 0.35) 0 6px, transparent 6px 18px);
}

/* ---------- cabecera ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 0;
}

.brand span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  display: block;
  line-height: 1.4;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  padding: 72px 0 var(--rhythm);
  border-bottom: 1px solid var(--line);
}

.hero .grid { row-gap: 40px; }

.hero-rail {
  grid-column: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
}

.hero-rail div {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-rail div::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent-2);
  flex: 0 0 8px;
}

.hero-text { grid-column: 3 / 11; }

.hero-text h1 { max-width: 15ch; margin-bottom: 28px; }

.hero-lead {
  grid-column: 3 / 9;
  color: var(--text);
}

.hero-figure {
  grid-column: 6 / 13;
  align-self: end;
  margin: 0;
  max-width: 620px;
  justify-self: end;
}

.hero-figure img {
  width: 100%;
  border: 2px solid var(--line);
}

.hero-figure figcaption {
  margin-top: 10px;
  text-align: right;
}

/* ---------- secciones ---------- */

.section {
  padding: var(--rhythm) 0;
  border-bottom: 1px solid var(--line);
}

.section--alt { background: var(--bg-alt); }

.section--contrast {
  background: var(--bg-contrast);
  color: var(--text-contrast);
  border-bottom: 0;
}

.section--contrast h2,
.section--contrast h3 { color: var(--text-contrast); }

.section--contrast .caption { color: #5d5346; }

.section--contrast .scene-mark { color: #8a5d20; }

.section--contrast .scene-mark::after { background: #5a7050; }

.section--contrast a { color: #8a5d20; border-bottom-color: rgba(138, 93, 32, 0.5); }

.section-head { grid-column: 1 / 3; }

.section-body { grid-column: 3 / 10; }

.section-body > :last-child { margin-bottom: 0; }

.section-wide { grid-column: 3 / 12; }

/* ---------- listas ---------- */

.cols-2 {
  columns: 2;
  column-gap: 48px;
}

ul.marks, ol.steps {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
}

ul.marks li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 14px;
  break-inside: avoid;
}

ul.marks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

ol.steps { counter-reset: step; }

ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 18px;
  break-inside: avoid;
}

ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent-2);
}

.section--contrast ul.marks li::before { background: #8a5d20; }
.section--contrast ol.steps li::before { color: #4f6446; }

/* ---------- sección de detalle ---------- */

.detail-grid { row-gap: 36px; align-items: start; }

.detail-figure {
  grid-column: 2 / 7;
  margin: 0;
}

.detail-figure img {
  width: 100%;
  border: 2px solid var(--line-contrast);
}

.detail-figure figcaption { margin-top: 10px; }

.detail-text { grid-column: 7 / 12; }

.detail-text > :last-child { margin-bottom: 0; }

/* ---------- bloques numerados (About) ---------- */

.blocks { margin-top: 8px; }

.block {
  border-top: 1px solid var(--line);
  padding: 30px 0;
}

.block:first-child { border-top: 0; padding-top: 0; }

.block .num {
  grid-column: 1 / 3;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
}

.block .body { grid-column: 3 / 10; }

.block .body > :last-child { margin-bottom: 0; }

/* ---------- páginas de texto ---------- */

.page-head {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--line);
}

.page-head .scene-mark { margin-bottom: 14px; }

.page-head h1 { max-width: 20ch; margin-bottom: 18px; }

.page-head p { grid-column: 3 / 10; margin: 0; color: var(--text-muted); }

.page-head .head-inner { grid-column: 3 / 11; }

.page-head .head-mark { grid-column: 1 / 3; }

/* ---------- pie ---------- */

.site-footer {
  background: var(--bg-contrast);
  color: var(--text-contrast);
  padding: 0 0 44px;
}

.site-footer .perf { margin-bottom: 40px; }

.footer-grid { row-gap: 28px; }

.footer-left { grid-column: 1 / 7; }

.footer-right { grid-column: 8 / 13; }

.footer-name {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0 0 10px;
}

.site-footer p { color: #5d5346; font-size: 15px; line-height: 1.7; }

.site-footer a { color: #8a5d20; border-bottom-color: rgba(138, 93, 32, 0.5); }

.site-footer ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.site-footer ul li { margin-bottom: 8px; font-size: 15px; }

.footer-mail { font-size: 15px; margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  :root { --rhythm: 64px; }
  h1 { font-size: 36px; }
  h2 { font-size: 27px; }

  .hero-text, .hero-lead { grid-column: 1 / 13; }
  .hero-figure { grid-column: 1 / 13; justify-self: start; }
  .hero-figure figcaption { text-align: left; }
  .hero-rail {
    grid-column: 1 / 13;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px 22px;
  }

  .section-head, .section-body, .section-wide { grid-column: 1 / 13; }
  .section-head { margin-bottom: 18px; }

  .detail-figure { grid-column: 1 / 8; }
  .detail-text { grid-column: 1 / 13; }

  .block .num { grid-column: 1 / 13; margin-bottom: 8px; }
  .block .body { grid-column: 1 / 13; }

  .page-head .head-mark,
  .page-head .head-inner,
  .page-head p { grid-column: 1 / 13; }

  .footer-left, .footer-right { grid-column: 1 / 13; }
}

@media (max-width: 640px) {
  :root { --rhythm: 52px; }
  body { font-size: 17px; line-height: 1.85; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  .wrap { padding: 0 20px; }
  .cols-2 { columns: 1; }
  .hero { padding-top: 48px; }
  .detail-figure { grid-column: 1 / 13; }
  .site-nav ul { gap: 14px 18px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
}
