/* PTIA — Editorial light-luxury. Tokens, type, layout. */

:root {
  /* Palette — warm paper, deep ink, Portuguese ochre, oxblood */
  --paper: oklch(96.5% 0.012 80);
  --paper-2: oklch(98% 0.008 80);
  --paper-3: oklch(93% 0.014 80);
  --ink: oklch(18% 0.012 60);
  --ink-2: oklch(28% 0.014 60);
  --ink-soft: oklch(40% 0.012 60);
  --ink-mute: oklch(54% 0.01 60);
  --rule: oklch(82% 0.012 70);
  --rule-soft: oklch(88% 0.012 70);

  --ochre: oklch(64% 0.16 60);
  --ochre-deep: oklch(52% 0.17 50);
  --oxblood: oklch(38% 0.13 25);

  /* Typography */
  --font-display: "Fraunces", "Iowan Old Style", "Hoefler Text", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --fs-step: clamp(1rem, 0.94rem + 0.3vw, 1.0625rem);
  --fs-body: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  --fs-lead: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --fs-h2: clamp(2.2rem, 1.4rem + 3vw, 4rem);
  --fs-h3: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
  --fs-display: clamp(3rem, 1.2rem + 9vw, 10rem);

  /* Spacing */
  --space-section: clamp(4rem, 2.5rem + 6vw, 9rem);
  --space-band: clamp(2.5rem, 1.5rem + 3vw, 5.5rem);
  --gutter: clamp(1.25rem, 0.6rem + 3vw, 3rem);
  --measure: 64ch;

  /* Motion */
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  /* Subtle paper grain */
  background-image:
    radial-gradient(oklch(0% 0 0 / 0.018) 1px, transparent 1px),
    radial-gradient(oklch(0% 0 0 / 0.012) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

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

a { color: inherit; text-decoration: none; }

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

em { font-style: italic; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: 1rem;
  padding: 0.6rem 1rem;
  background: var(--ink); color: var(--paper);
  border-radius: 4px;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

/* ────────── Masthead ────────── */

.masthead {
  position: sticky; top: 0;
  z-index: 10;
  background: oklch(96.5% 0.012 80 / 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.masthead-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gutter);
  padding: 1.1rem var(--gutter);
}
.masthead-rule {
  height: 1px;
  background: var(--ink);
  max-width: 1440px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  text-decoration: none;
}
.brand-logo {
  width: clamp(7.5rem, 10vw, 10.5rem);
  max-height: 4.2rem;
  object-fit: contain;
  filter: drop-shadow(0 0.45rem 0.9rem oklch(0% 0 0 / 0.16));
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
  line-height: 1;
}
.brand-mark-em { color: var(--ochre-deep); font-style: italic; padding: 0 0.05em; }
.brand-tag {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.masthead nav {
  display: flex;
  gap: clamp(1rem, 0.5rem + 1.5vw, 2.25rem);
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
}
.masthead nav a {
  position: relative;
  padding: 0.25rem 0;
  color: var(--ink-2);
  transition: color var(--dur-fast) var(--ease-out);
}
.masthead nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-med) var(--ease-out);
}
.masthead nav a:hover,
.masthead nav a:focus-visible { color: var(--ink); outline: none; }
.masthead nav a:hover::after,
.masthead nav a:focus-visible::after { transform: scaleX(1); }

.masthead-meta {
  text-align: right;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.5;
  font-feature-settings: "tnum";
}
.masthead-meta-date { display: block; color: var(--ink-2); font-weight: 500; }

@media (max-width: 820px) {
  .masthead-inner { grid-template-columns: auto auto; grid-template-rows: auto auto; }
  .masthead nav { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .masthead-meta { display: none; }
}

/* ────────── Hero ────────── */

.hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(2.5rem, 1.5rem + 4vw, 6rem) var(--gutter) var(--space-band);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: clamp(2rem, 1rem + 3vw, 5rem);
  align-items: start;
}
.hero-grid { min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  font-weight: 600;
  margin: 0 0 2rem;
}
.eyebrow-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ochre);
  box-shadow: 0 0 0 4px oklch(64% 0.16 60 / 0.18);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hero-headline {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  color: var(--ink);
  margin: 0;
  max-width: 17ch;
}
.hero-line {
  display: block;
  opacity: 0;
  transform: translateY(0.5em);
  animation: lineIn 800ms var(--ease-out) forwards;
}
.hero-line:nth-child(1) { animation-delay: 80ms; }
.hero-line:nth-child(2) { animation-delay: 180ms; }
.hero-line:nth-child(3) { animation-delay: 320ms; }
.hero-line:nth-child(4) { animation-delay: 480ms; }
.hero-line:nth-child(5) { animation-delay: 580ms; }
@keyframes lineIn { to { opacity: 1; transform: none; } }

.hero-line-emph { color: var(--ink); }
.hero-line-italic { font-style: italic; font-weight: 300; color: var(--ink-2); }

.strike {
  position: relative;
  display: inline-block;
  color: var(--ink-mute);
}
.strike-bar {
  position: absolute;
  left: -0.05em; right: -0.05em;
  top: 52%;
  height: 0.08em;
  background: var(--oxblood);
  transform: scaleX(0);
  transform-origin: left;
  animation: strikeIn 700ms 900ms var(--ease-out) forwards;
}
@keyframes strikeIn { to { transform: scaleX(1); } }

.hero-lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 2rem 0 0;
  max-width: 50ch;
  font-weight: 400;
}
.hero-lead em { color: var(--ink); font-style: italic; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.cta-primary { background: var(--ink); color: var(--paper); }
.cta-primary:hover { transform: translateY(-1px); background: var(--ochre-deep); }
.cta-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.cta-ghost:hover { background: var(--ink); color: var(--paper); }
.cta-arrow { transition: transform var(--dur-fast) var(--ease-out); }
.cta:hover .cta-arrow { transform: translateX(3px); }
.cta:focus-visible { outline: 2px solid var(--ochre-deep); outline-offset: 3px; }

.hero-method {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.hero-method > div {
  padding: 0 1rem 0 0;
  border-right: 1px solid var(--rule-soft);
}
.hero-method > div:last-child { border-right: 0; }
.hero-method dt {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ochre-deep);
  font-feature-settings: "tnum";
  letter-spacing: 0;
  margin-bottom: 0.4rem;
}
.hero-method dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.3;
}

.hero-side {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
}
.hero-side::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-top: 3px solid var(--ink);
  pointer-events: none;
}
.side-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  font-weight: 600;
  margin: 0 0 1rem;
}
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.side-list li {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.6rem;
  align-items: baseline;
}
.side-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.side-list span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--ochre-deep);
  font-weight: 600;
  font-feature-settings: "tnum";
}
.side-note {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-style: italic;
  line-height: 1.5;
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { max-width: 28rem; }
}

@media (max-width: 540px) {
  .hero-method { grid-template-columns: repeat(2, 1fr); gap: 1rem 0; }
  .hero-method > div:nth-child(2) { border-right: 0; }
}

/* ────────── Bands ────────── */

.band {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-band) var(--gutter);
}
.band-paper { border-top: 1px solid var(--rule); }
.band-ink {
  background: var(--ink);
  color: var(--paper);
  max-width: none;
  padding-left: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter)));
  padding-right: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter)));
}

.band-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  max-width: 64rem;
  margin-bottom: clamp(2rem, 1rem + 2.5vw, 3.5rem);
}
.band-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  font-weight: 600;
  margin: 0;
}
.band-eyebrow-on-ink { color: oklch(75% 0.14 60); }
.band-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
  max-width: 22ch;
  font-variation-settings: "opsz" 100;
}
.band-title em { font-style: italic; font-weight: 300; color: var(--ochre-deep); }
.band-title-on-ink { color: var(--paper); }
.band-title-on-ink em { color: oklch(78% 0.14 60); }
.band-deck {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0.5rem 0 0;
  line-height: 1.55;
}
.band-deck-on-ink { color: oklch(78% 0.012 80); }

/* Articles */

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}
.article {
  padding: 1.75rem 1.5rem 1.75rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.75rem;
  position: relative;
  transition: background-color var(--dur-med) var(--ease-out);
}
.article:hover { background: var(--paper-3); }
.article:hover .article-title { color: var(--ochre-deep); }
.article-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  font-weight: 600;
  margin: 0;
}
.article-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.article-body {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.article-source {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  font-weight: 600;
  margin-top: 0.5rem;
}
.article-source::before {
  content: "→";
  transition: transform var(--dur-fast) var(--ease-out);
}
.article:hover .article-source::before { transform: translateX(3px); }
.article-source-mute { color: var(--ink-mute); }

.article-empty { background: var(--paper); }

/* Map list (ink band) */

.map-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border-top: 1px solid oklch(40% 0.012 60);
}
.map-item {
  padding: 2rem 1.5rem 2rem 0;
  margin-right: 1.5rem;
  border-bottom: 1px solid oklch(40% 0.012 60);
  position: relative;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}
.map-num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: oklch(75% 0.14 60);
  font-feature-settings: "tnum";
}
.map-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--paper);
  margin: 0;
}
.map-desc {
  margin: 0;
  font-size: 0.98rem;
  color: oklch(78% 0.012 80);
  line-height: 1.5;
  max-width: 32ch;
}

/* ────────── Quote band ────────── */

.quote-band {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-section) var(--gutter);
  text-align: left;
}
.quote-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  font-weight: 600;
  margin: 0 0 1.5rem;
}
.quote {
  margin: 0;
  max-width: 22ch;
}
.quote p {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 4vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 300;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 144;
}
.quote em { font-style: italic; color: var(--oxblood); font-weight: 400; }
.quote-foot {
  margin-top: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}
.quote-rule { display: inline-block; width: 2.5rem; height: 1px; background: var(--ink-mute); }

/* ────────── Newsletter ────────── */

.newsletter {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-band) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 22rem;
  gap: clamp(2rem, 1rem + 3vw, 5rem);
  align-items: end;
  border-top: 1px solid var(--rule);
}
.newsletter-form {
  display: grid;
  gap: 0.75rem;
}
.newsletter-form input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.newsletter-form input:focus-visible {
  outline: none;
  border-color: var(--ochre-deep);
  box-shadow: 0 0 0 3px oklch(64% 0.16 60 / 0.18);
}
.newsletter-form button {
  padding: 0.95rem 1.4rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.newsletter-form button[disabled] {
  background: var(--ink-mute);
  border-color: var(--ink-mute);
  cursor: not-allowed;
  opacity: 0.85;
}
.newsletter-fineprint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-mute);
  line-height: 1.5;
  font-style: italic;
}

@media (max-width: 820px) {
  .newsletter { grid-template-columns: 1fr; align-items: start; }
}

/* ────────── Colophon ────────── */

.colophon {
  border-top: 1px solid var(--ink);
  background: var(--paper-2);
}
.colophon-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-band) var(--gutter) calc(var(--space-band) / 2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.colophon-brand {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  line-height: 1;
  font-variation-settings: "opsz" 144;
}
.colophon-brand span { color: var(--ochre-deep); font-style: italic; padding: 0 0.06em; }
.colophon-tag {
  margin: 1rem 0 0;
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 36ch;
  font-style: italic;
  line-height: 1.5;
}
.colophon-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.colophon-meta li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
}
.colophon-meta li:last-child { border-bottom: 0; padding-bottom: 0; }
.colophon-meta span {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
}
.colophon-fineprint {
  grid-column: 1 / -1;
  margin: 1.5rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1rem;
}

@media (max-width: 720px) {
  .colophon-inner { grid-template-columns: 1fr; }
  .colophon-meta li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ────────── Admin pages (preserved contract) ────────── */
.hidden { display: none !important; }
.admin-gate { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.admin-gate > div { width: min(36rem, 100%); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: 2.5rem; }
.admin-gate h1 { font-family: var(--font-display); font-size: 3rem; color: var(--ink); margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.admin-gate .lead { color: var(--ink-soft); margin: 0 0 1.5rem; }
.admin-error { color: var(--oxblood); font-weight: 600; }
.admin-frame { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
iframe { width: 100%; height: calc(100vh - 81px); border: 0; background: var(--paper); }

/* ────────── Motion preferences ────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-line { opacity: 1; transform: none; }
  .strike-bar { transform: scaleX(1); }
}
