/* Enkadon Capital. One stylesheet for the three pages.
   The page is drawn as an engineering sheet: a ruled frame, a grid that inks in
   under the cursor, and a title block in the corner. */

:root {
  --navy: #0e1538;
  --gold: #e2cd74;
  --g: 226, 205, 116;
  --ink: #e9ebf5;
  --mute: #8f96ba;
  --soft: #bcc1dd; /* longer passages: brighter than the muted labels, quieter than headings */
  --inset: clamp(12px, 2.2vw, 30px);
  --pad: clamp(30px, 3.2vw, 46px);
  color-scheme: dark; /* dark scrollbars and form controls to match the page */
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100vh;
  padding: var(--inset);
  background: var(--navy);
  color: var(--ink);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* selected text lights up gold, like the cursor glow */
::selection { background: rgba(240, 196, 60, .38); color: #fff3b0; text-shadow: 0 0 14px rgba(255, 222, 110, .85); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the sheet: frame, rulers, grid ---------- */

.sheet {
  /* cursor position inside the sheet; site.js keeps these current */
  --sx: 60vw;
  --sy: 38vh;
  position: relative;
  min-height: calc(100vh - 2 * var(--inset));
  border: 1px solid rgba(var(--g), .38);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  padding: var(--pad);
}

/* phones: follow the visible window as the browser's bars slide away, where that unit exists */
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
  .sheet { min-height: calc(100dvh - 2 * var(--inset)); }
}

.ruler-x, .ruler-y, .grid-base, .grid-reveal, .glow, .cross, .tag { position: absolute; left: 0; top: 0; pointer-events: none; }

.ruler-x {
  width: 100%; height: 10px;
  background:
    linear-gradient(90deg, rgba(var(--g), .7) 1px, transparent 1px) 0 0 / 80px 10px repeat-x,
    linear-gradient(90deg, rgba(var(--g), .32) 1px, transparent 1px) 0 0 / 16px 5px repeat-x;
}
.ruler-y {
  width: 10px; height: 100%;
  background:
    linear-gradient(180deg, rgba(var(--g), .7) 1px, transparent 1px) 0 0 / 10px 80px repeat-y,
    linear-gradient(180deg, rgba(var(--g), .32) 1px, transparent 1px) 0 0 / 5px 16px repeat-y;
}

.grid-base, .grid-reveal { width: 100%; height: 100%; }
.grid-base {
  opacity: .05;
  background:
    linear-gradient(rgb(var(--g)) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, rgb(var(--g)) 1px, transparent 1px) 0 0 / 80px 80px;
}
.grid-reveal {
  background:
    linear-gradient(rgba(var(--g), .3) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, rgba(var(--g), .3) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(rgba(var(--g), .1) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(var(--g), .1) 1px, transparent 1px) 0 0 / 16px 16px;
  -webkit-mask-image: radial-gradient(380px circle at var(--sx) var(--sy), #000 0, transparent 72%);
          mask-image: radial-gradient(380px circle at var(--sx) var(--sy), #000 0, transparent 72%);
}
.glow {
  width: 460px; height: 460px;
  transform: translate(calc(var(--sx) - 230px), calc(var(--sy) - 230px));
  background: radial-gradient(circle, rgba(var(--g), .13) 0, rgba(150, 172, 255, .06) 34%, transparent 70%);
  filter: blur(22px);
  will-change: transform; /* blurred once, then only moved */
}

/* crosshair and ruler read-outs appear only while a mouse is moving */
.cross, .tag { opacity: 0; transition: opacity .5s; }
.pointer-live .cross, .pointer-live .tag { opacity: 1; }
.cross-v {
  width: 1px; height: 100%; transform: translateX(var(--sx));
  background: linear-gradient(to bottom,
    rgba(var(--g), .07) 0, rgba(var(--g), .07) calc(var(--sy) - 150px),
    rgba(var(--g), .5) var(--sy),
    rgba(var(--g), .07) calc(var(--sy) + 150px), rgba(var(--g), .07) 100%);
}
.cross-h {
  height: 1px; width: 100%; transform: translateY(var(--sy));
  background: linear-gradient(to right,
    rgba(var(--g), .07) 0, rgba(var(--g), .07) calc(var(--sx) - 150px),
    rgba(var(--g), .5) var(--sx),
    rgba(var(--g), .07) calc(var(--sx) + 150px), rgba(var(--g), .07) 100%);
}
.tag {
  font: 600 10px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: .12em;
  font-variant-numeric: tabular-nums; color: var(--gold); white-space: nowrap;
}
.tag-x { transform: translate(calc(var(--sx) + 6px), 13px); }
.tag-y { transform: translate(14px, calc(var(--sy) + 6px)); }

/* ---------- content ---------- */

.top, .mid, .bottom { position: relative; z-index: 2; }

.top { display: flex; align-items: center; min-height: 24px; }
.home { display: flex; align-items: center; gap: 8px; height: 17px; text-decoration: none; }
.home span { display: block; height: 100%; }
.home-mark { color: var(--gold); }
.brand-mark, .brand-word { display: block; height: 100%; width: auto; fill: currentColor; }
.nav {
  margin-left: auto;
  font: 500 13px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: .2em; text-transform: uppercase;
  color: var(--mute); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.nav:hover { color: var(--ink); border-color: rgba(var(--g), .6); }

.mid { display: grid; place-items: center; padding-block: clamp(24px, 5vh, 48px); }

.logo { --m: min(clamp(84px, 17vh, 168px), 24vw); display: flex; flex-direction: column; align-items: center; gap: calc(var(--m) * .27); }
.logo span { display: block; }
.logo-mark { height: var(--m); color: var(--gold); }
.logo-word { height: calc(var(--m) * .41); }

.panel { width: min(100%, 820px); }
.panel h1 { font-weight: 500; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.005em; margin-bottom: clamp(16px, 3vh, 30px); }
.panel p { color: var(--mute); margin-bottom: 18px; }
.panel a, .titleblock a { color: var(--gold); text-decoration-color: rgba(var(--g), .45); text-underline-offset: 3px; }
.panel a:hover, .titleblock a:hover { text-decoration-color: var(--gold); }

/* About: one statement under its title, not a list */
.statement { width: min(100%, 700px); }
.statement h1 { padding-bottom: clamp(14px, 2.4vh, 22px); border-bottom: 1px solid rgba(var(--g), .28); }
.statement h2 { font-weight: 500; font-size: clamp(20px, 2vw, 26px); letter-spacing: .005em; margin-bottom: 10px; }
.panel .lead { color: var(--soft); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; max-width: 34em; margin-bottom: 0; }

.bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.lede { max-width: 30rem; }
.tagline { font-weight: 500; font-size: clamp(19px, 1.9vw, 24px); letter-spacing: .005em; margin-bottom: 8px; }
.blurb { color: var(--mute); font-size: 15.5px; line-height: 1.6; }

/* title block, tucked into the corner of the frame as on a real drawing */
.titleblock {
  margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)) auto;
  border-left: 1px solid rgba(var(--g), .38); border-top: 1px solid rgba(var(--g), .38);
  background: rgba(14, 21, 56, .72);
  width: min(100%, 372px); flex: none;
  display: grid; grid-template-columns: auto 1fr;
}
.titleblock dt, .titleblock dd { padding: 10px 14px; border-top: 1px solid rgba(var(--g), .2); }
.titleblock dt:first-of-type, .titleblock dt:first-of-type + dd { border-top: 0; }
.titleblock dt {
  font: 600 10.5px/1.9 "Barlow Semi Condensed", sans-serif; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mute); border-right: 1px solid rgba(var(--g), .2);
}
.titleblock dd { font-size: 14px; line-height: 1.45; }

/* ---------- landing page load: the mark is drawn as line work, then turns solid ---------- */

.page-home .logo-mark .mk {
  fill-opacity: 0; stroke: currentColor; stroke-width: .9; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.7s cubic-bezier(.65, 0, .2, 1) .2s forwards, solid .7s ease 1.7s forwards;
}
.page-home .logo-mark .mk2 { animation-delay: .5s, 1.9s; }
.page-home .logo-word { opacity: 0; animation: rise .9s ease 1.5s forwards; }
.page-home .top, .page-home .bottom { opacity: 0; animation: rise .9s ease 2.1s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes solid { to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* already seen once this visit: show the finished state straight away */
html.intro-done .page-home .logo-mark .mk { animation: none; fill-opacity: 1; stroke-opacity: 0; }
html.intro-done .page-home .logo-word,
html.intro-done .page-home .top,
html.intro-done .page-home .bottom { animation: none; opacity: 1; }

/* ---------- touch, small screens, reduced motion ---------- */

@media (any-pointer: coarse) {
  .nav, .titleblock a, .panel a { display: inline-flex; align-items: center; min-height: 44px; }
  .titleblock a { margin-block: -12px; }
  .home { position: relative; }
  .home::after { content: ""; position: absolute; inset: -14px -8px; }
}

@media (max-width: 760px) {
  .bottom { flex-direction: column; align-items: stretch; gap: 26px; }
  .titleblock { width: auto; margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)); border-left: 0; }
  .tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .logo-mark .mk { animation: none; fill-opacity: 1; stroke-opacity: 0; }
  .page-home .logo-word, .page-home .top, .page-home .bottom { animation: none; opacity: 1; }
  .cross, .tag, .nav { transition: none; }
}
