@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  --ground: #f3efe7;
  --ink: #211d19;
  --quiet: #38312a;
  --muted: #4d4034;
  --rule: #c1b3a0;
  --accent: #713927;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --top: clamp(3.5rem, 8vw, 7.25rem);
  --layout-width: min(87vw, 73rem);
  color-scheme: light;
  overscroll-behavior-y: none;
  scrollbar-color: oklch(63.7% .237 25.331) transparent;
  scrollbar-width: thin;
  scroll-padding-top: 1.75rem;
}
:root[data-theme="dark"] {
  --ground: #181715;
  --ink: #f3eee6;
  --quiet: #d5cdc0;
  --muted: #c6bdaf;
  --rule: #51493f;
  --accent: #e9bd80;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.6 "Instrument Sans", Arial, sans-serif; }
h1,h2,h3,p { margin: 0; }
a { color: inherit; text-underline-offset: .28em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { color: var(--ground); background: var(--ink); }
.ascii-background { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
:root[data-theme="dark"] .ascii-background { filter: brightness(1.42); }
.skip { position: absolute; z-index: 2; top: -5rem; left: 1rem; padding: .5rem .75rem; color: var(--ground); background: var(--ink); }
.skip:focus { top: .5rem; }
.layout {
  position: relative;
  width: var(--layout-width);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 8rem);
  padding-block: var(--top) clamp(1rem, 3vw, 2rem);
}
.profile {
  position: sticky;
  top: var(--top);
  align-self: start;
  display: flex;
  flex-direction: column;
}
.profile-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.location,.date { font: .84rem/1.5 var(--mono); color: var(--muted); }
.location { display: flex; align-items: center; gap: .75rem; }
.location::before { content: ""; width: 1.15rem; border-top: 1px solid var(--accent); }
.profile-controls,.language-switch { display: flex; }
.profile-controls { gap: .6rem; }
.profile-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 .5rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font: .875rem/1.2 var(--mono);
  cursor: pointer;
}
.profile-controls button:hover,.profile-controls button[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
.profile-controls button[aria-pressed="true"] { font-weight: 700; }
.profile-controls .theme-toggle { font: 1.375rem/1 system-ui, sans-serif; }
:root[data-theme="dark"] [data-theme-label="dark"],
:root:not([data-theme="dark"]) [data-theme-label="light"] { display: none; }
.profile-heading {
  --portrait-width: min(39%, 11.75rem);
  display: grid;
  grid-template-columns: var(--portrait-width) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.75rem, 1.6vw, 1.5rem);
  margin: .85rem 0 1rem;
  container-type: inline-size;
  transform: translateX(max(calc(var(--portrait-width) / -2), calc((var(--layout-width) - 100vw) / 2 + .75rem)));
}
.profile h1 {
  font-size: min(18cqi, 5.6rem);
  font-weight: 530;
  line-height: .82;
  letter-spacing: -.078em;
}
.profile h1 em {
  display: block;
  margin-top: .045em;
  font: italic 400 1.12em/.86 var(--serif);
  letter-spacing: -.055em;
}
.profession { color: var(--accent); font-size: clamp(1.2rem, 1.7vw, 1.42rem); }
.summary { margin: .55rem 0 0; padding: 0; list-style: none; color: var(--quiet); font-size: 1.06rem; }
.section-nav { display: grid; justify-items: start; margin-top: 1rem; }
.section-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-left: 1px solid var(--rule);
  padding-inline: .8rem;
  color: var(--muted);
  font: .875rem/1.2 var(--mono);
  text-decoration: none;
}
.section-nav a:hover,.section-nav a[aria-current] { color: var(--ink); border-color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; margin-top: 1rem; }
.contact-links a,.project-repository { display: grid; place-items: center; width: 44px; height: 44px; }
.contact-links img,.project-repository img,.entity-logo.monochrome { filter: invert(1); }
:root[data-theme="dark"] :is(.contact-links img,.project-repository img,.entity-logo.monochrome) { filter: none; }
.contact-links img,.project-repository img { opacity: .68; }
:is(.contact-links a,.project-repository):is(:hover,:focus-visible) img { opacity: 1; }
.portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
@property --portrait-reveal {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --portrait-wave {
  syntax: "<angle>";
  inherits: true;
  initial-value: -35deg;
}
@keyframes portrait-wave {
  to { --portrait-wave: 325deg; }
}
.portrait-content {
  --wave-x: calc(50% * (1 - var(--portrait-reveal, 0)));
  --wave-amplitude: calc(1.5% * (1 - var(--portrait-reveal, 0)));
  --wave-phase: var(--portrait-wave, -35deg);
  --wave-a: calc(var(--wave-amplitude) * sin(var(--wave-phase)));
  --wave-b: calc(var(--wave-amplitude) * sin(var(--wave-phase) + 45deg));
  --wave-c: calc(var(--wave-amplitude) * sin(var(--wave-phase) + 90deg));
  --wave-d: calc(var(--wave-amplitude) * sin(var(--wave-phase) + 135deg));
  --portrait-seam:
    calc(var(--wave-x) + var(--wave-a)) 0, calc(var(--wave-x) + var(--wave-b)) 6.25%,
    calc(var(--wave-x) + var(--wave-c)) 12.5%, calc(var(--wave-x) + var(--wave-d)) 18.75%,
    calc(var(--wave-x) - var(--wave-a)) 25%, calc(var(--wave-x) - var(--wave-b)) 31.25%,
    calc(var(--wave-x) - var(--wave-c)) 37.5%, calc(var(--wave-x) - var(--wave-d)) 43.75%,
    calc(var(--wave-x) + var(--wave-a)) 50%, calc(var(--wave-x) + var(--wave-b)) 56.25%,
    calc(var(--wave-x) + var(--wave-c)) 62.5%, calc(var(--wave-x) + var(--wave-d)) 68.75%,
    calc(var(--wave-x) - var(--wave-a)) 75%, calc(var(--wave-x) - var(--wave-b)) 81.25%,
    calc(var(--wave-x) - var(--wave-c)) 87.5%, calc(var(--wave-x) - var(--wave-d)) 93.75%,
    calc(var(--wave-x) + var(--wave-a)) 100%;
  position: absolute;
  inset: 0;
  transform: scale(1.12);
  transform-origin: 50% 15%;
  clip-path: polygon(0 0, 100% 0, 100% 63%, 72.5% 63%, 69.8% 67.2%, 68.5% 71.7%,
    67.4% 75.5%, 65.8% 79.1%, 62.9% 82.6%, 59.2% 85.1%, 54.9% 86.7%, 50% 87.6%,
    46.2% 87%, 42.2% 85.4%, 38.5% 83.2%, 35.1% 79.8%, 32.8% 75.7%, 31.3% 71.7%,
    30.2% 67.2%, 26.5% 63%, 0 63%);
  transition: --portrait-reveal .65s cubic-bezier(.45, 0, .25, 1);
}
@media (prefers-reduced-motion: no-preference) {
  .portrait.ready .portrait-content { animation: portrait-wave 8s linear infinite; }
}
@media (hover: hover) {
  .portrait.ready:hover .portrait-content { --portrait-reveal: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-content { transition: none; }
}
.portrait img,.portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait img { object-fit: cover; object-position: center bottom; }
.portrait.ready img { clip-path: polygon(var(--portrait-seam), 100% 100%, 100% 0); }
.portrait-ascii { clip-path: polygon(var(--portrait-seam), 0 100%, 0 0); }
.portrait canvas { pointer-events: none; }
.portrait-light { filter: brightness(1.35); }
@media (prefers-reduced-motion: reduce) {
  .portrait-light { display: none; }
}
main { min-width: 0; }
main section + section { margin-top: clamp(3.4rem, 6vw, 5.5rem); }
main h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--accent);
  font: 500 .875rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
main h2::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.about h2 {
  display: block;
  color: var(--ink);
  font: 400 clamp(2.2rem, 5vw, 3.75rem)/1.05 var(--serif);
  letter-spacing: -.035em;
  text-transform: none;
}
.about h2::after { content: none; }
.about p { max-width: 54ch; }
.about p,.entry p:not(.date,.role) { color: var(--quiet); font-size: 1.075rem; }
.entry { position: relative; display: grid; grid-template-columns: minmax(7.25rem, 23%) minmax(0, 1fr); gap: .35rem 1.2rem; }
.entry > span { position: absolute; }
.entry + .entry { margin-top: 1.8rem; padding-top: 1.8rem; border-top: 1px solid var(--rule); }
.entry-meta { display: grid; grid-template-rows: 1fr auto; place-items: center; gap: .5rem; }
.entry-meta .date { justify-self: stretch; text-align: start; }
.entity-logo {
  display: block;
  width: min(100%, 8rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.project-preview { aspect-ratio: auto; border-radius: .375rem; }
.project-heading { display: flex; align-items: center; gap: .35rem; }
.entry h3 { font-size: 1.28rem; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.entry .role { margin-top: .35rem; color: var(--muted); font-size: .94rem; }
.entry h3 + p:not(.role),.entry .role + p,.project-heading + p { margin-top: .5rem; }
.skills { display: flex; flex-wrap: wrap; gap: .35rem; margin: .85rem 0 0; padding: 0; list-style: none; }
.skills li { padding: .2rem .55rem; border: 1px solid var(--rule); color: var(--accent); font: .8rem/1.4 var(--mono); }
.skills-preview { display: flex; align-items: center; gap: .35rem; margin-top: .85rem; }
.skills-preview .skills { flex-wrap: nowrap; min-width: 0; margin: 0; overflow: hidden; }
.skills-preview .skills li { flex: none; white-space: nowrap; }
.skills-toggle {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--accent);
  font: 1rem/1 var(--mono);
  cursor: pointer;
}
.skills-toggle:hover { border-color: var(--accent); }
.skills-toggle::before { content: "+"; }
.skills-toggle[aria-expanded="true"]::before { content: "−"; }
.skills-more { display: grid; grid-template-rows: 1fr; margin-top: .35rem; }
.skills-more[inert] { grid-template-rows: 0fr; margin-top: 0; }
.skills-more > .skills { overflow: hidden; margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .skills-more { transition: grid-template-rows .28s ease, margin-top .28s ease; }
}
.site-footer { position: relative; }
.site-footer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1828 / 412;
  object-fit: cover;
  object-position: center top;
  opacity: .65;
}
:root[data-theme="dark"] .site-footer img { filter: invert(1); }
@media (max-width: 850px) {
  :root { --layout-width: min(88vw, 40rem); }
  .layout { display: block; }
  .profile { position: static; margin-bottom: 2.5rem; }
}
@media (max-width: 450px) {
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry-meta { margin-bottom: .35rem; }
  .entity-logo { width: min(100%, 6.5rem); }
}
@media (min-width: 851px) and (max-height: 800px) {
  :root { --top: clamp(2.5rem, 8vh, 4.5rem); }
}
@media (max-height: 680px) {
  .profile { position: static; }
}
