/* ==========================================================================
   Atajo — sopmacsl.com
   Theme: "Papel y tinta" — warm paper ground, deep teal ink, amber accent.
   Bootstrap 5.3 handles grid/components; this file owns brand, type and rhythm.
   ========================================================================== */

:root {
  /* Paper ground */
  --paper:        #f7f4ed;
  --paper-2:      #f0ebe0;
  --paper-3:      #e7e0d1;
  --card:         #fffdf8;

  /* Ink */
  --ink:          #1b1a17;
  --ink-2:        #4b463d;
  --ink-3:        #7a7367;

  /* Brand */
  --teal:         #0e6b5c;
  --teal-dark:    #084a3f;
  --teal-light:   #14907b;
  --amber:        #c4801f;
  --amber-soft:   #f3e3c6;

  --line:         #ddd4c2;
  --line-strong:  #c7bca6;

  --radius:       4px;   /* deliberately square-ish: honours the original's flat, unrounded 2008 blog chrome */
  --radius-lg:    8px;
  --measure:      68ch;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   SAFEGUARD: content must never be hidden waiting on JavaScript.
   Any reveal/animation library is progressive enhancement only.
   -------------------------------------------------------------------------- */
[data-aos] { opacity: 1 !important; transform: none !important; }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(20, 144, 123, .045) 0, transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(196, 128, 31, .05) 0, transparent 38%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--amber-soft); color: var(--ink); }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, a:focus { color: var(--teal-dark); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.012em;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.05rem, 1.35rem + 2.6vw, 3.15rem);
  font-weight: 700;
  margin-bottom: .7rem;
}

h2 {
  font-size: clamp(1.45rem, 1.15rem + 1.15vw, 1.95rem);
  margin-top: 2.6rem;
  margin-bottom: .85rem;
  padding-left: .85rem;
  border-left: 3px solid var(--teal);
}

h3 {
  font-size: clamp(1.15rem, 1.02rem + .5vw, 1.35rem);
  margin-top: 1.9rem;
  margin-bottom: .6rem;
  color: var(--teal-dark);
}

p { margin-bottom: 1.2rem; }
strong { font-weight: 600; color: var(--ink); }

.lead-note {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Masthead + navigation
   NAV OVERFLOW GUARD: the nav must be allowed to shrink and wrap. Frameworks
   that set flex-shrink:0 push links past the viewport where they are clipped
   and silently disappear. min-width:0 + flex-wrap fixes it structurally.
   The header is `position: static` so a taller wrapped bar can never cover
   page content.
   -------------------------------------------------------------------------- */
.site-header {
  position: static;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
  min-width: 0;
  padding: 1.5rem 0 1.15rem;
}

.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.7rem, 1.35rem + 1.4vw, 2.3rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  min-width: 0;
}
.wordmark:hover, .wordmark:focus { color: var(--teal-dark); }
.wordmark .dot { color: var(--amber); }

.tagline {
  font-family: var(--font-mono);
  font-size: .765rem;
  letter-spacing: .045em;
  text-transform: lowercase;
  color: var(--ink-3);
  min-width: 0;
}

.nav-bar {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;      /* structural overflow fix */
  min-width: 0;         /* structural overflow fix */
  gap: 0 .25rem;
  list-style: none;
  margin: 0;
  padding: .1rem 0 .25rem;
}

.nav-list > li { min-width: 0; flex-shrink: 1; }

.nav-list a {
  display: block;
  padding: .5rem .7rem;
  font-size: .925rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-list a:hover,
.nav-list a:focus { color: var(--teal-dark); border-bottom-color: var(--line-strong); }
.nav-list a[aria-current="page"] { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 600; }

/* --------------------------------------------------------------------------
   Page head + content
   -------------------------------------------------------------------------- */
.page-head {
  padding: 2.9rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.2rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .75rem;
}

.prose { max-width: var(--measure); }
.prose > h1:first-child { margin-top: 0; }
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }

.prose blockquote {
  margin: 1.6rem 0;
  padding: .9rem 1.2rem;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  font-size: 1.02rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--paper-3);
  padding: .12em .38em;
  border-radius: 3px;
  color: var(--teal-dark);
}

/* Keyboard-shortcut chips — the site's signature motif */
.prose kbd, kbd {
  font-family: var(--font-mono);
  font-size: .82em;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: .1em .45em;
  white-space: nowrap;
}

/* Tables */
.prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: .96rem;
  background: var(--card);
  border: 1px solid var(--line);
}
.prose th, .prose td {
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-2);
}
.prose tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* Figures */
.figure-block { margin: 2rem 0 2.2rem; }
.figure-block img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  display: block;
}
.figure-block figcaption {
  font-family: var(--font-mono);
  font-size: .755rem;
  letter-spacing: .02em;
  color: var(--ink-3);
  margin-top: .6rem;
  padding-left: .1rem;
}

.hero-figure { margin: 0 0 2.4rem; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Index cards (homepage / hubs)
   -------------------------------------------------------------------------- */
.guide-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin: 2rem 0 .5rem; }
@media (min-width: 700px)  { .guide-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .guide-grid { grid-template-columns: repeat(3, 1fr); } }

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.guide-card:hover, .guide-card:focus {
  border-left-color: var(--amber);
  transform: translateY(-2px);
  color: inherit;
}
.guide-card .k {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .45rem;
}
.guide-card h3 {
  font-size: 1.08rem;
  margin: 0 0 .4rem;
  color: var(--teal-dark);
  line-height: 1.3;
}
.guide-card p { font-size: .93rem; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 4.5rem;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding: 2.6rem 0 2.2rem;
  font-size: .9rem;
  color: var(--ink-2);
}

.footer-grid { display: grid; gap: 1.8rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }

.site-footer h4 {
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .7rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus { color: var(--teal-dark); text-decoration: underline; }

/* The non-affiliation notice is load-bearing — it is what keeps this site from
   reading as a continuation of any earlier publication at this address.
   Do not remove it, do not shrink it out of legibility. */
.notice {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-strong);
  font-size: .835rem;
  line-height: 1.62;
  color: var(--ink-3);
  max-width: 82ch;
}
.notice p { margin-bottom: .55rem; }
.notice p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.error-wrap { padding: 4.5rem 0 2rem; text-align: center; }
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(3.4rem, 2rem + 6vw, 6rem);
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
  letter-spacing: -.03em;
}
.error-wrap .prose { max-width: 56ch; margin: 0 auto; text-align: left; }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal-dark);
  color: #fff;
  padding: .7rem 1.1rem;
  z-index: 999;
}
.skip-link:focus { left: .5rem; top: .5rem; color: #fff; }

.btn-atajo {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--teal-dark);
}
.btn-atajo:hover, .btn-atajo:focus { background: var(--teal-dark); color: #fff; }

@media print {
  .site-header, .site-footer, .nav-bar { display: none; }
  body { background: #fff; }
}

.site-footer .footer-blurb { max-width: 38ch; }
