:root {
  color-scheme: light;
  --paper: #f6f1e8;
  --paper-deep: #ede5d7;
  --surface: #fffaf1;
  --ink: #18202b;
  --ink-soft: #3c4654;
  --muted: #6d7684;
  --line: #d8cfbf;
  --line-strong: #b9ad99;
  --accent: #1f4fd8;
  --accent-deep: #173a9e;
  --accent-soft: #e6ecff;
  --gold: #a96f16;
  --header: rgba(246, 241, 232, 0.88);
  --header-border: rgba(24, 32, 43, 0.12);
  --shadow: 0 18px 50px rgba(24, 32, 43, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1117;
  --paper-deep: #090d13;
  --surface: #121822;
  --ink: #e8eef5;
  --ink-soft: #c4cfdb;
  --muted: #93a0b1;
  --line: #2a3544;
  --line-strong: #425169;
  --accent: #8ab4ff;
  --accent-deep: #b7ccff;
  --accent-soft: #152238;
  --gold: #f0bd58;
  --header: rgba(13, 17, 23, 0.86);
  --header-border: rgba(232, 238, 245, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(127, 127, 127, 0.045) 1px, transparent 1px) 0 0 / 88px 88px,
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Calibri", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  transition: background-color 240ms ease, color 240ms ease;
}

body::before {
  position: fixed;
  top: 0;
  bottom: 0;
  left: max(24px, calc((100vw - 1120px) / 2));
  width: 1px;
  content: "";
  background: linear-gradient(transparent, var(--line), transparent);
  opacity: 0.7;
  pointer-events: none;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

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

p,
ul,
blockquote,
h1,
h2,
h3,
h4 {
  margin-top: 0;
}

p:last-child,
ul:last-child,
blockquote:last-child {
  margin-bottom: 0;
}

ul {
  margin: 8px 0 14px;
  padding-left: 1.15rem;
}

li {
  margin: 0.28rem 0;
  color: var(--ink-soft);
}

li::marker {
  color: var(--accent);
}

strong {
  color: var(--ink);
  font-weight: 700;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  background: transparent;
}

.scroll-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  display: grid;
  grid-template-areas: "brand nav actions";
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--header-border);
  background: var(--header);
  backdrop-filter: blur(18px);
}

.wordmark {
  grid-area: brand;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.index-nav {
  display: grid;
  grid-area: nav;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.index-nav a {
  position: relative;
  display: flex;
  min-height: 46px;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 7px 9px;
  color: var(--muted);
  font-size: clamp(0.58rem, 0.68vw, 0.76rem);
  font-weight: 680;
  letter-spacing: 0.01em;
  line-height: 1.14;
}

.index-nav a span {
  color: var(--line-strong);
  font-family: Georgia, serif;
  font-size: 0.72em;
  font-style: italic;
}

.index-nav a::after {
  position: absolute;
  right: 7px;
  bottom: 4px;
  left: 7px;
  height: 1px;
  content: "";
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.index-nav a:hover,
.index-nav a.is-active {
  color: var(--ink);
}

.index-nav a:hover span,
.index-nav a.is-active span {
  color: var(--accent);
}

.index-nav a:hover::after,
.index-nav a.is-active::after {
  transform: scaleX(1);
}

.header-actions {
  display: inline-flex;
  grid-area: actions;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

.theme-toggle {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(10deg);
}

.theme-toggle .sun,
.theme-toggle .moon {
  position: absolute;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.theme-toggle .sun {
  width: 17px;
  height: 17px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.45) rotate(90deg);
}

.theme-toggle .sun::before {
  position: absolute;
  inset: -8px;
  content: "";
  border-radius: 50%;
  background: repeating-conic-gradient(var(--gold) 0 7deg, transparent 7deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 57%, black 59%);
  mask: radial-gradient(circle, transparent 57%, black 59%);
}

.theme-toggle .moon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 7px -4px 0 0 var(--accent);
  opacity: 1;
  transform: translateX(2px) scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-toggle .sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-toggle .moon {
  opacity: 0;
  transform: translateX(2px) scale(0.45) rotate(-90deg);
}

.nav-toggle {
  position: relative;
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 15px;
  height: 1.5px;
  margin: 1px 0;
  border-radius: 99px;
  background: currentColor;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.nav-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-3.5px) rotate(-45deg);
}

.doc {
  width: min(100% - 44px, 940px);
  margin: 0 auto;
  padding: 142px 0 90px;
}

.hero {
  position: relative;
  padding: 34px 0 52px;
}

.kicker {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

h1 {
  max-width: 13ch;
  margin-bottom: 28px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4.8vw, 3.8rem);
  text-wrap: balance;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
}

h4 {
  margin: 18px 0 8px;
  color: var(--accent);
  font-family: "Segoe UI", "Calibri", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 34px;
  max-width: 720px;
  color: var(--ink-soft);
}

.hero-meta p {
  margin: 0;
}

.value-quote {
  position: relative;
  max-width: 760px;
  margin: 34px 0 0;
  padding: 4px 0 4px 42px;
  border-left: 3px solid var(--gold);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(1.28rem, 2.4vw, 1.72rem);
  font-style: italic;
  letter-spacing: -0.025em;
  line-height: 1.38;
}

.value-quote::before {
  position: absolute;
  top: -0.22em;
  left: 8px;
  content: "“";
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 2.35em;
  line-height: 1;
  opacity: 0.72;
}

.doc-section {
  position: relative;
  padding: 66px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.section-head {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 34px;
}

.doc-section:not(#perfil-gains) .section-head {
  margin-bottom: 18px;
}

.section-number {
  padding-top: 0.16em;
  color: var(--line-strong);
  font-family: Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.82;
}

.prose {
  max-width: 780px;
}

.lead {
  color: var(--ink);
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.subsection {
  margin-top: 34px;
}

.subsection > h3,
.principles h3,
.project-list h3,
.contact-footer h3 {
  position: relative;
  padding-top: 18px;
}

.subsection > h3::before,
.principles h3::before,
.project-list h3::before,
.contact-footer h3::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 2px;
  content: "";
  background: var(--accent);
}

.two-column-list {
  columns: 2;
  column-gap: 44px;
  max-width: 850px;
}

.two-column-list li {
  break-inside: avoid;
}

.gains-list {
  display: grid;
  gap: 0;
}

.gain-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

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

.gain-letter {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: clamp(3.4rem, 8vw, 5.8rem);
  font-style: italic;
  line-height: 0.82;
}

.gain-body {
  max-width: 790px;
}

.gain-body h3 {
  margin-bottom: 8px;
}

.gain-body p {
  max-width: 760px;
}

.principles,
.project-list {
  display: grid;
  gap: 0;
  max-width: 860px;
}

.principles article,
.project-list article {
  padding: 8px 0 28px;
  border-top: 1px solid var(--line);
}

.principles article:first-child,
.project-list article:first-child {
  border-top: 0;
}

.principles p,
.project-list p {
  max-width: 780px;
}

.project-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  color: var(--accent);
  font-family: "Segoe UI", "Calibri", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: gap 180ms ease, color 180ms ease;
}

.project-link:hover {
  color: var(--accent-deep);
  gap: 10px;
}

.project-link span {
  transition: transform 180ms ease;
}

.signal-list {
  max-width: 800px;
}

.inline-quote {
  margin: 26px 0 0;
  padding: 18px 0 18px 26px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.5;
}

.phrase-list {
  display: grid;
  gap: 0;
  max-width: 800px;
  padding-left: 0;
  list-style: none;
}

.phrase-list li {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-style: italic;
}

.phrase-list li:first-child {
  border-top: 0;
}

.phrase-list li::before {
  content: "—";
  margin-right: 10px;
  color: var(--gold);
}

.table-wrap {
  max-width: 880px;
  overflow-x: auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

thead th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

tbody th {
  width: 32%;
  color: var(--accent-deep);
  font-weight: 700;
}

td {
  color: var(--ink-soft);
}

.final-section {
  padding-bottom: 30px;
}

.summary article {
  max-width: 820px;
}

.contact-footer {
  margin-top: 48px;
  padding: 36px 0 0;
  border-top: 1px solid var(--line-strong);
}

.contact-footer h3 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.contact-footer p {
  margin: 4px 0;
  color: var(--ink-soft);
}

.contact-footer a {
  font-weight: 700;
}

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 560ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  body::before {
    display: none;
  }

  .site-header {
    grid-template-areas: "brand actions";
    grid-template-columns: auto auto;
    min-height: 68px;
    padding: 10px 18px;
  }

  .index-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 18px 14px;
    border-bottom: 1px solid var(--header-border);
    background: var(--paper);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  }

  .site-header.nav-open .index-nav {
    display: grid;
  }

  .index-nav a {
    min-height: 0;
    flex-direction: row;
    gap: 10px;
    align-items: baseline;
    padding: 12px 4px;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
  }

  .index-nav a:first-child {
    border-top: 0;
  }

  .index-nav a::after {
    right: 4px;
    bottom: 7px;
    left: 4px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .doc {
    width: min(100% - 32px, 940px);
    padding-top: 96px;
  }

  .hero-meta,
  .two-column-list {
    grid-template-columns: 1fr;
    columns: 1;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .wordmark {
    font-size: 1.15rem;
  }

  .theme-toggle,
  .nav-toggle {
    width: 38px;
    height: 38px;
  }

  .doc {
    padding-top: 92px;
  }

  .hero {
    padding-top: 20px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.55rem, 15vw, 4rem);
  }

  .section-head,
  .gain-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-number,
  .gain-letter {
    line-height: 1;
  }

  .gain-item {
    padding: 22px 0;
  }

  th,
  td {
    display: block;
    width: 100%;
    padding: 10px 0 0;
    border-bottom: 0;
  }

  tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  tr:last-child {
    border-bottom: 0;
  }

  thead {
    display: none;
  }

  tbody th {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@page {
  size: A4;
  margin: 15mm 16mm 16mm;
}

@media print {
  :root,
  html[data-theme="dark"] {
    color-scheme: light;
    --paper: #ffffff;
    --paper-deep: #ffffff;
    --surface: #ffffff;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --line: #d1d5db;
    --line-strong: #9ca3af;
    --accent: #1d4ed8;
    --accent-deep: #1e3a8a;
    --accent-soft: #eef2ff;
    --gold: #92400e;
    --header: #ffffff;
    --header-border: #e5e7eb;
    --shadow: none;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 10.4pt;
    line-height: 1.48;
  }

  body::before,
  .site-header,
  .scroll-progress {
    display: none !important;
  }

  .doc {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .hero {
    padding: 0 0 18px;
  }

  h1 {
    max-width: 100%;
    font-size: 30pt;
  }

  h2 {
    font-size: 20pt;
  }

  h3 {
    font-size: 13pt;
  }

  .hero-meta {
    grid-template-columns: 1fr 1fr;
    font-size: 9.4pt;
  }

  .value-quote {
    margin-top: 18px;
    font-size: 12pt;
  }

  .doc-section {
    padding: 22px 0;
    border-top-color: #d1d5db;
  }

  .section-head {
    grid-template-columns: 48px 1fr;
    gap: 12px;
    margin-bottom: 14px;
  }

  .section-number {
    font-size: 24pt;
  }

  .gain-item {
    grid-template-columns: 58px 1fr;
    gap: 12px;
    padding: 12px 0;
    break-inside: avoid;
  }

  .gain-letter {
    font-size: 28pt;
  }

  .principles article,
  .project-list article,
  .subsection,
  .table-wrap,
  .inline-quote,
  .value-quote,
  .contact-footer {
    break-inside: avoid;
  }

  .two-column-list {
    columns: 2;
  }

  th,
  td {
    display: table-cell;
    width: auto;
    padding: 6px 10px 6px 0;
    border-bottom: 1px solid #d1d5db;
  }

  tr {
    display: table-row;
    border-bottom: 0;
  }

  thead {
    display: table-header-group;
  }

  tbody th {
    width: 32%;
  }

  a,
  a:hover,
  strong,
  li,
  td,
  .contact-footer p {
    color: #111827 !important;
  }

  html.js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
