:root {
  --bg: #fff;
  --fg: #171717;
  --muted: #737373;
  --faint: #b8b8b8;
  --rule: #ebebeb;
  --hover: #f4f4f4;
  --sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', Menlo, Consolas, monospace;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --w: 600px;
  --gutter: 24px;
  --pad: max(var(--gutter), calc((100% - var(--w)) / 2));
  color-scheme: light;
}

/* Pure black, so leaving for the portfolio (also black) has no visible seam. */
:root[data-theme='dark'] {
  --bg: #000;
  --fg: #ededed;
  --muted: #8c8c8c;
  --faint: #4a4a4a;
  --rule: #1d1d1d;
  --hover: #111;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

a {
  color: var(--fg);
  text-decoration: underline 1px var(--faint);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover { text-decoration-color: currentColor; }
.arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 0.85em;
  transition: translate 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}
a:hover .arrow { translate: 2px -2px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.mark {
  font: italic 26px/1 var(--serif);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.mark span { color: var(--muted); }
.now {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 12px var(--mono);
  color: var(--muted);
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: nowrap;
}
.links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--fg); }
.theme {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
  transition: scale 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.theme::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
.theme:hover { scale: 1.3; }
.progress {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
}

/* Content */
main { padding: 40px var(--pad) 0; }
main[aria-busy] { visibility: hidden; }

.name {
  font: 400 clamp(46px, 12vw, 76px)/1 var(--serif);
  letter-spacing: -0.025em;
  color: var(--fg);
}
.name .nick { font-style: italic; color: var(--muted); }
.role {
  margin-top: 16px;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
}
.intro { margin-top: 22px; font-size: 16px; text-wrap: pretty; }
.contact { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 22px; font-size: 14px; }
.contact a { text-decoration-color: transparent; }
.contact a:hover { text-decoration-color: currentColor; }
.k { margin-right: 8px; font: 11px var(--mono); color: var(--muted); }
.qr-open {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  cursor: pointer;
  text-decoration: underline dotted var(--faint);
  text-underline-offset: 3px;
}
.qr {
  margin: auto;
  padding: 16px 16px 10px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  text-align: center;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.2);
}
/* QR codes need a light background to scan, whatever the theme. */
.qr img { display: block; width: 168px; height: 168px; padding: 8px; border-radius: 10px; background: #fff; }
.qr figcaption { margin-top: 8px; font: 11px var(--mono); }
.qr::backdrop { background: rgb(0 0 0 / 0.2); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* Highlights inside prose, ruru.build style: muted text, the important bits in full ink. */
.fig, strong, em, .tech { color: var(--fg); }
strong { font-weight: 500; }
.fig { font-variant-numeric: tabular-nums; }
em { font-family: var(--serif); font-size: 1.15em; line-height: 1; }
.tech { white-space: nowrap; }
.ico {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.3em;
  vertical-align: -0.1em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  transition: rotate 0.35s, scale 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.tech:hover .ico { rotate: -10deg; scale: 1.2; }

section:not(.hero) { margin-top: 64px; }
h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
}
h2 .n { color: var(--muted); letter-spacing: 0; }
h2 .rule { flex: 1; height: 1px; margin-left: 6px; background: var(--rule); transform-origin: left; }

.list { position: relative; isolation: isolate; display: grid; gap: 28px; }
/* Hover highlight that glides between rows; main.js adds it on pointer devices. */
.pill {
  position: absolute;
  top: 0;
  left: -14px;
  right: -14px;
  z-index: -1;
  border-radius: 12px;
  background: var(--hover);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; align-items: baseline; }
h3 { font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--fg); }
.sub { font-weight: 400; color: var(--muted); }
.sep { color: var(--faint); }
.when { font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta { margin-top: 2px; font-size: 14px; }
.desc { margin-top: 6px; }
.desc p + p { margin-top: 6px; }
.points { display: grid; gap: 6px; margin-top: 8px; }
.points li { position: relative; padding-left: 22px; }
.points li::before { content: '↳'; position: absolute; left: 0; color: var(--faint); }
.out { margin-left: 10px; font-size: 13px; font-weight: 400; color: var(--muted); text-decoration: none; white-space: nowrap; }
.sub .out { margin-left: 0; }
.out:hover { color: var(--fg); }
.out .tech { color: inherit; }

.list.skills { gap: 14px; }
.skills .row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.kws { display: flex; flex-wrap: wrap; row-gap: 2px; color: var(--fg); }
.kw { white-space: nowrap; }
.kws .kw:not(:last-child)::after { content: ','; margin-right: 0.45em; color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font: 12px/1.6 var(--mono); }
.stack .tech { color: inherit; }

.list.delivery { gap: 10px; }
.delivery .client { font-weight: 500; color: var(--fg); }

.notice { font: 13px var(--mono); color: #d33; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 96px;
  padding: 0 var(--pad) 48px;
  font-size: 14px;
}

/* The view transition in main.js draws the theme change; keep the browser's default cross-fade out of it. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (max-width: 560px) {
  :root { --gutter: 20px; }
  .line, .skills .row { grid-template-columns: minmax(0, 1fr); }
  .skills .row { gap: 2px; }
  .links { gap: 14px; }
  section:not(.hero) { margin-top: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .nav, .foot { display: none; }
}
