/* trespiesdesign.com — EL MEDALLÓN (homepage only; blog + 404 keep styles.css)
   The mark is the system: sun = research, mountains = software, water = IT.
   Colors are the TresPies tokens (design-systems/TresPies/rainbow-tokens.css);
   text uses the *-deep variants, which pass AA on paper. */

:root {
  --paper: #FAF7EF; --paper-2: #F2ECDD; --white: #FFFDF8;
  --ink: #0C2222; --ink-2: #3E5250; --rule: rgba(12, 34, 34, .16);
  --sun: #FBCE0B; --amber: #FBA80B; --orange-deep: #A85E06;
  --a: #B44E08;   /* leg A · research  — ember-deep   */
  --b: #22785E;   /* leg B · software  — emerald-deep */
  --c: #0B79A8;   /* leg C · IT & AI   — cyan-deep    */
  --red: #E73B1F; --emerald: #37BB8F; --teal: #0B7D91;

  --f-display: "Segoe UI Variable Display", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Segoe UI Variable Text", "Segoe UI", "Avenir Next", system-ui, -apple-system, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --wrap: 1200px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--a); }
:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
.kicker { margin: 0 0 12px; font: 600 0.78rem/1.2 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
section { padding: clamp(56px, 8vw, 104px) 0; }
h2 { margin: 0 0 16px; font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); line-height: 1.05; font-weight: 800; max-width: 22ch; }
.intro { max-width: 60ch; color: var(--ink-2); margin: 0 0 36px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--sun); color: var(--ink);
  font: 700 1rem/1 var(--f-body); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 3px 0 var(--ink);
}
.btn:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 9px 14px; font-size: 0.9rem; box-shadow: 0 2px 0 var(--ink); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.textlink { font-weight: 700; }

/* ── header ───────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.25rem/1 var(--f-display); letter-spacing: -0.02em; }
.top-in > nav { margin-left: auto; }
.top-in > nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.top-in > nav a { text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.top-in > nav a:hover { text-decoration: underline; }
.lang { font: 600 0.82rem/1 var(--f-mono); }

/* phone menu: a native disclosure, so it opens without JS */
.menu { display: none; position: relative; }
.menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--white); font: 700 0.9rem/1 var(--f-body);
}
.menu summary::-webkit-details-marker { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu[open] .menu-icon { background: transparent; }
.menu[open] .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu[open] .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; z-index: 30;
  background: var(--white); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  padding: 6px;
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: block; padding: 12px 14px; border-radius: 8px; text-decoration: none; font-weight: 700; }
.menu-panel a:hover, .menu-panel a:focus-visible { background: var(--paper-2); color: var(--ink); }
.menu-panel li:last-child { border-top: 1px dashed var(--rule); margin-top: 4px; padding-top: 4px; }
.menu-panel li:last-child a { font: 600 0.85rem/1.2 var(--f-mono); }

/* ── hero: the mark ───────────────────────────────────────────────── */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 7vw, 96px); overflow-x: clip; }
.hero-in { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
h1 { margin: 0; font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4.4rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; }
.h-line { display: block; transition: color .25s ease; }
.h-line::before { content: ""; display: inline-block; width: .42em; height: .42em; margin: 0 .28em .1em 0; border-radius: 50%; vertical-align: middle; }
.h-line[data-part="sun"]::before { background: var(--sun); box-shadow: 0 0 0 2px var(--ink); }
.h-line[data-part="land"]::before { background: var(--b); box-shadow: 0 0 0 2px var(--ink); border-radius: 2px; transform: rotate(45deg) scale(.85); }
.h-line[data-part="water"]::before { background: var(--c); box-shadow: 0 0 0 2px var(--ink); border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(.9); }
.h-line.on[data-part="sun"] { color: var(--a); }
.h-line.on[data-part="land"] { color: var(--b); }
.h-line.on[data-part="water"] { color: var(--c); }
.lede { margin: 24px 0 0; font-size: clamp(1.08rem, 1rem + 0.35vw, 1.25rem); line-height: 1.5; max-width: 46ch; color: var(--ink-2); }

.mark { position: relative; margin: 0 0 56px; }
.mark-art { width: 78%; max-width: 480px; margin: 0; filter: drop-shadow(0 18px 30px rgba(12, 34, 34, .18)); }
.medallion-svg { display: block; width: 100%; height: auto; }
.m-part, .m-sky { transition: opacity .3s ease, filter .3s ease; }
.mark[data-focus] .m-part, .mark[data-focus] .m-sky { opacity: .2; filter: saturate(.3); }
.mark[data-focus="sun"] .m-sun, .mark[data-focus="land"] .m-land, .mark[data-focus="water"] .m-water { opacity: 1; filter: none; }

/* assembling: transform only, so a paused animation still shows the whole mark */
.mark.assemble .m-sun { animation: rise 1.1s cubic-bezier(.2, .9, .3, 1) .15s backwards; }
.mark.assemble .m-land { animation: lift .8s cubic-bezier(.2, .9, .3, 1) both; }
.mark.assemble .m-water { animation: flow 1s cubic-bezier(.2, .9, .3, 1) .05s backwards; }
@keyframes rise { from { transform: translateY(150px); } }
@keyframes lift { from { transform: translateY(46px); } }
@keyframes flow { from { transform: translateX(-60px); } }

.callout {
  position: absolute; display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: 0.92rem; line-height: 1.25; color: var(--ink);
}
.callout:hover { color: var(--ink); }
.c-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--white); border: 3px solid var(--ink); box-shadow: 0 0 0 4px rgba(250, 247, 239, .7); transition: transform .2s ease; }
.c-text { background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 7px 13px; white-space: nowrap; box-shadow: 0 2px 0 var(--ink); }
.c-text strong { font-weight: 800; }
.callout-sun .c-dot { border-color: var(--a); } .callout-sun strong { color: var(--a); }
.callout-land .c-dot { border-color: var(--b); } .callout-land strong { color: var(--b); }
.callout-water .c-dot { border-color: var(--c); } .callout-water strong { color: var(--c); }
.callout.on .c-dot, .callout:hover .c-dot, .callout:focus-visible .c-dot { transform: scale(1.35); }
/* positions are in the mark's own coordinates (viewBox 60..740) */
.callout-sun { left: 42%; top: 30%; }
.callout-land { left: 58%; top: 50%; }
.callout-water { left: 54%; top: 76%; }
/* 1001–1400px: the two-column hero leaves the mark's column too narrow for
   one-line pills, and the mountains pill ran past the viewport edge (clipped
   by .hero's overflow-x). Let the pills wrap there instead. The upper bound
   covers the longer Spanish pill (it overflowed by 4px at 1340). */
@media (min-width: 1001px) and (max-width: 1400px) {
  .c-text { white-space: normal; max-width: 190px; border-radius: 14px; }
}
.mark figcaption { position: absolute; left: 0; right: 0; top: calc(100% + 14px); display: flex; justify-content: flex-start; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-2); }
.redraw { font: 700 0.85rem/1 var(--f-mono); padding: 9px 13px; border: 2px solid var(--ink); border-radius: 8px; background: var(--white); cursor: pointer; }
.redraw:hover { background: var(--sun); }

/* ── one mark, three jobs ─────────────────────────────────────────── */
.legs { background: var(--paper-2); border-block: 1px solid var(--rule); }
.leg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.leg-card { background: var(--white); border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.leg-card.on { transform: translateY(-4px); box-shadow: 0 6px 0 var(--ink); }
.crop { border-bottom: 2px solid var(--ink); background: var(--paper); }
.crop .medallion-svg { aspect-ratio: 2.4 / 1; width: 100%; height: auto; }
.part-tag { margin: 18px 24px 4px; font: 600 0.75rem/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.part-sun .part-tag { color: var(--a); } .part-land .part-tag { color: var(--b); } .part-water .part-tag { color: var(--c); }
.leg-card h3 { margin: 0 24px 12px; font-size: 1.35rem; line-height: 1.15; font-weight: 800; }
.leg-card > p { margin: 0 24px 18px; color: var(--ink-2); font-size: 1rem; }
.offers { list-style: none; margin: 0 24px 22px; padding: 0; border-top: 1px dashed var(--rule); }
.offers li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--rule); font-weight: 600; font-size: 0.97rem; }
.st { flex: none; font: 600 0.68rem/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; border: 1.5px solid var(--ink); }
.st-live { background: var(--ink); color: var(--paper); }
.legend { margin: 22px 0 0; font-size: 0.88rem; color: var(--ink-2); max-width: 75ch; }
.arc { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.arc li { position: relative; padding: 14px 18px 14px 0; display: grid; gap: 2px; border-top: 3px solid var(--ink); }
.arc li::after { content: "→"; position: absolute; right: 14px; top: 10px; font-weight: 800; }
.arc li:last-child::after { content: ""; }
.arc strong { font: 800 1.1rem/1.2 var(--f-display); }
.arc span { font-size: 0.92rem; color: var(--ink-2); }

/* ── the first move ───────────────────────────────────────────────── */
.first-in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.first-in p { max-width: 58ch; }
.first-act { display: grid; gap: 14px; justify-items: start; padding: 24px; border: 2px dashed var(--ink); border-radius: 14px; }
.note { margin: 0; font-size: 0.85rem; color: var(--ink-2); }

/* ── proof ────────────────────────────────────────────────────────── */
.proof { background: var(--ink); color: var(--paper); }
.proof .kicker { color: #A9BDBA; }
.proof-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.proof-card { border-top: 2px solid var(--sun); padding-top: 18px; }
.proof-fig { margin: 0 0 10px; font: 800 clamp(2rem, 1.4rem + 1.6vw, 2.8rem)/1 var(--f-display); color: var(--sun); letter-spacing: -0.03em; }
.proof-card p { margin: 0 0 12px; font-size: 0.97rem; }
.proof-who { font: 600 0.75rem/1.3 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: #A9BDBA; }
.proof a:hover { color: var(--sun); }

/* ── ventures ─────────────────────────────────────────────────────── */
.vent-grid { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.vent { border: 2px solid var(--ink); border-radius: 14px; padding: 22px; background: var(--white); display: grid; align-content: start; gap: 10px; }
.vent h3 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.vent p { margin: 0; color: var(--ink-2); font-size: 0.98rem; }
.vent a { font: 600 0.85rem var(--f-mono); }
.sibling { margin: 24px 0 0; font-size: 0.92rem; color: var(--ink-2); }

/* ── about ────────────────────────────────────────────────────────── */
.about { background: var(--paper-2); border-block: 1px solid var(--rule); }
.about-in { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 56px); }
.about-text p { margin: 0 0 16px; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); max-width: 60ch; }
.about-text .sign { font: 600 0.85rem/1.5 var(--f-mono); color: var(--ink-2); margin-top: 22px; }

/* ── contact ──────────────────────────────────────────────────────── */
.contact-in { text-align: center; display: grid; justify-items: center; }
.contact h2 { max-width: none; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.8rem); }
.contact p { max-width: 54ch; margin: 0; }
.contact .ctas { justify-content: center; }
.mail { margin-top: 20px !important; font: 600 0.95rem var(--f-mono); }

.foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; font-size: 0.88rem; color: var(--ink-2); }
.foot-in p { margin: 0; }
.foot-links { margin-left: auto !important; }

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .hero-in { grid-template-columns: 1fr; }
  .mark-art { width: 70%; margin: 0 auto; }
  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .top-in > nav, .top-in > .lang { display: none; }
  .top-in > .btn-sm { margin-left: auto; }
  .menu { display: block; }
  .leg-grid, .vent-grid { grid-template-columns: 1fr; }
  .first-in, .about-in { grid-template-columns: 1fr; }
  .arc { grid-template-columns: 1fr; }
  .arc li::after { content: "↓"; }
}
@media (max-width: 600px) {
  .mark { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
  .callout { position: static; transform: none; flex-direction: row; }
  .c-text { white-space: normal; border-radius: 12px; }
  .mark figcaption { position: static; justify-content: flex-start; margin-top: 6px; }
}
@media (max-width: 520px) {
  .proof-grid { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .menu-label { display: none; }
  .top-in { gap: 10px; }
  .foot-links { margin-left: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
