/* 42CAP — site styles.
   Look & feel carried over from the 2024 site: dark green canvas with soft glows,
   thin lime outline frames with folder tabs, boxed navigation, light-green cards,
   and headlines that pair Surt Light with Recoleta. */

/* ---------- Fonts ----------
   Licensed web fonts. Only Light (300) and Regular (400) are licensed, so no bold;
   font-synthesis: none stops browsers faking one. */
@font-face { font-family: "Recoleta"; src: url("/assets/fonts/Recoleta-Light.woff2") format("woff2"), url("/assets/fonts/Recoleta-Light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Recoleta"; src: url("/assets/fonts/Recoleta-Regular.woff2") format("woff2"), url("/assets/fonts/Recoleta-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Surt"; src: url("/assets/fonts/Surt-Light.woff2") format("woff2"), url("/assets/fonts/Surt-Light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Surt"; src: url("/assets/fonts/Surt-Regular.woff2") format("woff2"), url("/assets/fonts/Surt-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }

/* ---------- Brand + surface tokens ---------- */
:root {
  --dark: #05201B;
  --green: #308C5D;
  --lime: #C7FF93;
  --mint: #E3FFC9;

  --font-head: "Recoleta", Georgia, "Times New Roman", serif;
  --font-body: "Surt", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --page-x: 16px;   /* frame distance from the window edge */
  --wrap: 1200px;   /* max content width inside frames */
  --tab-h: 40px;
}

/* Dark surface (default everywhere) */
:root {
  --bg: var(--dark);
  --fg: var(--mint);
  --fg-muted: rgba(227, 255, 201, .72);
  --accent: var(--lime);
  --line: rgba(199, 255, 147, .55);
  --line-soft: rgba(199, 255, 147, .22);
  --card-bg: var(--mint);
  --card-fg: var(--dark);
  --card-muted: #3D5A52;
  --glow-a: rgba(48, 140, 93, .55);
  --glow-b: rgba(48, 140, 93, .35);
  --header-bg: rgba(5, 32, 27, .72);
}

/* Option B: light surface for reading pages (Point of View, legal) */
html[data-variant="light-reading"].is-reading {
  --bg: #F5FFEC;
  --fg: var(--dark);
  --fg-muted: #3D5A52;
  --accent: var(--green);
  --line: rgba(5, 32, 27, .45);
  --line-soft: rgba(5, 32, 27, .16);
  --card-bg: var(--dark);
  --card-fg: var(--mint);
  --card-muted: rgba(227, 255, 201, .75);
  --glow-a: rgba(199, 255, 147, .65);
  --glow-b: rgba(48, 140, 93, .14);
  --header-bg: rgba(245, 255, 236, .78);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; font-family: var(--font-body); font-weight: 400; font-synthesis: none; color: var(--fg); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--lime); color: var(--dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--lime); color: var(--dark); padding: 8px 16px; z-index: 100; }
.skip:focus { left: 16px; top: 16px; }

/* ---------- Background glow ---------- */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow span { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); }
.glow span:nth-child(1) { background: radial-gradient(circle, var(--glow-a) 0%, transparent 62%); top: -38vmax; right: -30vmax; animation: drift1 38s ease-in-out infinite alternate; }
.glow span:nth-child(2) { background: radial-gradient(circle, var(--glow-a) 0%, transparent 60%); bottom: -40vmax; left: -28vmax; animation: drift2 46s ease-in-out infinite alternate; }
.glow span:nth-child(3) { background: radial-gradient(circle, var(--glow-b) 0%, transparent 60%); top: 10vh; left: 25vw; width: 50vmax; height: 50vmax; animation: drift1 54s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(-12vw, 14vh) scale(1.1); } }
@keyframes drift2 { to { transform: translate(16vw, -10vh) scale(.92); } }
@media (prefers-reduced-motion: reduce) { .glow span { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Header: logo box + one box per nav item ---------- */
.site-header { position: sticky; top: 12px; z-index: 50; display: flex; margin: 12px var(--page-x) 0; height: 56px; }
.site-header__logo, .site-nav a, .site-menu summary {
  display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px;
  background: var(--header-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.site-header__logo { flex: 1; padding: 0 18px; min-width: 0; }
.site-header__logo img { height: 28px; width: auto; display: block; }
.logo-on-light { display: none !important; }
html[data-variant="light-reading"].is-reading .logo-on-dark { display: none !important; }
html[data-variant="light-reading"].is-reading .logo-on-light { display: block !important; }
.site-nav { display: flex; }
.site-nav a, .site-menu summary { justify-content: center; min-width: 168px; padding: 0 20px; text-decoration: none; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); transition: background .2s, color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--lime); color: var(--dark); border-color: var(--lime); }
.site-menu { display: none; position: relative; }
.site-menu summary { list-style: none; cursor: pointer; height: 100%; min-width: 96px; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu[open] summary { background: var(--lime); color: var(--dark); }
.site-menu nav { position: absolute; right: 0; top: 64px; width: min(280px, calc(100vw - 32px)); display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.site-menu nav a { padding: 14px 12px; text-decoration: none; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); border-radius: 8px; }
.site-menu nav a:hover { background: var(--lime); color: var(--dark); }

/* ---------- Frames: thin outline with a folder tab ---------- */
.frame { position: relative; margin: 72px var(--page-x) 0; padding-top: var(--tab-h); }
.frame--hero, .frame--first { margin-top: 16px; }
.frame--hero { padding-top: 0; }
.frame__line { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.frame__line path { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.frame__tab { position: absolute; top: 0; left: 0; height: var(--tab-h); display: flex; align-items: center; padding: 0 22px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.frame__inner { max-width: var(--wrap); margin: 0 auto; padding: 88px 48px 96px; display: flex; flex-direction: column; gap: 56px; }
/* No-JS fallback: plain CSS border instead of the drawn outline */
.frame:not(.is-drawn) > .frame__inner { max-width: none; border: 1px solid var(--line); border-radius: 0 24px 24px 24px; }
.frame--hero:not(.is-drawn) > .frame__inner { border-radius: 24px; }
.frame:not(.is-drawn) > .frame__tab { border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }

/* Hero: tall frame, headline bottom-left, scroll notch bottom-right */
.frame--hero .frame__inner { max-width: none; min-height: calc(100svh - 96px); justify-content: flex-end; padding: 96px clamp(24px, 4vw, 64px) clamp(40px, 6vw, 80px); gap: 40px; }
.frame__notch { position: absolute; right: 0; bottom: 0; width: 64px; height: 64px; display: flex; align-items: flex-end; justify-content: flex-end; text-decoration: none; }
.frame__notch span { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); font-size: 20px; transition: background .2s, color .2s; }
.frame__notch:hover span { background: var(--lime); color: var(--dark); }
.frame--hero:not(.is-drawn) .frame__notch { display: none; }

/* ---------- Headlines: Surt Light + Recoleta ---------- */
.display, .statement { margin: 0; font-weight: 300; }
.display__sans, .display__serif { display: block; }
.display__sans { font-family: var(--font-body); font-weight: 300; color: var(--accent); }
.display__serif { font-family: var(--font-head); font-weight: 400; color: var(--fg); }
.display { font-size: clamp(40px, 5.6vw, 88px); line-height: 1.04; letter-spacing: -.01em; max-width: 17em; text-wrap: balance; }
.display .display__serif { margin-top: .12em; }
.statement { text-align: center; font-size: clamp(34px, 4.2vw, 60px); line-height: 1.08; max-width: 18em; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 26px; border-radius: 999px; background: var(--lime); color: var(--dark); border: 1px solid var(--lime); font-size: 16px; text-decoration: none; transition: background .2s, color .2s; }
.btn:hover { background: transparent; color: var(--accent); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn--ghost:hover { background: var(--lime); color: var(--dark); border-color: var(--lime); }
.btn.center { align-self: center; }

/* ---------- Portfolio table ---------- */
.pf { width: 100%; border-collapse: collapse; font-size: 16px; }
.pf th { text-align: left; font-weight: 400; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding: 0 16px 14px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pf td { padding: 20px 16px 20px 0; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
.pf th:last-child, .pf td:last-child { padding-right: 0; }
.pf tbody tr { transition: background .2s; }
.pf tbody tr:hover { background: rgba(199, 255, 147, .05); }
.pf__name, .pf__name--nolink { font-family: var(--font-head); font-size: 21px; color: var(--fg); text-decoration: none; }
a.pf__name:hover { color: var(--accent); }
a.pf__name::after { content: " ↗"; font-family: var(--font-body); font-size: 14px; color: var(--accent); opacity: 0; transition: opacity .2s; }
a.pf__name:hover::after { opacity: 1; }
.pf__tag { color: var(--fg-muted); }
.pf col.c-name { width: 22%; } .pf col.c-tag { width: 42%; }
.flag { display: inline-block; width: 24px; height: 16px; vertical-align: middle; border-radius: 2px; }
.flag--text { width: auto; height: auto; font-size: 12px; letter-spacing: .05em; border: 1px solid var(--line); padding: 0 6px; }
.pill { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.pill--active { background: var(--lime); color: var(--dark); }
.pill--exited { border: 1px solid var(--line); color: var(--fg); padding: 1px 11px; }

/* ---------- Team: photo with a light-green name plate ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }
.person { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: #0b2e26; color: var(--lime); display: grid; place-items: center; font-family: var(--font-head); font-size: 56px; }
.person__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .4s ease, transform .6s ease; }
.person__img--hover { opacity: 0; }
@media (hover: hover) { .person:hover .person__img--hover { opacity: 1; } .person:hover .person__img { transform: scale(1.02); } }
.person__card { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; background: var(--mint); color: var(--dark); border-radius: 12px; font-family: var(--font-body); font-size: 16px; overflow: hidden; }
.person__card.is-open { top: 12px; }
.person__summary { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; flex: none; }
.person__summary:focus-visible { outline: 2px solid var(--green); outline-offset: -4px; border-radius: 12px; }
.person__name { font-family: var(--font-head); font-size: 22px; line-height: 1.15; }
.person__role { font-size: 14px; color: #3D5A52; }
.person__toggle { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 18px; transition: transform .25s, background .2s; }
.person__summary:hover .person__toggle { background: var(--lime); }
.person__card.is-open .person__toggle { transform: rotate(90deg); }
.person__more { flex: 1 1 auto; min-height: 0; padding: 18px 18px 4px; overflow-y: auto; overscroll-behavior: contain; font-size: 14.5px; line-height: 1.6; color: #24423a; border-bottom: 1px solid rgba(5, 32, 27, .12); }
.js .person__card:not(.is-open) .person__more { display: none; }
.person__more p { margin: 0 0 12px; }
/* Without JS: show bios under the photo instead of on it */
.no-js .person { aspect-ratio: auto; display: block; }
.no-js .person__img { position: static; aspect-ratio: 1 / 1; }
.no-js .person__img--hover { display: none; }
.no-js .person__card { position: static; margin: 12px; }
.person__li { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dark); text-decoration: none; }
.person__li:hover { color: var(--green); }

/* ---------- Cards (light green on dark; dark on light in option B) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.cards--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { position: relative; overflow: hidden; background: var(--card-bg); color: var(--card-fg); border-radius: 18px; padding: 32px 32px 140px; }
.card--small { padding: 28px 28px 104px; }
.card__title { margin: 0 0 14px; font-family: var(--font-head); font-weight: 400; font-size: 30px; line-height: 1.15; }
.card--small .card__title { font-size: 22px; }
.card p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--card-muted); }
/* quarter-ring motif from the logo circle */
.card__arc { position: absolute; right: 32px; bottom: 0; width: 120px; height: 120px; border-radius: 120px 0 0 0; background: radial-gradient(circle at 100% 100%, transparent 0 42%, var(--green) 43%, #0d4a33 100%); }
.card--small .card__arc { width: 84px; height: 84px; right: 24px; }
html[data-variant="light-reading"].is-reading .card__arc { background: radial-gradient(circle at 100% 100%, transparent 0 42%, var(--lime) 43%, var(--green) 100%); }

/* ---------- Reading text ---------- */
.reading { gap: 48px; }
.prose { max-width: 760px; margin: 0 auto; width: 100%; font-size: 18px; line-height: 1.7; }
.prose > * { margin: 0 0 20px; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin: 40px 0 12px; font-family: var(--font-head); font-weight: 400; font-size: 28px; line-height: 1.2; color: var(--fg); }
.prose h2:first-child { margin-top: 0; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.prose li { position: relative; padding-left: 28px; color: var(--fg-muted); }
.prose li::before { content: ""; position: absolute; left: 6px; top: .68em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.prose strong { font-family: var(--font-head); font-weight: 400; font-size: 1.1em; color: var(--fg); }
.lead { font-weight: 300; font-size: 22px; line-height: 1.55; }
.closing { max-width: 820px; margin: 8px auto 0; text-align: center; font-family: var(--font-head); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.4; }

/* Legal pages */
.legal .prose { font-size: 16px; }
.prose .doclist { gap: 0; }
.prose .doclist li { padding: 18px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.prose .doclist li:last-child { border-bottom: 1px solid var(--line-soft); }
.prose .doclist li::before { display: none; }
.doclist__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.doclist p { margin: 0; font-size: 15px; }

/* ---------- Reveal on scroll (JS adds .is-pending only to below-the-fold items) ---------- */
.reveal.is-pending { opacity: 0; transform: translateY(24px); }
.reveal.is-pending.is-in { opacity: 1; transform: none; transition: opacity .8s ease, transform .8s ease; }

/* ---------- Footer (always dark) ---------- */
.site-footer {
  --fg: var(--mint); --fg-muted: rgba(227, 255, 201, .65); --accent: var(--lime); --line-soft: rgba(199, 255, 147, .25);
  margin-top: 120px; padding: 88px clamp(24px, 5vw, 80px) 40px; background: linear-gradient(to bottom, transparent, var(--dark) 96px); color: var(--fg);
}
.site-footer > div { max-width: var(--wrap); margin: 0 auto; }
.site-footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 32px; }
.site-footer__top img { height: 48px; width: auto; display: block; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 32px; font-size: 16px; }
.site-footer nav a { color: var(--fg); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size .25s, color .2s; }
.site-footer nav a:hover { color: var(--accent); background-size: 100% 1px; }
.site-footer__eu { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; margin-top: 56px !important; padding-top: 32px; border-top: 1px solid var(--line-soft); }
.site-footer__eu p { margin: 0; flex: 1 1 480px; font-size: 13px; line-height: 1.6; color: var(--fg-muted); }
.site-footer__logos { display: flex; align-items: center; gap: 40px; flex: none; }
.site-footer__logos img { width: 100px; height: auto; display: block; }
.site-footer__bottom { margin-top: 40px !important; font-size: 14px; color: var(--fg-muted); }

/* ---------- Preview-only option switch ---------- */
.variant-switch { position: fixed; left: 16px; bottom: 16px; z-index: 90; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25); font: 13px/1 var(--font-body); color: var(--dark); }
.variant-switch span { padding: 0 6px 0 10px; }
.variant-switch button { border: 0; border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--dark); font: inherit; cursor: pointer; }
.variant-switch button[aria-pressed="true"] { background: var(--dark); color: var(--lime); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .site-nav a { min-width: 0; }
}
@media (max-width: 760px) {
  :root { --page-x: 10px; --tab-h: 36px; }
  .site-nav { display: none; }
  .site-menu { display: block; }
  .site-header { top: 8px; margin-top: 8px; height: 52px; }
  .frame { margin-top: 56px; }
  .frame__inner { padding: 56px 18px 64px; gap: 40px; }
  .frame--hero .frame__inner { min-height: calc(100svh - 84px); padding: 64px 20px 88px; }
  .frame__tab { padding: 0 16px; font-size: 11px; }
  .prose { font-size: 17px; }
  .lead { font-size: 19px; }
  .site-footer { padding-top: 64px; }

  /* portfolio rows become cards */
  .pf, .pf tbody, .pf tr, .pf td { display: block; width: 100%; }
  .pf thead, .pf colgroup { display: none; }
  .pf tr { padding: 18px 0; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
  .pf tr:first-child { border-top: 1px solid var(--line); }
  .pf td { padding: 0; border: 0; }
  .pf td.c-name { grid-column: 1; }
  .pf td.c-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .pf td.c-tag { grid-column: 1 / -1; }
  .pf td.c-meta { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--fg-muted); }
  .pf td.c-year, .pf td.c-country, .pf td.c-layer { display: none; }
  .team { grid-template-columns: 1fr; }
}
@media (min-width: 761px) { .pf td.c-meta { display: none; } }

/* Point of View: one frame, plain document-style text */
.prose--doc h2 { margin-top: 48px; }
.prose--doc li { color: var(--fg); }

/* Home hero: headline and button centred */
.frame--hero .frame__inner { justify-content: center; align-items: center; text-align: center; }
.frame--hero .display { margin: 0 auto; }
.frame--hero .btn { align-self: center; }

/* Point of View: underline the lead words of each bullet for easier scanning */
.prose--doc li strong { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* Home hero: short positioning line under the headline */
.hero__tagline { margin: -8px 0 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); }
.hero__tagline span { color: var(--accent); margin: 0 .5em; }
@media (max-width: 760px) { .hero__tagline { font-size: 11.5px; letter-spacing: .1em; } }
