/* Self-hosted variable General Sans, including true intermediate weights. */
@font-face {
  font-family: "General Sans Local";
  src: url("./assets/tiago-landing/fonts/GeneralSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}
:root { color-scheme: light; font-synthesis: none; }
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; background: #FAFAFA; }
body {
  margin: 0;
  min-height: 100%;
  background: #FAFAFA;
  color: #1A1A1A;
  font-family: "General Sans Local", "General Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, a { -webkit-tap-highlight-color: transparent; }
.landing {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: #FAFAFA;
  overflow: hidden;
}
.view {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.view--logo {
  opacity: 1;
  pointer-events: none;
}
/* Keep only the signature interactive, not the full-screen logo layer. */
.signature-button {
  display: block;
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.signature-button:focus-visible {
  outline: 2px solid #1A1A1A;
  outline-offset: 8px;
}
.signature {
  display: block;
  width: 400px;
  max-width: calc(100vw - 64px);
  height: auto;
  user-select: none;
}
.view--bio {
  opacity: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 110px 48px 90px;
}
.introduction {
  width: 100%;
  max-width: 840px;
  margin: auto;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 350;
  letter-spacing: 0;
  text-align: center;
  transform: translate3d(0, 24px, 0);
  will-change: transform, opacity;
}
.introduction a {
  color: inherit;
  text-decoration: none;
  font-weight: 400;
  transition: opacity 180ms ease;
}
@media (hover:hover) {
  .introduction a:hover { opacity: .7; }
  .more-button:hover { opacity: .7; }
}
.introduction a:focus-visible, .more-button:focus-visible {
  outline: 2px solid #1A1A1A;
  outline-offset: 6px;
}
.more-button {
  appearance: none;
  border: 0;
  padding: 0;
  position: absolute;
  z-index: 5;
  top: 56px;
  right: 56px;
  width: 32px;
  height: 32px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 180ms ease;
}
.more-button::before { content: ""; position: absolute; inset: -8px; }
.more-icon {
  display: block;
  width: 32px;
  height: 32px;
  transform-origin: center;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 767px) {
  .signature { width: 250px; }
  .introduction {
    max-width: 100%;
    font-size: 28px;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: left;
  }
  .view--bio { padding: 60px 48px; }
  .more-button {
    top: auto;
    bottom: 32px;
    right: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .introduction, .more-icon { will-change: auto; }
  .introduction a, .more-button { transition: none; }
}


/* Prepare only when JS is active to prevent a flash of the finished word. */
/* Hiding with dashes alone leaves tiny round linecaps visible at path starts.
   Keep each path fully transparent until its own write-on begins. */
.handwriting-pending .signature .ink-stroke { stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
.handwriting-pending .signature .ink-dot { opacity: 0; }

/* Keep the original SVG curves, but render ink at exactly 2 CSS px.
   Non-scaling-stroke compensates for the viewBox shrinking from 400px to 250px
   (or any other responsive width), including during dash animations. */
.signature .ink-stroke {
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

/* Maintain the filled i-dot at its original 400px-viewBox size in CSS pixels,
   plus a subtle 1.5% increase. JS updates --ink-dot-scale when the SVG resizes.
   This tracks the constant 2px non-scaling stroke on smaller viewports. */
.signature .ink-dot {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(var(--ink-dot-scale, 1.015));
}

/* Signature write-on: seven original SVG shapes, unaltered.
   The timeline is proportional, so editing --handwriting-duration scales all
   six strokes and the final i dot without recalculating any path geometry.
   pathLength=100 on each stroke normalises its dash length. */
:root { --handwriting-duration: 1900ms; --handwriting-delay: 200ms; }
.signature.is-writing .ink-stroke {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation-name: signature-write;
  animation-duration: calc(var(--handwriting-duration) * var(--draw-share));
  animation-delay: calc(var(--handwriting-delay) + var(--handwriting-duration) * var(--draw-start));
  animation-timing-function: cubic-bezier(.38, 0, .64, 1);
  animation-fill-mode: both;
}
.signature.is-writing .ink-dot {
  animation: signature-dot calc(var(--handwriting-duration) * var(--draw-share))
             cubic-bezier(.16, 1, .3, 1)
             calc(var(--handwriting-delay) + var(--handwriting-duration) * var(--draw-start)) both;
}
/* animation-fill-mode: both holds opacity: 0 throughout a stroke's delay.
   The stroke becomes visible only once the dash has begun to move. */
@keyframes signature-write {
  0%, 3% { stroke-dashoffset: 100; opacity: 0; }
  4% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes signature-dot {
  from { opacity: 0; transform: scale(calc(var(--ink-dot-scale, 1.015) * .3)); }
  to { opacity: 1; transform: scale(var(--ink-dot-scale, 1.015)); }
}
@media (prefers-reduced-motion: reduce) {
  .handwriting-pending .signature .ink-stroke { stroke-dashoffset: 0; opacity: 1; }
  .handwriting-pending .signature .ink-dot { opacity: 1; }
  .signature.is-writing .ink-stroke { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .signature.is-writing .ink-dot { animation: none; opacity: 1; transform: scale(var(--ink-dot-scale, 1.015)); }
}
