/*
  Eddie Silva
  Type: Shippori Mincho (reading, name, titles), IBM Plex Mono (navigation, dates, labels).
  Dark primary: ink #ebe6dc on #0f0f0e, muted #9c968b, vermilion #d9744f.
  Light: ink #1a1917 on #f4f1ea, muted #5f5a52, accent #a4432a. All AA.
*/
:root { --paper: #0f0f0e; --ink: #ebe6dc; --muted: #9c968b; --accent: #d9744f; --faint: #2a2825; color-scheme: dark; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --paper: #f4f1ea; --ink: #1a1917; --muted: #5f5a52; --accent: #a4432a; --faint: #dcd6cb; color-scheme: light; }
}
:root[data-theme="light"] { --paper: #f4f1ea; --ink: #1a1917; --muted: #5f5a52; --accent: #a4432a; --faint: #dcd6cb; color-scheme: light; }

html { font-size: clamp(17px, 16.4px + 0.2vw, 18px); }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: 'Shippori Mincho', Georgia, serif; line-height: 1.7;
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--paper); }
[hidden] { display: none !important; }

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* Header */
.skip { position: absolute; left: -9999px; top: 12px; background: var(--paper); padding: 6px 10px; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }
.skip:focus { left: 20px; }
.site-header { position: fixed; z-index: 2; top: 0; left: 0; right: 0; background: var(--paper); }
.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 2rem;
  padding: 1.25rem clamp(20px, 5vw, 56px);
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.02em;
}
.bar-right { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.6rem; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.nav a, .theme, .home-link { display: inline-block; padding: 0.35rem 0; }
.nav a, .theme { color: var(--muted); transition: color 120ms linear; }
.nav a:hover, .theme:hover, .nav a[aria-current="page"] { color: var(--ink); }
.theme { font: inherit; letter-spacing: inherit; background: none; border: 0; cursor: pointer; }

/* Layout: a measured column right of a wide empty field */
main { padding: clamp(150px, 26vh, 260px) clamp(20px, 5vw, 56px) 0 clamp(20px, 22vw, 340px); }
.col { max-width: 34rem; }
.section { margin-top: clamp(80px, 13vh, 128px); }
.label { margin: 0 0 1.1rem; font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); }
.stroke { display: block; width: 2.5rem; height: 1px; background: var(--accent); margin: 0 0 2.25rem; transform-origin: left; }
h1 { margin: 0; font-weight: 500; font-size: clamp(2.3rem, 1.6rem + 3vw, 3.6rem); line-height: 1.1; letter-spacing: 0.005em; }
h1.page { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
.lede { margin: 1.4rem 0 0; max-width: 27rem; font-size: 1.12rem; line-height: 1.65; text-wrap: pretty; }
p { text-wrap: pretty; }

/* Lists of dated lines */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 1.5rem; padding: 0.6rem 0; }
.row .when { flex: 0 0 9rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.row .what { flex: 1 1 16rem; min-width: 0; }
.row .sub { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: var(--muted); }
.link { text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 0.25em; transition: text-decoration-color 120ms linear; }
.link:hover, .link:focus-visible { text-decoration-color: var(--accent); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 0.25rem 0; }
.muted { color: var(--muted); }

/* Track record filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 2.5rem 0 0; padding: 0; list-style: none; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; }
.filters button { font: inherit; background: none; border: 0; padding: 0.35rem 0; color: var(--muted); cursor: pointer; transition: color 120ms linear; }
.filters button:hover, .filters button[aria-pressed="true"] { color: var(--ink); }
.filters button[aria-pressed="true"] { text-decoration: underline 1px var(--accent); text-underline-offset: 0.35em; }
.year { margin: 2.5rem 0 0.25rem; font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.72rem; color: var(--muted); }

/* Project page */
.meta { margin: 1rem 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--muted); }
article h2 { margin: 2.75rem 0 0.5rem; font-weight: 500; font-size: 1.2rem; }
article p { margin: 0 0 1rem; }

/* Footer */
.site-footer { padding: clamp(96px, 16vh, 160px) clamp(20px, 5vw, 56px) 2.5rem clamp(20px, 22vw, 340px); }
.foot { max-width: 34rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; line-height: 1.8; color: var(--muted); }
.foot p { margin: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.foot a { transition: color 120ms linear; }
.foot a:hover { color: var(--ink); }

/* Entrance on Home, once per session: the stroke draws, the name lands, the rest fades. */
.entering .stroke { transform: scaleX(0); }
.entering h1 { opacity: 0; transform: translateY(28px); }
.entering .fade { opacity: 0; }
.stroke { transition: transform 300ms cubic-bezier(.7,0,.2,1); }
h1 { transition: opacity 420ms cubic-bezier(.16,1,.3,1) 60ms, transform 520ms cubic-bezier(.16,1,.3,1) 60ms; }
.fade { transition: opacity 360ms linear 220ms; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0s !important; transition-delay: 0s !important; } }

@media (max-width: 640px) {
  main { padding-left: clamp(20px, 5vw, 56px); }
  .site-footer { padding-left: clamp(20px, 5vw, 56px); }
}

/* Home index: category, hover tick, count */
.index a { --a: 0; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: baseline; padding: 0.55rem 0; }
.index a:hover, .index a:focus-visible { --a: 1; }
.index .tick { display: block; width: 0.9rem; height: 1px; align-self: center; background: var(--accent); transform-origin: left; transform: scaleX(var(--a)); transition: transform 120ms cubic-bezier(.3,0,.2,1); }
.index .name { font-size: 1.08rem; transform: translateX(calc(var(--a) * 3px)); transition: transform 120ms cubic-bezier(.3,0,.2,1); }
.index .count { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--muted); transition: color 120ms linear; }
.index a:hover .count, .index a:focus-visible .count { color: var(--ink); }

/* Home: one line of past companies, in place of a logo strip */
.prev { margin: 1.75rem 0 0; max-width: 30rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; line-height: 1.8; letter-spacing: 0.02em; }
.prev .muted { margin-right: 0.4rem; }

/* Avatar: small beside the name in the header, larger on Home */
.home-link { display: inline-flex; align-items: center; gap: 0.55rem; }
.avatar-sm { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.hero { display: flex; align-items: center; gap: clamp(1rem, 3vw, 1.6rem); }
.avatar { width: clamp(64px, 12vw, 96px); height: clamp(64px, 12vw, 96px); border-radius: 50%; object-fit: cover; flex: none; outline: 1px solid var(--faint); outline-offset: 3px; }

/* Home lists: a description line under each name */
.index .name .sub { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; color: var(--muted); margin-top: 0.1rem; }
.explore a { padding: 0.65rem 0; }

/* Tags: small mono links under an entry, and the Stack line on Home */
.tags { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; margin-top: 0.2rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; }
.tags a { color: var(--accent); transition: color 120ms linear; }
.tags a::before { content: '#'; opacity: 0.6; }
.tags a:hover { color: var(--ink); }
.stack-line { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin: 1.5rem 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; }
.stack-line a { transition: color 120ms linear; }
.stack-line a:hover { color: var(--accent); }
.stack-line a.none { color: var(--muted); }
.stack-line sup { margin-left: 0.15rem; font-size: 0.6rem; color: var(--accent); }

/* Writing filters: two quiet dropdowns in one row */
.picker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.6rem; margin: 2.5rem 0 0; padding: 0 0 0.9rem; border-bottom: 1px solid var(--faint); font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; }
.pick { position: relative; display: inline-flex; align-items: baseline; gap: 0.5rem; }
.pick select {
  appearance: none; -webkit-appearance: none; font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid transparent; padding: 0.3rem 1.1rem 0.3rem 0; cursor: pointer; border-radius: 0;
  field-sizing: content; min-width: 2.5rem;
  transition: border-color 120ms linear, color 120ms linear;
}
.pick::after { content: ''; position: absolute; right: 0.15rem; top: 50%; width: 5px; height: 5px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.pick select:hover, .pick select:focus-visible { border-bottom-color: var(--accent); outline: none; }
.pick.on select { color: var(--accent); }
.pick select option { color: var(--ink); background: var(--paper); }
.picker .result { margin-left: auto; color: var(--muted); }
.picker .clear { font: inherit; background: none; border: 0; padding: 0.3rem 0; color: var(--muted); cursor: pointer; text-decoration: underline 1px transparent; text-underline-offset: 0.3em; transition: color 120ms linear, text-decoration-color 120ms linear; }
.picker .clear:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* Mobile navigation: a menu button that opens a full-screen overlay */
.burger { display: none; align-items: center; gap: 0.6rem; font: inherit; letter-spacing: inherit; color: var(--ink); background: none; border: 0; padding: 0.35rem 0; cursor: pointer; }
.burger-icon { position: relative; width: 18px; height: 10px; }
.burger-icon i { position: absolute; left: 0; height: 1px; background: currentColor; transition: transform 320ms cubic-bezier(.7,0,.2,1), width 320ms cubic-bezier(.7,0,.2,1), top 320ms cubic-bezier(.7,0,.2,1); }
.burger-icon i:first-child { top: 0; width: 18px; }
.burger-icon i:last-child { top: 9px; width: 11px; }
.burger:hover .burger-icon i:last-child { width: 18px; }
.menu-open .burger-icon i:first-child { top: 5px; transform: rotate(45deg); }
.menu-open .burger-icon i:last-child { top: 5px; width: 18px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: -1; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(5.5rem + env(safe-area-inset-top, 0px)) clamp(20px, 5vw, 56px) calc(2rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper); overflow-y: auto;
  visibility: hidden; opacity: 0; transition: opacity 260ms linear, visibility 0s linear 260ms;
}
.menu-open .menu { visibility: visible; opacity: 1; transition: opacity 200ms linear; }
.menu:focus { outline: none; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li, .menu-foot { opacity: 0; transform: translateY(14px); transition: opacity 200ms linear, transform 200ms linear; }
.menu-open .menu-list li, .menu-open .menu-foot {
  opacity: 1; transform: none;
  transition: opacity 420ms cubic-bezier(.16,1,.3,1) calc(80ms + var(--i) * 45ms), transform 520ms cubic-bezier(.16,1,.3,1) calc(80ms + var(--i) * 45ms);
}
.menu-list a { display: flex; align-items: baseline; gap: 1rem; padding: 0.45rem 0; font-family: 'Shippori Mincho', Georgia, serif; font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.2; letter-spacing: 0; color: var(--ink); }
.menu-list .num { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--muted); min-width: 1.6rem; }
.menu-list a[aria-current="page"] { color: var(--accent); }
.menu-list a[aria-current="page"] .num { color: var(--accent); }
.menu-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1.5rem; padding-top: 1.5rem; margin-top: 2rem; border-top: 1px solid var(--faint); font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }
.menu-foot span { display: flex; gap: 1.1rem; }
.menu-foot a, .menu-foot .theme { color: var(--muted); }
.menu-foot a:hover { color: var(--ink); }
.no-scroll, .no-scroll body { overflow: hidden; }

@media (max-width: 860px) {
  .bar-right > nav, .bar-right > .theme { display: none; }
  .burger { display: inline-flex; }
}
@media (min-width: 861px) { .menu { display: none; } }

/* About: a row of headline numbers */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin: 0; }
.stats div { border-top: 1px solid var(--faint); padding-top: 0.9rem; }
.stats dt { font-family: 'Shippori Mincho', Georgia, serif; font-weight: 500; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.2rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats dd { margin: 0.4rem 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; line-height: 1.5; color: var(--muted); }

/* About: selected work, a few lines of story under each title */
.work .body { display: block; margin: 0.3rem 0 0.35rem; font-size: 0.95rem; color: var(--ink); }

/* Home: the core talent, set a step below the intro */
.talent { margin: 0; font-size: 1.05rem; line-height: 1.7; text-wrap: pretty; }
