/* Invictus Venture Partners — public site
   Tokens lifted from design-system/tokens; layout and copy follow the hi-fi prototypes. */

:root {
  --paper: #F6F5F0;
  --paper-2: #ECEAE3;
  --ink: #121212;
  --ink-2: #3D3C38;
  --ink-muted: #6E6C66;
  --ink-faint: #A6A49C;
  --line: #D8D6CE;
  --line-soft: #ECEAE3;
  --night-2: #2A2A2A;
  --placeholder: #9A9890;
  --plate: #E9E7E0;

  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --radius-sm: 4px;
  --gutter: 32px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
html.theme-night { background: var(--ink); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
.theme-night body { background: var(--ink); color: var(--paper); }
a { color: var(--ink); }
a:hover { color: #555; }
.theme-night a { color: var(--paper); }
.theme-night a:hover { color: var(--line); }
img { display: block; }
input, textarea, select, button { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ---------- Cross-document view transitions ---------- */
@view-transition { navigation: auto; types: ivp; }
::view-transition-old(root) { animation: ivp-vt-out .28s ease both; }
::view-transition-new(root) { animation: ivp-vt-in .32s ease both; }
@keyframes ivp-vt-out { to { opacity: 0; } }
@keyframes ivp-vt-in { from { opacity: 0; } }

@keyframes ivp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ivp-rise-far { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ivp-fade { from { opacity: 0; } to { opacity: 1; } }

/* Arriving from an internal link: the crossfade already reveals the page, so shorten entrance motion. */
body.ivp-arrived .rise, body.ivp-arrived .rise-far { animation-duration: .35s !important; animation-delay: .05s !important; }
body.ivp-arrived .paint { transition-duration: .25s !important; }

/* ---------- Painting backgrounds ----------
   With JS, paintings fade in once loaded and gated content rises after. Without JS everything is visible. */
.paint { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease; }
.js .paint { opacity: 0; }
.js .is-loaded .paint { opacity: 1; }
.js .on-load { animation-play-state: paused; }
.js .is-loaded .on-load { animation-play-state: running; }

.rise { animation: ivp-rise .5s var(--ease-out) both; }
.rise-far { animation: ivp-rise-far .7s var(--ease-out) both; }
.fade { animation: ivp-fade .5s ease both; }

/* ---------- Header / nav ---------- */
.site-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--gutter); }
.site-header .mark { display: flex; }
.site-header .mark img { height: 34px; width: auto; }
.theme-night .site-header .mark img { filter: invert(1); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { font-size: 14px; text-decoration: none; }
.site-nav a[aria-current="page"] { border-bottom: 1px solid rgba(246, 245, 240, .7); }
.btn-signin {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; white-space: nowrap;
  background: rgba(246, 245, 240, .92); color: var(--ink) !important;
  font-size: 14px; padding: 9px 16px; border-radius: var(--radius-sm); text-decoration: none;
  transition: background .15s ease;
}
.btn-signin:hover { background: #fff; }

.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }

/* Close "×" — rotates on hover */
.close-x {
  position: fixed; top: 20px; right: 24px; z-index: 10; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  transform-origin: 50% 50%; transition: transform .7s var(--ease-out), opacity .2s ease;
  --x-color: var(--paper);
}
.close-x:hover { transform: rotate(360deg); opacity: .8; }
.close-x::before, .close-x::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 1.5px; background: var(--x-color);
}
.close-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.close-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.close-x--ink { --x-color: var(--ink); }
.close-x--ink:hover { opacity: .7; }

/* ---------- Buttons, fields, chips ---------- */
.btn {
  display: inline-block; font-size: 14px; padding: 11px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s ease;
}
.btn--ink { background: var(--ink); color: var(--paper) !important; }
.btn--ink:hover { background: var(--night-2); }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--paper-2); color: var(--ink); }
.btn--lg { font-size: 15px; }
.btn[aria-disabled="true"] { cursor: not-allowed; }

.field {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 8px 14px;
  transition: border-color .15s ease;
}
.field:focus-within { border-color: var(--ink); }
.field--strong { border-color: var(--ink); }
.field__label { font-size: 12px; color: var(--ink-muted); }
.field input, .field textarea {
  border: 0; background: transparent; font-size: 15px; padding: 0; color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; }
.field textarea { resize: vertical; line-height: 1.45; }
.field--row { flex-direction: row; align-items: center; gap: 10px; }
.field--row > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.field__toggle { border: 0; background: transparent; font-size: 13px; color: var(--ink-muted); padding: 0; cursor: pointer; }

.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips-group { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.chips-group legend { font-size: 12px; color: var(--ink-muted); padding: 0; margin-bottom: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.dropzone { display: flex; flex-direction: column; gap: 6px; }
.dropzone__box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px dashed var(--ink-faint); background: #fff; border-radius: var(--radius-sm); padding: 10px 14px; cursor: pointer;
}
.dropzone__box.is-over { border-color: var(--ink); background: var(--paper); }
.dropzone__name { font-size: 14px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone__name.has-file { color: var(--ink); }
.dropzone__browse { position: relative; display: inline-flex; flex-shrink: 0; }
.dropzone__browse span { border: 1px solid var(--ink); font-size: 13px; padding: 6px 12px; border-radius: var(--radius-sm); }
.dropzone__browse input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.hint { font-size: 12px; color: var(--ink-muted); }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin: 0; }
.h1 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -0.01em; }
.h1--lg { font-size: 30px; letter-spacing: -0.015em; }

/* ---------- Home ---------- */
.home { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; background: var(--ink); display: flex; flex-direction: column; }
.home .paint { object-position: center 60%; }
.home__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,20,50,.25) 0%, rgba(10,20,50,0) 35%, rgba(10,20,50,0) 70%, rgba(20,20,20,.35) 100%); }
.home__bottom { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 24px; padding: 0 0 20px; }
.home__wordmark { margin: 0; padding: 0 var(--gutter); }
.home__wordmark img { width: 100%; height: auto; filter: invert(1) brightness(.98); opacity: .5; user-select: none; }
.home .site-footer { padding: 0 var(--gutter); color: rgba(246, 245, 240, .85); }

/* ---------- Approach ---------- */
.approach { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; background: var(--ink); display: flex; flex-direction: column; }
.approach .paint { object-position: center 40%; }
.approach__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,16,24,.86) 0%, rgba(14,16,24,.7) 55%, rgba(14,16,24,.45) 100%); }
.approach__main {
  position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: clamp(16px, 3vh, 28px); padding: 0 var(--gutter) 32px; max-width: 760px;
}
.approach__main.rise { animation-duration: 1.1s; animation-delay: .5s; }
.approach__eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(246, 245, 240, .75); }
.approach__main p { margin: 0; font-size: clamp(17px, 1.7vw, 24px); line-height: 1.5; letter-spacing: -0.005em; text-wrap: pretty; }
.approach__main p.strong { font-weight: 600; }
.sectors { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: baseline; border-top: 1px solid rgba(246, 245, 240, .35); padding: 16px 0 0; margin: 8px 0 0; font-size: 14px; list-style: none; }
.sectors .approach__eyebrow { margin-right: 8px; }
.approach .site-footer { position: relative; padding: 0 var(--gutter) 20px; color: rgba(246, 245, 240, .8); }

/* ---------- Split layout (Contact, Login) ---------- */
.split { height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-columns: minmax(360px, 560px) minmax(0, 1fr); background: var(--paper); }
.split__panel { display: flex; flex-direction: column; gap: 28px; padding: 22px var(--gutter) 28px; min-width: 0; overflow: auto; }
.split__panel .site-header { padding: 0; }
.split__art { position: relative; overflow: hidden; background: var(--plate); min-height: 360px; }
.split__art .paint { object-position: center; }
.split__mark { position: absolute; right: 24px; bottom: 24px; width: 120px; height: 565px; }
.split__mark.rise { animation-duration: .6s; animation-delay: .1s; }
.split__mark img { position: absolute; left: 100%; bottom: 0; width: 565px; height: 120px; transform: rotate(-90deg); transform-origin: left bottom; filter: invert(1); opacity: .5; }
.split__foot { font-size: 13px; color: var(--ink-muted); }

/* Contact */
.contact-view { display: flex; flex-direction: column; gap: 14px; }
.contact-view.is-centered { gap: 28px; margin: auto 0; }
.contact-lede { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: -0.015em; text-wrap: pretty; }
.contact-sent p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 420px; text-wrap: pretty; }
.contact-sent .links { display: flex; gap: 16px; font-size: 14px; }
.contact-sent .links a + a { color: var(--ink-muted); text-decoration: none; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .3s; }

/* Login */
.auth { margin: auto 0; width: 100%; max-width: 384px; display: flex; flex-direction: column; gap: 22px; }
.auth form, .auth .auth-view { display: flex; flex-direction: column; gap: 22px; }
.auth__fields { display: flex; flex-direction: column; gap: 10px; }
.auth__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.auth__actions a, .auth__link { font-size: 14px; text-underline-offset: 3px; }
.auth p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.auth .form-error { color: #B5453A; font-size: 13px; }
.auth__head { display: flex; flex-direction: column; gap: 8px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; cursor: pointer; }

/* ---------- Legal ---------- */
.legal { min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; }
.legal__main { width: 100%; max-width: 720px; margin: 0 auto; padding: 24px var(--gutter) 96px; display: flex; flex-direction: column; gap: 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; font-size: 14px; padding: 10px 12px; cursor: pointer; text-decoration: none;
  color: var(--ink-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.doc { display: flex; flex-direction: column; gap: 28px; }
.doc__head { display: flex; flex-direction: column; gap: 6px; }
.doc__date { font-size: 13px; color: var(--ink-muted); }
.doc p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.doc section { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 20px; }
.doc h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.legal .site-footer { padding: 16px var(--gutter); color: var(--ink-muted); border-top: 1px solid var(--line); }
.legal .site-footer a { color: var(--ink-muted); text-decoration: none; }
.legal .site-footer a:hover { color: var(--ink); }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: flex; flex-direction: column; }
.notfound main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 0 var(--gutter); max-width: 560px; }
.notfound p { margin: 0; color: var(--ink-2); line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .site-header { padding: 16px var(--gutter); }
  .site-header .mark img { height: 28px; }
  .site-nav { gap: 14px; }
  .btn-signin { padding: 8px 12px; gap: 6px; }

  .split { height: auto; min-height: 100vh; min-height: 100svh; overflow: visible; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .split__art { order: -1; min-height: 0; height: 180px; }
  .split__mark { display: none; }
  .split__panel { overflow: visible; padding: 16px var(--gutter) 24px; gap: 24px; }
  .close-x { position: absolute; top: 12px; right: 8px; }
  .contact-lede { font-size: 24px; }
  .fields-2 { grid-template-columns: 1fr; }
  .legal__main { padding-bottom: 64px; }
  .close-x--ink { position: fixed; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Headings that reuse eyebrow / lede styles */
h1.approach__eyebrow, h1.contact-lede { margin: 0; font-weight: 400; }
