:root {
  --bg: #ffffff;
  --fg: #171717;
  --muted: #5f5f5f;
  --border: #e8e8e8;
  --soft: #f6f7f6;
  --accent: #15803d;
  --accent-soft: #ecfdf3;
}

* { box-sizing: border-box; }
html { font-size: 112%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: 'Outfit', system-ui, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
::selection { background: var(--accent-soft); color: var(--accent); }
:where(a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: .4rem; }

.wrap { max-width: 42rem; margin: 0 auto; padding: 5rem 1.5rem 9rem; display: flex; flex-direction: column; gap: 4rem; }
h1 { font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; margin: 0; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 1.25rem; }
h3 { margin: 0; }
.prose { color: var(--muted); }
.prose a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c4c4c4; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose p + p { margin-top: 1rem; }

/* hero */
.hero { display: flex; gap: 1.75rem; align-items: flex-start; }
.avatar { flex: none; width: 6.5rem; height: 6.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid var(--border); box-shadow: 0 0 0 4px var(--soft); font-size: 2rem; font-weight: 600; letter-spacing: -.03em; }
.avatar span { color: var(--accent); }
.role { color: var(--accent); font-weight: 600; font-size: 1.15rem; margin-top: .35rem; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 30rem; margin-top: .75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1.1rem; border-radius: .6rem; border: 1px solid var(--border); font-size: .9rem; font-weight: 500; transition: background .2s, border-color .2s; }
.btn:hover { border-color: #cfcfcf; background: var(--soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #166534; border-color: #166534; }

/* projects */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.card { border: 1px solid var(--border); border-radius: .85rem; padding: 1.15rem; display: flex; flex-direction: column; gap: .45rem; }
.card-wide { grid-column: 1 / -1; }
.card-meta { font-size: .8rem; color: var(--accent); font-weight: 500; }
.card h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.card > p:not(.card-meta) { font-size: .92rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .5rem; }
.tags span { font-size: .78rem; padding: .1rem .5rem; border-radius: .35rem; background: var(--soft); color: var(--muted); }

/* work / education rows */
.rows { display: flex; flex-direction: column; gap: 1.4rem; }
.row summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .75rem; }
.row summary::-webkit-details-marker { display: none; }
.logo { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); background: var(--soft); font-size: .7rem; font-weight: 600; color: var(--muted); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; line-height: 1.25; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row-title a:hover { color: var(--accent); }
.row-title a span { font-size: .8em; color: var(--muted); }
.row-sub { font-size: .88rem; color: var(--muted); }
.row-date { flex: none; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.chev { flex: none; width: 1rem; height: 1rem; color: #a3a3a3; transition: transform .2s; }
.row[open] .chev { transform: rotate(90deg); }
.row-body { margin: .6rem 0 0 3.25rem; font-size: .92rem; color: var(--muted); }
.badge { font-size: .72rem; font-weight: 500; padding: .05rem .45rem; border-radius: .35rem; background: var(--soft); border: 1px solid var(--border); color: var(--muted); }
.badge.live { background: var(--accent-soft); border-color: #bbf7d0; color: var(--accent); }

/* skills */
.skill-groups { margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.skill-groups > div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: baseline; }
.skill-groups dt { font-weight: 600; font-size: .92rem; }
.skill-groups dd { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.skill-groups span { border: 1px solid var(--border); border-radius: .6rem; padding: .1rem .7rem; font-size: .85rem; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 1.75rem; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: calc(-1.5rem - 5px); top: .45rem; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.timeline time { font-size: .82rem; color: var(--muted); }
.timeline h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.timeline .where { font-size: .88rem; color: var(--muted); }
.timeline p:not(.where) { font-size: .92rem; color: var(--muted); margin-top: .3rem; }

/* dock */
.dock { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.88); border: 1px solid var(--border); backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0,0,0,.08); z-index: 10; }
.dock a { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--fg); transition: background .2s, color .2s, transform .2s; }
.dock a:hover { background: var(--accent-soft); color: var(--accent); transform: translateY(-3px); }
.dock svg { width: 1.1rem; height: 1.1rem; }
.dock .sep { width: 1px; height: 1.6rem; background: var(--border); margin: 0 3px; }
.tip { position: relative; }
.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + .5rem); left: 50%; transform: translateX(-50%); font-size: .72rem; white-space: nowrap; background: var(--fg); color: #fff; padding: .15rem .5rem; border-radius: .35rem; opacity: 0; pointer-events: none; transition: opacity .15s; }
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }

/* reveal on scroll (only when JS runs) */
.js .fade { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
.js .fade.in { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .wrap { padding-top: 2.5rem; gap: 2.75rem; }
  .hero { flex-direction: column; gap: 1rem; }
  .avatar { width: 3.75rem; height: 3.75rem; font-size: 1.3rem; box-shadow: 0 0 0 3px var(--soft); }
  .grid { grid-template-columns: 1fr; }
  .row summary { flex-wrap: wrap; align-items: flex-start; }
  .row-main { flex-basis: calc(100% - 5rem); }
  .chev { margin-top: .7rem; }
  .row-date { order: 3; flex-basis: 100%; margin-left: 3.25rem; margin-top: -.6rem; text-align: left; }
  .skill-groups > div { grid-template-columns: 1fr; gap: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade { opacity: 1; transform: none; transition: none; }
  .dock a, .chev, .tip::after { transition: none; }
  .dock a:hover { transform: none; }
}

.role-sep { color: #c4c4c4; margin: 0 .2rem; }
.learner { color: var(--fg); font-weight: 500; }

/* growing tree in the left margin */
.tree-wrap { display: none; position: fixed; top: 72px; bottom: 88px; right: calc(50% + 21rem + 24px); width: min(300px, calc(50% - 21rem - 48px)); pointer-events: none; z-index: 0; }
.tree { width: 100%; height: 100%; display: block; }
.tree .ground { stroke: #dce2dd; stroke-width: 1; fill: none; }
.tree .grass { stroke: #dce2dd; stroke-width: 1; fill: none; stroke-linecap: round; }
.tree .forest { stroke: #dce2dd; stroke-width: 1.3; fill: none; stroke-linecap: round; }
.tree .forest-leaves { fill: #cfd9d1; }
.tree .roots { stroke: var(--accent); stroke-width: 1; fill: none; stroke-linecap: round; opacity: .28; }
.tree .trunk { fill: var(--accent); opacity: .78; }
.tree .grow { stroke-dasharray: 1; stroke-dashoffset: 0; }
.tree .limb { fill: none; stroke: var(--accent); stroke-opacity: .65; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tree .twig { stroke-width: 1; }
.tree .leaves { fill: var(--accent); fill-opacity: .42; }
@media (min-width: 1200px) and (min-height: 560px) {
  .tree-wrap { display: block; }
  .wrap { position: relative; z-index: 1; }
}
/* phones and tablets: no margin to spare, so the tree gets its own moment
   after Contact: a small forest where one tree grows above the rest */
.finale { display: none; height: 220px; margin-top: 2rem; pointer-events: none; }
.finale-art { width: 100%; height: 100%; display: block; }
.finale .ground { stroke: #e8e8e8; stroke-width: 1; fill: none; }
.finale .forest { stroke: var(--accent); stroke-opacity: .2; stroke-width: 1.2; fill: none; stroke-linecap: round; }
.finale .forest-leaves { fill: var(--accent); fill-opacity: .2; }
.finale .roots { stroke: var(--accent); stroke-width: 1; fill: none; stroke-linecap: round; opacity: .35; }
.finale .trunk { fill: var(--accent); }
.finale .grow { stroke-dasharray: 1; stroke-dashoffset: 0; }
.finale .limb { fill: none; stroke: var(--accent); stroke-opacity: .75; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.finale .twig { stroke-width: 1; }
.finale .leaves { fill: var(--accent); fill-opacity: .65; }
@media (max-width: 1199.98px), (max-height: 559.98px) {
  .finale { display: block; }
  .wrap { padding-bottom: 6.5rem; }
  .dock { transition: transform .3s ease, opacity .3s ease; }
  .dock.away { transform: translate(-50%, calc(100% + 1.5rem)); opacity: 0; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .finale { height: 280px; }
}
@media (max-width: 640px) {
  .role-sep { display: none; }
  .learner { display: block; }
  .row summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; column-gap: 12px; align-items: start; }
  .logo { width: 36px; height: 36px; }
  .row-main { grid-column: 2; }
  .chev { grid-column: 3; grid-row: 1; margin-top: .55rem; }
  .row-date { grid-column: 2; grid-row: 2; margin: .1rem 0 0; text-align: left; }
  .row-body { margin: .75rem 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dock { transition: none; }
}
