/* Fonts (self-hosted, no third-party requests) */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b1f2c;
  --navy: #0a2c42;
  --navy-deep: #061c2b;
  --green: #8db33f;
  --green-ink: #4f6b17;
  --red: #d90429;
  --paper: #f2efe8;
  --paper-2: #e8e3d8;
  --line: rgba(11, 31, 44, 0.16);
  --line-light: rgba(242, 239, 232, 0.18);
  --muted: #5a6670;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.3s;
  --header-h: 64px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--green); color: var(--navy-deep); }

/* Fraunces: automatic optical size, no wonky glyphs */
.hero h1, .section-head h2, .company h3, .company .idx, .company .soon, .clients h2,
.clients .mail, .timeline .step h3, .contact .big, .structure text, .legal h1, .legal h2 {
  font-optical-sizing: auto;
  font-variation-settings: "WONK" 0;
}

section[id] { scroll-margin-top: var(--header-h); }

/* Text links: thin underline that turns green */
.text-link, .clients .aside a, .contact-rows a, .legal a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--line);
  transition: text-decoration-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.legal a:hover { text-decoration-color: var(--green-ink); color: var(--green-ink); }
.clients .aside a { text-decoration-color: rgba(6, 28, 43, 0.35); }
.clients .aside a:hover { text-decoration-color: var(--navy-deep); }
.contact-rows a { text-decoration-color: var(--line-light); }
.contact-rows a:hover { text-decoration-color: var(--green); color: var(--green); }

/* Tabular figures for data */
.nav a span, .site-footer, .contact-rows p, .legal dd, .timeline .label { font-variant-numeric: tabular-nums; }

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

.label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 540;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: background-color 0.6s var(--ease), border-color 0.6s var(--ease);
}
.site-header.is-solid {
  background: var(--navy-deep);
  border-bottom-color: var(--line-light);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  transition: height 0.6s var(--ease);
}
.site-header.is-solid .wrap { height: var(--header-h); }
.brand img {
  width: 92px;
  filter: brightness(0) invert(0.95);
  transition: width 0.6s var(--ease);
}
.site-header.is-solid .brand img { width: 72px; }
.nav { display: flex; gap: 36px; }
.nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 480;
  opacity: 0.8;
  padding: 6px 0;
  transition: opacity var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.nav a span { font-size: 11px; opacity: 0.6; margin-right: 6px; font-variant-numeric: tabular-nums; }
.nav a:hover { opacity: 1; }
.nav a span { transition: color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.nav a.is-active { opacity: 1; box-shadow: inset 0 -1px 0 var(--green); }
.nav a.is-active span { color: var(--green); opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 80% 60% at 80% 40%, rgba(141, 179, 63, 0.13), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(30, 90, 130, 0.35), transparent 70%),
    var(--navy-deep);
  color: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hero::after {
  /* film grain */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero > .wrap { width: 100%; }
.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 48px;
  padding-top: 140px;
  padding-bottom: 56px;
}
.hero .label { color: var(--green); display: block; margin-bottom: 28px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(44px, 6.6vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--green);
}
.hero-intro {
  margin: 36px 0 0;
  max-width: 44ch;
  font-size: 18px;
  color: rgba(242, 239, 232, 0.72);
}

.hero-foot {
  border-top: 1px solid var(--line-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 28px;
  font-size: 13px;
  color: rgba(242, 239, 232, 0.55);
}
.scroll-cue { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.scroll-cue i {
  width: 1px;
  height: 28px;
  background: currentColor;
  display: inline-block;
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Ownership diagram */
.structure { width: 100%; max-width: 560px; justify-self: end; }
.structure svg { width: 100%; height: auto; overflow: visible; }
.structure .wire {
  fill: none;
  stroke: rgba(242, 239, 232, 0.4);
  stroke-width: 1.2;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw 1.8s var(--ease) 0.4s forwards;
}
.structure .wire.w2 { animation-delay: 0.9s; }
.structure .wire.w3 { animation-delay: 1.1s; }
.structure .ring { fill: none; stroke: rgba(242, 239, 232, 0.25); }
.structure .ring.r2 { stroke-dasharray: 2 6; animation: spin 60s linear infinite; transform-origin: 280px 90px; }
.structure .node-name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 380;
  fill: var(--paper);
  letter-spacing: -0.01em;
}
.structure .node-tag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  fill: rgba(242, 239, 232, 0.55);
}
.structure .fade { opacity: 0; animation: fade 1s var(--ease) forwards; }
.structure .d1 { animation-delay: 0.2s; }
.structure .d2 { animation-delay: 1.6s; }
.structure .d3 { animation-delay: 1.8s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 12vw, 160px) 0; }
.section-head {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: baseline;
  margin-bottom: clamp(48px, 7vw, 88px);
}
.section-head .label { color: var(--muted); }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 20ch;
}
.section-head h2 em { font-style: italic; font-weight: 300; }

/* Companies as editorial rows */
.companies { border-top: 1px solid var(--line); }
.company {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr minmax(260px, 380px);
  gap: 24px;
  align-items: center;
  padding: clamp(32px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.company::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.7s var(--ease);
}
.company:hover::before { width: 100%; }
.company .idx {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--accent);
}
.company h3 {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(56px, 9vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 0;
  transition: transform 0.6s var(--ease);
}
a.company:hover h3 { transform: translateX(14px); }
.company .meta .label { color: var(--accent); display: block; margin-bottom: 10px; }
.company .meta p { margin: 0 0 18px; color: var(--muted); font-size: 16px; }
.company .go {
  font-weight: 540;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.company .go svg { transition: transform 0.4s var(--ease); }
a.company:hover .go svg { transform: translate(4px, -4px); }
.company .soon { font-size: 14px; color: var(--muted); font-style: italic; font-family: var(--serif); }
.company--vesotel { --accent: var(--red); }
.company--inesperados { --accent: var(--green-ink); }

/* Former clients band */
.clients {
  background: var(--green);
  color: var(--navy-deep);
  padding: clamp(72px, 10vw, 140px) 0;
  position: relative;
  overflow: hidden;
}
.clients .wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
}
.clients .label { padding-top: 12px; }
.clients h2 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 18ch;
}
.clients h2 em { font-style: italic; font-weight: 300; }
.clients p { max-width: 52ch; margin: 0 0 48px; font-size: 18px; }
.clients .mail {
  font-family: var(--serif);
  font-size: clamp(30px, 5.6vw, 88px);
  font-weight: 330;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  display: inline-block;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  padding-bottom: 8px;
  transition: background-size 0.6s var(--ease);
  word-break: break-word;
}
.clients .mail:hover { background-size: 0 2px; background-position: 100% 100%; }
.clients .aside { margin-top: 32px; font-size: 15px; }
.clients .aside a { font-weight: 540; }

/* Then / now */
.timeline {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
}
.timeline .step { padding-top: 32px; }
.timeline .step .label { color: var(--muted); display: block; margin-bottom: 18px; }
.timeline .step h3 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.timeline .step p { margin: 0; color: var(--muted); max-width: 42ch; }
.timeline .step.now { border-left: 1px solid var(--line); padding-left: 32px; }
.timeline .step.now .label { color: var(--green-ink); }

/* Contact + footer (dark) */
.contact {
  background: var(--navy-deep);
  color: var(--paper);
  padding: clamp(100px, 15vw, 200px) 0 0;
}
.contact .big {
  font-family: var(--serif);
  font-weight: 320;
  font-size: clamp(64px, 13vw, 210px);
  line-height: 0.88;
  letter-spacing: -0.045em;
  margin: 0 0 clamp(56px, 8vw, 104px);
}
.contact .big em { font-style: italic; color: var(--green); font-weight: 300; }
.contact-rows {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-light);
}
.contact-rows > div { padding: 28px 24px 40px 0; }
.contact-rows > div + div { border-left: 1px solid var(--line-light); padding-left: 24px; }
.contact-rows .label { color: rgba(242, 239, 232, 0.5); display: block; margin-bottom: 12px; }
.contact-rows p { margin: 0; font-size: 18px; }

.site-footer {
  background: var(--navy-deep);
  color: rgba(242, 239, 232, 0.5);
  font-size: 13px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line-light);
}
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.site-footer a:hover { color: var(--paper); }

/* ---------- Legal pages ---------- */
.page-legal .site-header { position: sticky; top: 0; background: var(--navy-deep); border-bottom-color: var(--line-light); }
.page-legal .site-header .wrap { height: var(--header-h); }
.page-legal .brand img { width: 72px; }
.legal { padding: clamp(56px, 8vw, 112px) 0 clamp(80px, 10vw, 140px); }
.legal .wrap { max-width: 860px; margin: 0 auto; }
.legal h1 {
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(40px, 6vw, 80px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 48px;
}
.legal h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.005em;
  margin: 48px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.legal p { color: #33414b; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 28px; }
.legal dt { font-weight: 600; }
.legal dd { margin: 0; }
.legal a { color: var(--navy); }

/* Draft placeholders: remove before publishing */
.todo {
  background: rgba(255, 214, 0, 0.35);
  outline: 1px dashed rgba(160, 120, 0, 0.6);
  padding: 0 4px;
  font-family: var(--sans);
  font-size: 0.8em;
  font-style: normal;
}

/* Scroll reveal (enabled by JS only) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .structure .wire { stroke-dashoffset: 0; }
  .structure .fade { opacity: 1; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 128px; gap: 56px; }
  .structure { justify-self: start; max-width: 440px; }
  .section-head, .clients .wrap { grid-template-columns: 1fr; gap: 12px; }
  .company { grid-template-columns: 1fr; gap: 14px; }
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline > .label { padding-top: 24px; }
  .timeline .step.now { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 32px; }
  .contact-rows { grid-template-columns: 1fr; }
  .contact-rows > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-light); }
}
@media (max-width: 640px) {
  .nav a:not(:last-child) { display: none; }
  .hero-foot span:first-child { display: none; }
  .legal dl { grid-template-columns: 1fr; gap: 2px; }
  .legal dd { margin-bottom: 10px; }
}
