/* Cantaris. A small static website designed to stand on its own. */
:root {
  color-scheme: light;
  --navy: #013668;
  --blue: #7fb3c8;
  --paper: #fdfdfc;
  --paper-about: #f7f9fa;
  --quiet: #4f7189;
  --serif: Baskerville, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height:100%; background:var(--paper); -webkit-text-size-adjust:100%; }
body { min-height:100%; margin:0; font-family:var(--serif); color:var(--navy); background:var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color:inherit; text-decoration:none; text-underline-offset:.23em; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--navy); outline-offset: 5px; border-radius:2px; }
.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; }
.skip-link { position:absolute; z-index:20; left:1.1rem; top:-8rem; padding:.7rem 1rem; background:var(--navy); color:white; font:500 1rem/1.4 var(--serif); }
.skip-link:focus { top:.8rem; }
.shell {
  min-height:100vh;
  min-height:100svh;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  padding:clamp(1.45rem,3.4vw,3.3rem);
}
.site-header,.site-footer { display:flex; justify-content:space-between; align-items:center; gap:1.1rem; }
.site-header { z-index:1; min-height:3rem; }
.logo { display:inline-flex; flex:0 1 auto; min-width:0; align-items:center; max-width:70%; }
.logo svg { width:clamp(10.2rem,15.9vw,13.2rem); max-width:100%; height:auto; display:block; overflow:visible; }
.nav {
  min-height:2.75rem; min-width:3.25rem;
  display:inline-flex; align-items:center; justify-content:center; gap:.57rem;
  white-space:nowrap;
  font:400 clamp(1rem,1.25vw,1.125rem)/1.5 var(--serif); letter-spacing:.005em;
}
.nav svg { width:13px; height:13px; display:block; transition:transform .2s ease; }
.nav:hover svg { transform:translate(2px,-2px); }
.site-footer { justify-content:flex-end; font:400 clamp(1rem,1.25vw,1.125rem)/1.5 var(--serif); color:var(--quiet); letter-spacing:.005em; }
.site-footer a { color:var(--navy); white-space:nowrap; display:inline-flex; align-items:center; min-height:2.75rem; padding:.35rem 0; }
/* Homepage */
.content { min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:clamp(.75rem,3vh,2rem) 0; }
.tree-frame { width:min(28.2rem,86vw,54svh); aspect-ratio:630 / 730; display:block; flex:none; }
.tree-frame svg { width:100%; height:100%; display:block; overflow:visible; }
.home-heading { font:400 clamp(1.5rem,2.35vw,2.2rem)/1.25 var(--serif); letter-spacing:-.031em; text-align:center; text-wrap:balance; margin:clamp(1rem,2.4vh,1.65rem) 0 0; }
/* Finished SVG is always the fallback. CSS only adds a one-time drawing sequence. */
.twig { stroke-dasharray:1; stroke-dashoffset:0; }
.leaf { opacity:var(--opacity); }
@media (prefers-reduced-motion:no-preference) {
  /* First draw the trunk, then each connected generation of branches. */
  /* A tapered filled trunk grows upward, then hands off to the fine branches. */
  .stage-0 .trunk-shape { animation:trunk-rise 1.65s cubic-bezier(.22,.12,.18,1) backwards; }
  @keyframes trunk-rise {
    from { clip-path:inset(100% 0 0 0); }
    to   { clip-path:inset(0 0 0 0); }
  }
  .stage-1 .twig { animation:branch-draw .50s ease-out backwards 1.68s; }
  .stage-2 .twig { animation:branch-draw .50s ease-out backwards 2.20s; }
  .stage-3 .twig { animation:branch-draw .50s ease-out backwards 2.72s; }
  .stage-4 .twig { animation:branch-draw .50s ease-out backwards 3.24s; }
  .stage-5 .twig { animation:branch-draw .50s ease-out backwards 3.76s; }
  .stage-6 .twig { animation:branch-draw .50s ease-out backwards 4.28s; }
  .foliage-layer { animation:foliage-in 1.5s ease-out backwards 4.82s; }
  @keyframes branch-draw { from{stroke-dashoffset:1} to{stroke-dashoffset:0} }
  @keyframes foliage-in { from{opacity:0} to{opacity:1} }
}
/* About */
.about-page,.about-page .shell { background:var(--paper-about); }
.about-content { display:flex; min-height:0; align-items:center; justify-content:center; padding:clamp(2.5rem,7vh,5rem) 0; }
.about-inner { width:min(100%,48rem); margin:0 auto; }
.about-heading { font:400 clamp(2.65rem,5.25vw,4.35rem)/1.12 var(--serif); letter-spacing:-.044em; max-width:18ch; text-wrap:balance; margin:0; }
.about-founder { display:flex; flex-direction:column; align-items:flex-start; width:fit-content; max-width:100%; color:var(--quiet); margin:clamp(2.55rem,6vw,4rem) 0 0; }
.founder-label { display:block; font:400 clamp(1rem,1.25vw,1.125rem)/1.5 var(--serif); letter-spacing:.008em; }
.founder-signature { position:relative; display:inline-block; max-width:100%; padding:.26rem .3rem .65rem 0; }
.founder-name { display:block; font:400 clamp(1.32rem,2.3vw,1.72rem)/1.32 var(--serif); letter-spacing:-.023em; color:var(--navy); }
/* Match the founder underline to the full width of the name. */
.founder-stroke { display:block; position:absolute; bottom:.22rem; left:0; height:.78rem; width:100%; overflow:visible; }
.founder-stroke path { fill:none; stroke:var(--blue); stroke-width:1.3; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }

/* Signature-inspired reveal. The entire thought is written in two measured
   passes, rather than popping in word by word. Both passages retain natural
   text wrapping and are immediately readable when motion is reduced. */
.about-reveal-first, .about-reveal-second {
  display:block;
  position:relative;
  width:fit-content;
  max-width:100%;
}
.is-invest { position:relative; display:inline-block; vertical-align:baseline; white-space:nowrap; }
.invest-underline {
  position:absolute; width:calc(100% + .07em); left:-.025em;
  bottom:-.13em; height:.21em; display:block; overflow:visible;
  pointer-events:none;
}
.invest-underline path {
  fill:none; stroke:var(--blue); stroke-width:1.3;
  stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke;
}
@media (prefers-reduced-motion:no-preference) {
  @supports (clip-path:inset(0)) {
    .about-reveal-first { animation:founder-write 1.55s cubic-bezier(.37,.07,.26,1) both .18s; }
    .about-reveal-second { animation:founder-write 1.32s cubic-bezier(.37,.07,.26,1) both 1.78s; }
    /* The SVG clip mask is the only underline animation. This avoids
       partial strokes and premature dash caps in Safari and Chromium. */
    .invest-underline {
      clip-path:inset(0 100% 0 0);
      animation:underline-mask .90s cubic-bezier(.24,.2,.23,1) forwards 3.35s;
    }

    .founder-label { animation:founder-appear .52s ease-out both 4.35s; }
    .founder-name { animation:founder-write 1.15s cubic-bezier(.37,.07,.26,1) both 4.7s; }
    .founder-stroke {
      clip-path:inset(0 100% 0 0);
      animation:underline-mask .82s cubic-bezier(.24,.2,.23,1) forwards 5.82s;
    }

  }
  /* Reveal the full stroke with clipping alone; SVG dash lengths vary across engines. */
  @keyframes underline-mask { to { clip-path:inset(0 0 0 0); } }
  @keyframes founder-appear { from { opacity:0; } to { opacity:1; } }
  @keyframes founder-write {
    from { clip-path:inset(0 100% 0 0); opacity:.72; }
    to   { clip-path:inset(0 0 0 0); opacity:1; }
  }
}

/* Fluid layouts. Short screens scroll, rather than hiding content. */
@media(max-width:700px){
  .shell { padding:1.6rem 1.45rem; }
  .logo svg { width:10.55rem; }
  .content { padding:1.1rem 0 1.5rem; }
  .tree-frame { width:min(85vw,24rem,52svh); }
  .home-heading { font-size:clamp(1.43rem,5.7vw,1.85rem); max-width:19ch; margin-top:1.2rem; }
  .site-footer { font-size:1rem; }
  .site-footer a { padding:.35rem 0; }
  .about-content { padding:3.5rem 0; }
  .about-heading { font-size:clamp(2.6rem,8.9vw,3.75rem); max-width:17ch; }
  .about-founder { margin-top:2.9rem; }
}
@media(max-width:355px){
  .shell { padding:1.22rem 1.15rem; }
  .logo svg { width:9.2rem; }
  .tree-frame { width:min(88vw,46svh); }
  .about-heading { font-size:2.42rem; }
  .site-footer { font-size:1rem; }
}
@media(max-height:670px){
  .tree-frame { width:min(22rem,86vw,43svh); }
  .content { padding:.65rem 0 1rem; }
  .home-heading { margin-top:.6rem; }
  .about-content { padding:2.2rem 0; }
  .about-heading { font-size:clamp(2.25rem,5.3vw,3.45rem); }
  .about-founder { margin-top:2rem; }
}
@media(max-height:420px){
  .shell { padding-block:.75rem; }
  .tree-frame { width:min(16rem,82vw,35svh); }
  .home-heading { font-size:1.3rem; }
  .about-content { padding:1.2rem 0; }
}
@media(prefers-reduced-motion:reduce){ .nav svg { transition:none; } }
@media(prefers-reduced-motion:no-preference){
  @view-transition { navigation:auto; }
  ::view-transition-old(root) { animation:page-out .2s ease-in both; }
  ::view-transition-new(root) { animation:page-in .3s ease-out both; }
  @keyframes page-out { to { opacity:0; } }
  @keyframes page-in { from { opacity:0; } to { opacity:1; } }
}
@media print{
  .shell { min-height:0; padding:1in; }
  .content { padding:.5in 0; }
  .tree-frame { width:3.4in; }
  .about-content { padding:.7in 0; }
  .nav { display:none; }
}
/* Respect iPhone/iPad safe areas, including landscape and notched displays. */
@supports (padding: max(0px, env(safe-area-inset-top))) {
  .shell {
    padding-top: max(clamp(1.45rem, 3.4vw, 3.3rem), calc(env(safe-area-inset-top) + .7rem));
    padding-right: max(clamp(1.45rem, 3.4vw, 3.3rem), calc(env(safe-area-inset-right) + .7rem));
    padding-bottom: max(clamp(1.45rem, 3.4vw, 3.3rem), calc(env(safe-area-inset-bottom) + .7rem));
    padding-left: max(clamp(1.45rem, 3.4vw, 3.3rem), calc(env(safe-area-inset-left) + .7rem));
  }
  @media (max-width: 700px) {
    .shell {
      padding-top: max(1.6rem, calc(env(safe-area-inset-top) + .7rem));
      padding-right: max(1.45rem, calc(env(safe-area-inset-right) + .7rem));
      padding-bottom: max(1.6rem, calc(env(safe-area-inset-bottom) + .7rem));
      padding-left: max(1.45rem, calc(env(safe-area-inset-left) + .7rem));
    }
  }
  @media (max-width: 355px) {
    .shell {
      padding-top: max(1.22rem, calc(env(safe-area-inset-top) + .7rem));
      padding-right: max(1.15rem, calc(env(safe-area-inset-right) + .7rem));
      padding-bottom: max(1.22rem, calc(env(safe-area-inset-bottom) + .7rem));
      padding-left: max(1.15rem, calc(env(safe-area-inset-left) + .7rem));
    }
  }
}

/* Text enlargement on small screens: let the wordmark reflow safely. */
@media (max-width: 700px) {
  .site-header { gap: .4rem; }
  .logo { max-width: 52%; }
  .about-heading { overflow-wrap: anywhere; }
}

/* Robust reflow for unusually large accessibility text settings. These rules
   do not change the intended typography at ordinary sizes. */
.site-header { min-width:0; flex-wrap:wrap; }
.site-header nav { margin-left:auto; }
.content, .about-content, .about-inner { min-width:0; }
.home-heading, .about-heading, .founder-name { overflow-wrap:anywhere; }
.site-footer a { white-space:normal; overflow-wrap:anywhere; }

/* Extreme text-only zoom: keep decorative underlines inside the viewport. */
.skip-link { left:1rem; max-width:calc(100vw - 2rem); overflow-wrap:anywhere; }
@media (max-width:700px) {
  /* Keep the emphasized word inside narrow viewports at extreme text zoom. */
  .is-invest { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
}

.logo { min-height:2.75rem; }


/* The 404 page is intentionally part of the same design system as About.
   It is a real not-found page, never an automatic redirect to the homepage. */
.not-found-page,.not-found-page .shell { background:var(--paper-about); }
.not-found-content {
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(2.5rem,7vh,5rem) 0;
}
.not-found-inner { width:min(100%,48rem); margin:0 auto; }
.not-found-code {
  color:var(--quiet);
  font:400 clamp(1rem,1.25vw,1.125rem)/1.5 var(--serif);
  letter-spacing:.02em;
  margin:0 0 clamp(1rem,2vw,1.5rem);
}
.not-found-heading {
  color:var(--navy);
  font:400 clamp(2.65rem,5.25vw,4.35rem)/1.12 var(--serif);
  letter-spacing:-.044em;
  text-wrap:balance;
  overflow-wrap:anywhere;
  margin:0;
}
.not-found-return {
  display:inline-flex;
  gap:.6rem;
  align-items:center;
  min-height:2.75rem;
  padding:.4rem 0;
  margin-top:clamp(2.2rem,5vw,3rem);
  color:var(--navy);
  font:400 clamp(1rem,1.25vw,1.125rem)/1.5 var(--serif);
  letter-spacing:.005em;
}
.not-found-return svg {
  width:.9em;
  height:.9em;
  flex:none;
  transition:transform .2s ease;
}
.not-found-return:hover svg { transform:translate(2px,-2px); }
@media (max-width:700px) {
  .not-found-content { padding:3.5rem 0; }
  .not-found-heading { font-size:clamp(2.6rem,8.9vw,3.75rem); }
}
@media (max-width:355px) {
  .not-found-heading { font-size:2.42rem; }
}
@media (max-height:670px) {
  .not-found-content { padding:2.2rem 0; }
  .not-found-heading { font-size:clamp(2.25rem,5.3vw,3.45rem); }
}
@media (max-height:420px) {
  .not-found-content { padding:1.2rem 0; }
}
@media (prefers-reduced-motion:reduce) {
  .not-found-return svg { transition:none; }
}
/* Extremely enlarged text may put the icon on a new line instead of
   creating horizontal scroll on a narrow screen. */
.not-found-return { max-width:100%; flex-wrap:wrap; overflow-wrap:anywhere; }
