/* brunoberger.com — homepage
   Palette: warm charcoal + amber accent. Two voices: Fraunces (Bruno), IBM Plex Mono (machine/UI). */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/fraunces-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/plex-mono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/plex-mono-500-latin.woff2') format('woff2');
}

:root {
  --bg: #141311;
  --text: #EDEAE3;
  --text-2: #B5B1A6;
  --muted: #8C897F; /* AA on --bg (5.3:1): site-name + footer separators */
  --accent: #C98A2E;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  /* choreography timeline (from page load) */
  --t-l1: 500ms;
  --t-l2: 760ms;
  --t-l3: 1020ms;
  --t-l4: 1280ms;
  --t-teach: 1780ms;
  --t-type: 2780ms;
  --t-blink: 3830ms;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 480;
  overflow: hidden;
}

/* ---- fixed chrome ---- */

.site-name {
  position: fixed;
  top: 32px;
  left: 40px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.site-footer {
  position: fixed;
  left: 40px;
  right: 40px;
  bottom: 26px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--mono);
  font-weight: 400;
}

.site-footer .links { font-size: 12px; }
.site-footer .links a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer .links a:hover { text-decoration: underline; }
.site-footer .links .sep { color: var(--muted); margin: 0 8px; }

/* ---- hero ---- */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 96px 40px 96px 13vw; /* generous asymmetric left margin */
}

.hero-title {
  max-width: 830px;
  font-size: clamp(40px, 5.5vw, 76px);
  font-weight: 480;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero-title .line { display: block; }

.coda {
  display: block;
  margin-top: 36px;
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: 0;
}

.teach { color: var(--text-2); }

.argues-wrap {
  display: inline-block;
  margin-left: 12px;
  white-space: nowrap;
}

.argues {
  display: inline-block;
  vertical-align: bottom;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 400;
  color: var(--text);
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 20px;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent);
}

/* ---- choreography (JS present + motion allowed) ---- */

@media (prefers-reduced-motion: no-preference) {
  .js .hero-title .line {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 600ms ease forwards;
  }
  .js .hero-title .line:nth-child(1) { animation-delay: var(--t-l1); }
  .js .hero-title .line:nth-child(2) { animation-delay: var(--t-l2); }
  .js .hero-title .line:nth-child(3) { animation-delay: var(--t-l3); }
  .js .hero-title .line:nth-child(4) { animation-delay: var(--t-l4); }

  .js .teach {
    opacity: 0;
    animation: fade 800ms ease forwards;
    animation-delay: var(--t-teach);
  }

  /* typing reveals pre-existing text: width 0 → 10ch in 10 steps (75ms/char) */
  .js .argues {
    width: 0;
    overflow: hidden;
    animation: typing 750ms steps(10, end) forwards;
    animation-delay: var(--t-type);
  }

  .js .cursor {
    opacity: 0;
    animation:
      fade 0ms linear var(--t-type) forwards,
      blink 1060ms steps(1, end) var(--t-blink) infinite;
  }
}

@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes typing { to { width: 10ch; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---- short desktop viewports (e.g. 1366x768): scale type so the hero
       never overflows into the footer ---- */

@media (min-width: 769px) and (max-height: 820px) {
  .hero-title { font-size: clamp(38px, 4.3vw, 58px); }
  .coda { margin-top: 28px; }
}

/* ---- mobile ---- */

@media (max-width: 768px) {
  body { overflow: auto; }

  .site-name { left: 24px; top: 24px; }

  .hero {
    padding: 96px 24px 140px;
  }

  .hero-title { font-size: clamp(34px, 9vw, 48px); }

  .coda { font-size: 21px; }
  .argues { font-size: 17px; }
  .cursor { height: 18px; }

  .site-footer {
    left: 24px;
    right: 24px;
    bottom: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
