/* =============================================================================
   beckhamkoenig.com - clean white base + true Apple "liquid glass"
   Panels float on white; a specular highlight tracks your cursor and reacts
   on click. Notion-simple typography. Restrained, mostly-monochrome palette.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --max: 760px;

  /* Light (default) - clean white */
  --bg: #ffffff;
  --bg-tint-a: rgba(120, 145, 255, 0.05);   /* barely-there ambient */
  --bg-tint-b: rgba(150, 130, 255, 0.045);
  --text: #1d1e22;
  --text-dim: #595c64;
  --text-faint: #9aa0aa;

  /* Liquid glass */
  --glass-bg: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.42));
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-edge: rgba(17, 22, 40, 0.07);     /* hairline outer edge */
  --glass-shadow: 0 1px 2px rgba(17,22,40,.04), 0 8px 22px rgba(17,22,40,.05);
  --glass-sheen: rgba(255, 255, 255, 0.9);  /* cursor specular color */
  --hairline: rgba(17, 22, 40, 0.07);

  --accent: #4f6bed;
  --link: #2563eb;
  --cat-build: #5d72e6;
  --cat-work: #2f9e87;
  --cat-school: #d68a37;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}


/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  font-family: "Satoshi", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}
a { color: inherit; text-decoration: none; }

/* ---------- Background: white with a whisper of ambient + cursor glow ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(80% 60% at 15% 0%, var(--bg-tint-a), transparent 60%),
    radial-gradient(70% 55% at 100% 20%, var(--bg-tint-b), transparent 55%),
    var(--bg);
}
/* soft light that follows the cursor - adds life without color noise */
.cursor-glow {
  position: absolute;
  width: 520px; height: 520px;
  left: var(--cx, 50%); top: var(--cy, 30%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,150,255,.10), transparent 65%);
  pointer-events: none;
  transition: opacity .6s var(--ease);
  will-change: left, top;
}

/* ---------- Liquid glass primitive ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border);
  isolation: isolate;
}
/* moving specular highlight - the "glassy where your mouse is" effect */
.glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              var(--glass-sheen), transparent 55%);
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
}
.glass:hover::after { opacity: .55; }
/* keep card content above the sheen */
.glass > * { position: relative; z-index: 2; }

/* click ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: var(--glass-sheen);
  opacity: .45;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 1;
  animation: ripple .6s var(--ease) forwards;
}
@keyframes ripple { to { transform: translate(-50%,-50%) scale(1); opacity: 0; } }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px 120px; }
.section { margin-top: 80px; }
.card { border-radius: var(--radius); padding: 24px; }

/* lowercase "title / subtitle" section headers (kie-style) */
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.section__slash { color: var(--text-faint); font-weight: 500; letter-spacing: 0; font-size: .98rem; }
.section__action { color: var(--text-dim); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.section__action:hover { color: var(--link); }

/* inline links inside prose (blue + ↗) */
.ilink { position: relative; isolation: isolate; color: var(--link); font-weight: 600; border-radius: 7px; transition: color .25s var(--ease); }
.ilink::after { content: "↗"; font-size: .72em; margin-left: 1px; vertical-align: super; opacity: .75; }
/* Apple-style liquid-glass capsule that morphs in behind the link on hover */
.ilink::before {
  content: ""; position: absolute; inset: -2px -8px; border-radius: 8px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border);
  opacity: 0; transform: scale(.7);
  transition: opacity .26s var(--ease), transform .4s cubic-bezier(.34, 1.56, .64, 1); /* slight overshoot = liquid */
  z-index: -1; pointer-events: none;
}
.ilink:hover::before { opacity: 1; transform: scale(1); }
/* Treehous brand link uses the Treehous green, no ↗ arrow */
.ilink[href*="treehous.io"] { color: #4cb695; }
.ilink[href*="treehous.io"]::after { content: none; }
/* Takovia brand link */
.ilink[href*="takovia.com"] { color: #2563eb; }
/* No ↗ arrow on these brand/product links */
.ilink[href*="takovia.com"]::after,
.ilink[href*="hermes-agent.nousresearch.com"]::after,
.ilink[href*="claude-code"]::after { content: none; }

/* ---------- Hero (left-aligned, name + photo on one row) ---------- */
.hero { padding-top: 64px; }
.hero__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero__name { font-size: clamp(2.3rem, 8vw, 3.2rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.02; }
.hero__quote { margin-top: 12px; color: var(--text-dim); font-size: 1.06rem; font-weight: 500; max-width: 34ch; }
.hero__quote::before { content: "“"; }
.hero__quote::after { content: "”"; }
.hero__photo-ring {
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: 50%; padding: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.hero__photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--bg); }

/* ---------- Intro - kie-style narrative prose ---------- */
.intro { margin-top: 36px; max-width: 64ch; }
.intro__prose { font-size: 1.14rem; line-height: 1.65; color: var(--text); }
.intro__prose p { margin-bottom: 16px; }
.intro__prose p:last-child { margin-bottom: 0; }
.intro__prose strong { font-weight: 700; }

/* ---------- Location / time narrative line ---------- */
.locline { font-size: 1.22rem; line-height: 1.55; color: var(--text-dim); max-width: 62ch; }
.locline strong { color: var(--text); font-weight: 700; }

/* ---------- Currently / milestones - clean list, no boxes ---------- */
.milestones { display: flex; flex-direction: column; }
.milestone {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 0; font-weight: 500; font-size: 1rem;
  border-bottom: 1px solid var(--hairline);
}
.milestone:last-child { border-bottom: none; }
.milestone__emoji { font-size: 1.2rem; flex-shrink: 0; }

/* ---------- Experience + Education (org-first, with a sub-tree) ---------- */
.entry-list { display: flex; flex-direction: column; }

/* Org first, then the top role (shown big like any single role),
   with earlier positions branching beneath it as a sub-tree. */
.job { padding: 20px 0; border-bottom: 1px solid var(--hairline); }
.job:last-child { border-bottom: none; padding-bottom: 0; }
.job__org { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.role { display: grid; grid-template-columns: 1fr auto; column-gap: 20px; align-items: start; }
.job__org + .role { margin-top: 8px; } /* the main (top-of-ladder) role */
.role__title { font-weight: 600; font-size: .98rem; color: var(--text); }
.role__blurb { color: var(--text-dim); font-size: .93rem; margin-top: 6px; max-width: 52ch; }
.role__dates { color: var(--text-faint); font-size: .82rem; white-space: nowrap; padding-top: 2px; }
/* earlier roles, shown as a markdown blockquote-style indent under the main */
.job__subs {
  margin-top: 14px;
  padding-left: 16px;
  border-left: 3px solid color-mix(in srgb, var(--text-faint) 50%, transparent);
}
.job__subs .role + .role { margin-top: 14px; }
.role--sub .role__title { font-size: .94rem; }
.role--sub .role__blurb { font-size: .9rem; }

/* ---------- Blog ---------- */
.blog-list { display: flex; flex-direction: column; gap: 14px; }
.blog-post { border-radius: var(--radius); padding: 20px 22px; transition: transform .3s var(--ease); }
.blog-post:hover { transform: translateY(-3px); }
.blog-post__date { color: var(--text-faint); font-size: .78rem; font-weight: 500; }
.blog-post__title { font-size: 1.16rem; font-weight: 700; margin: 4px 0 6px; letter-spacing: -.01em; }
.blog-post__excerpt { color: var(--text-dim); font-size: .95rem; }
.blog-post__body { margin-top: 12px; }
.blog-post__body p { margin-bottom: 10px; color: var(--text); font-size: .95rem; }
.blog-post__body[hidden] { display: none; }
.blog-post__toggle { margin-top: 12px; font-size: .85rem; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; }
.blog-post__toggle:hover { text-decoration: underline; }
.blog-post__link { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--accent); font-size: .9rem; }

/* ---------- Interests ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { padding: 8px 14px; border-radius: var(--radius-xs); font-size: .88rem; font-weight: 500; color: var(--text); transition: transform .25s var(--ease), color .25s; }
.chip:hover { transform: translateY(-2px); color: var(--accent); }

/* ---------- Contact ---------- */
.contact__lead { color: var(--text-dim); margin-bottom: 18px; }
.contact__links { display: flex; flex-direction: column; gap: 10px; }
.contact__link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--hairline); transition: transform .3s var(--ease), border-color .3s; }
.contact__link:hover { transform: translateX(6px); border-color: var(--accent); }
.contact__link-icon { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--accent) 13%, transparent); font-size: .9rem; font-weight: 700; color: var(--accent); }
.contact__link-label { font-weight: 600; font-size: .92rem; }
.contact__link-value { color: var(--text-dim); font-size: .85rem; }
.contact__link-text { display: flex; flex-direction: column; }

/* ---------- Footer ---------- */
.footer { margin-top: 80px; text-align: center; color: var(--text-faint); font-size: .82rem; }
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--accent); }

/* ---------- Command palette (⌘K) ---------- */

.palette { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: 13vh; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(10,12,20,.34); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.palette__panel { position: relative; width: min(520px, 92vw); border-radius: var(--radius); padding: 8px; }
.palette__input {
  width: 100%; border: none; background: transparent; color: var(--text);
  font: inherit; font-size: 1.05rem; padding: 12px 12px 13px; outline: none;
  border-bottom: 1px solid var(--hairline); margin-bottom: 6px;
}
.palette__input::placeholder { color: var(--text-faint); }
.palette__list { list-style: none; max-height: 52vh; overflow: auto; }
.palette__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: .95rem; font-weight: 500;
}
.palette__item.is-active, .palette__item:hover { background: var(--hairline); }
.palette__item-icon { width: 22px; text-align: center; }
.palette__item-ext { margin-left: auto; color: var(--text-faint); font-size: .85rem; }

/* ---------- "Type the site" overlay (recorder + playback) ---------- */
.typing {
  position: fixed; inset: 0; z-index: 200;
  /* Always light — the typing screen is a gray "paper", never dark mode. */
  --text: #1d1e22; --text-dim: #595c64; --text-faint: #9aa0aa;
  --hairline: rgba(17,22,40,.07); --accent: #4f6bed;
  --glass-bg: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.52));
  --glass-edge: rgba(17,22,40,.08); --glass-border: rgba(255,255,255,.9);
  --glass-shadow: 0 1px 2px rgba(17,22,40,.05), 0 8px 22px rgba(17,22,40,.07);
  background: #ececee;
  display: flex; align-items: center; justify-content: center;
  padding: 7vh 22px;
  transition: opacity .55s var(--ease);
}
.typing--out { opacity: 0; pointer-events: none; }
.typing__inner { width: 100%; max-width: 760px; }
.typing__head { margin-bottom: 18px; }
.typing__title { color: var(--text-faint); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.typing__text {
  font-size: 1.3rem; line-height: 1.95;
  max-height: 64vh; overflow-y: auto; scrollbar-width: none;
  word-break: break-word;
}
.typing__text::-webkit-scrollbar { display: none; }
.tc { color: #b8b8bf; }                                   /* untyped = gray ghost */
.tc--ok { color: var(--text); }                           /* correct = solid dark */
.tc--bad { color: #e5484d; background: rgba(229,72,77,.16); border-radius: 3px; }
.tc--auto { opacity: 0; transition: opacity .3s var(--ease); } /* emoji/special: not typed */
.tc--auto.tc--shown { opacity: 1; }                        /* fades in as typing reaches it */
.tc--current { box-shadow: -2px 0 0 var(--accent); animation: tcaret 1s steps(1) infinite; }
@keyframes tcaret { 50% { box-shadow: -2px 0 0 transparent; } }
.typing__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.typing__stats { color: var(--text-dim); font-size: .82rem; font-variant-numeric: tabular-nums; }
.typing__skip {
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--text);
  transition: transform .25s var(--ease);
}
.typing__skip:hover { transform: translateX(2px); }
.typing__done {
  margin-top: 24px; padding: 20px 22px; border-radius: var(--radius);
}
.typing__done h3 { font-size: 1.2rem; font-weight: 800; }
.typing__done-stats { color: var(--text-dim); font-size: .9rem; margin-top: 4px; }
.typing__done-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.typing__copy { border: none; border-radius: 999px; padding: 9px 18px; cursor: pointer; font: inherit; font-weight: 600; font-size: .88rem; color: var(--text); }
.typing__again { color: var(--accent); font-weight: 600; font-size: .88rem; }
.typing__hint { color: var(--text-faint); font-size: .8rem; margin-top: 12px; }
.typing__hint code { background: var(--hairline); padding: 1px 5px; border-radius: 4px; }

/* In-place full-page playback: type every char in, grow-from-empty, final color */
.tchar { display: none; }                 /* unrevealed = blank (no ghost, no space) */
.tchar--on { display: inline; }           /* revealed = shown in its final style */
.tchar--caret { box-shadow: 2px 0 0 var(--accent); animation: tcaret 1s steps(1) infinite; }
.type-hide { opacity: 0 !important; }      /* keep the live time line hidden until the end */
/* during the type-out, keep a section's dividers/cards/space hidden until it types in */
body.type-running .hero__quote:not(.t-shown),
body.type-running .section:not(.t-shown),
body.type-running .footer:not(.t-shown),
body.type-running .milestone:not(.t-shown),
body.type-running .job:not(.t-shown),
body.type-running .job__subs:not(.t-shown),
body.type-running .chip:not(.t-shown),
body.type-running .contact__card:not(.t-shown),
body.type-running .contact__link:not(.t-shown),
body.type-running .blog-post:not(.t-shown) { display: none !important; }
.type-skip {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  border-radius: 999px; padding: 10px 18px; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--text);
  transition: transform .25s var(--ease);
}
.type-skip:hover { transform: translateX(-50%) translateY(-2px); }

/* ---------- Link hover preview (kie-style screenshot card) ---------- */
.link-preview {
  position: fixed; z-index: 80; width: 280px;
  border-radius: 12px; padding: 6px;
  opacity: 0; transform: translateY(6px) scale(.98);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  pointer-events: none;
}
.link-preview.is-visible { opacity: 1; transform: none; }
.link-preview img {
  width: 100%; display: block; border-radius: 7px;
  aspect-ratio: 1200 / 750; object-fit: cover; object-position: top;
  background: var(--bg);
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .section { margin-top: 60px; }
  .hero__row { flex-direction: row-reverse; align-items: center; gap: 16px; justify-content: flex-end; }
  .hero__photo-ring { width: 72px; height: 72px; }
  .role { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 4px; }
  .role__dates { padding-top: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__photo-ring { animation: none !important; }
  .cursor-glow { display: none; }
}
