/* Layout: one left-aligned column. Header row, page content, footer. Every value is a token from tokens.css. */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: var(--icon-xs);
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-block: var(--space-6) var(--space-12);
  padding-left: max(var(--space-6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
  background-color: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--duration-fast) ease-out, color var(--duration-fast) ease-out;
}

/* Interactive dot grid, drawn on a canvas from the same tokens; dots are pulled toward the cursor. */
#grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* Background atmosphere: two soft glow spots that drift slowly. */
body::before {
  content: "";
  position: fixed;
  inset: calc(-1 * var(--space-12));
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle 46vmax at 100% 0%, var(--glow-1), transparent 70%),
    radial-gradient(circle 46vmax at 0% 100%, var(--glow-2), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(6%, 5%, 0) scale(1.18);
  }
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: var(--focus-ring) solid var(--accent);
  outline-offset: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.label,
.tag,
.tag-strong {
  text-transform: uppercase;
}

.muted {
  color: var(--ink-muted);
}

.page {
  max-width: var(--content-width);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: var(--hairline) solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand .title {
  white-space: nowrap;
}

.brand svg {
  display: block;
  height: var(--icon-md);
  width: auto;
  flex: none;
  fill: currentColor;
}

.top-end {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav {
  display: flex;
  gap: var(--space-8);
}

.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--duration-fast) ease-out;
}

.nav a:hover {
  color: var(--ink);
}

.nav a[aria-current="page"] {
  color: var(--accent);
}

/* Header + contact row, grouped so they sit close together and then move as one block with .page's gap */
.top-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
}

.contact-row .social {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.contact-row .social svg {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

.contact-row .social .material-symbols-outlined {
  display: block;
}

/* Theme toggle */
.theme {
  display: grid;
  place-items: center;
  width: var(--icon-md);
  height: var(--icon-md);
  padding: 0;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--duration-fast) ease-out, border-color var(--duration-fast) ease-out;
}

.theme:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme .moon {
  display: none;
}

:root[data-theme="light"] .theme .sun {
  display: none;
}

:root[data-theme="light"] .theme .moon {
  display: block;
}

/* Hamburger (mobile only) */
.burger {
  display: none;
  place-items: center;
  width: var(--icon-md);
  height: var(--icon-md);
  padding: 0;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--duration-fast) ease-out, border-color var(--duration-fast) ease-out;
}

.burger:hover {
  color: var(--accent);
  border-color: var(--accent);
}


/* Colored headings */
h1.display {
  color: var(--accent);
}

h2.heading {
  color: var(--accent);
}

/* Title block */
.title-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

.intro {
  color: var(--ink-muted);
}

.quote {
  position: relative;
  background: var(--quote-bg);
  padding: var(--space-6) var(--space-6) var(--space-6) calc(var(--space-12) + var(--space-4));
  font-style: italic;
}

.quote::before {
  content: "format_quote";
  font-family: "Material Symbols Outlined";
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  font-style: normal;
  font-weight: 400;
  font-size: 2.5em;
  line-height: 1;
  color: var(--accent);
  opacity: 0.4;
}

h2 {
  margin-bottom: var(--space-4);
}

/* Timeline: a vertical rail with a node per item; the node holds the project/company icon. */
.node {
  position: relative;
  z-index: 1;
  width: var(--node);
  height: var(--node);
  overflow: hidden;
}

.node img,
.node svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Theme-switch sprite: company logos inlined into the page carry both a light-theme and
   a dark-theme variant (class="for-light"/"for-dark"); only the one matching the active
   theme is shown. Reacts to the manual theme toggle, unlike an <img> with a CSS media query.
   Dark is the default theme (see tokens.css), so .for-light only shows once data-theme="light". */
.node .for-light {
  display: none;
}

:root[data-theme="light"] .node .for-light {
  display: block;
}

:root[data-theme="light"] .node .for-dark {
  display: none;
}

.node-dot {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent);
}

/* Segmented control (component): native radio inputs styled as a row of segments.
   Grouping, keyboard (arrow) navigation and the checked state come from the browser; CSS only skins them. */
.segmented {
  display: inline-flex;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.segmented legend,
.segmented input {
  position: absolute;
  width: var(--hairline);
  height: var(--hairline);
  margin: calc(-1 * var(--hairline));
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.segmented label {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--duration-fast) ease-out, background-color var(--duration-fast) ease-out;
}

.segmented label:nth-of-type(n+2) {
  border-left: var(--hairline) solid var(--line);
}

.segmented label:hover {
  color: var(--ink);
}

.segmented input:checked+label {
  color: var(--accent);
  background: var(--surface-subtle);
}

.segmented input:focus-visible+label {
  outline: var(--focus-ring) solid var(--accent);
  outline-offset: calc(-1 * var(--focus-ring));
}

/* Section heading row (heading on the left, a control on the right) */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-head h2 {
  margin-bottom: 0;
}

/* Collapsible section (e.g. Open Source & Contributions), built on <details>/<summary>. */
summary.section-head {
  cursor: pointer;
  list-style: none;
}

summary.section-head::-webkit-details-marker {
  display: none;
}

.section-head-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chevron {
  flex: none;
  color: var(--ink-muted);
  transition: transform var(--duration-fast) ease-out;
}

details[open] > summary.section-head .chevron {
  transform: rotate(90deg);
}

/* Compact view: a logo wall instead of the timeline - company mark plus a short caption. No boxes: items sit in open space, separated by the rail already used elsewhere. */
.logo-wall {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-6);
  border-top: var(--hairline) solid var(--ink);
  padding-top: var(--space-6);
}

.entries-wrap[data-view="compact"] .entries {
  display: none;
}

.entries-wrap[data-view="compact"] .logo-wall {
  display: flex;
}

.logo-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 200px;
}

.logo-item p {
  margin: 0;
}

.logo-item .node {
  margin-bottom: var(--space-1);
}

/* Project rows */
.row {
  position: relative;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  column-gap: var(--space-4);
  margin-inline: calc(-1 * var(--space-4));
  padding: var(--space-4);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--duration-fast) ease-out;
}

.row::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--space-4) + (var(--node) - var(--hairline)) / 2);
  width: var(--hairline);
  background: var(--line);
}

.rows li:first-child .row::before {
  top: calc(var(--space-4) + var(--node) / 2);
}

.rows li:last-child .row::before {
  bottom: auto;
  height: calc(var(--space-4) + var(--node) / 2);
}

.row:hover {
  background: var(--surface-subtle);
}

.row .node {
  display: grid;
  place-items: center;
}

.row .node img {
  width: var(--icon-sm);
  height: var(--icon-sm);
  object-fit: contain;
}

.row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--node);
  transition: color var(--duration-fast) ease-out;
}

.name .mark {
  color: var(--accent);
}

.row:hover .name {
  color: var(--accent);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.badge {
  padding: var(--space-1);
  border: var(--hairline) solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--chip-bg);
  color: var(--accent);
  white-space: nowrap;
}

.stats {
  margin-left: var(--space-2);
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* Labeled description rows (dt label + dd value); used by Skills and the per-job meta. */
.deflist p {
  margin: 0;
}

.deflist strong {
  color: var(--ink);
  font-weight: 600;
}

/* Experience: a timeline rail on desktop, stacked blocks on phones. */
.entries {
  border-top: var(--hairline) solid var(--ink);
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  column-gap: var(--space-6);
  padding-block: var(--space-4);
}

.entry::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((var(--node) - var(--hairline)) / 2);
  width: var(--hairline);
  background: var(--line);
}

.entry:first-child::before {
  top: calc(var(--space-4) + var(--node) / 2);
}

.entry:last-child::before {
  bottom: auto;
  height: calc(var(--space-4) + var(--node) / 2);
}

.entry > .node {
  align-self: start;
  position: relative;
  z-index: 1;
}

.entry-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
}

.entry-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: var(--hairline) solid var(--line);
}

.entry-meta p {
  margin: 0;
}

.entry-meta strong {
  color: var(--ink);
  font-weight: 600;
}

a.company {
  text-decoration: none;
  transition: color var(--duration-fast) ease-out;
}

a.company:hover {
  color: var(--accent);
}

.period {
  color: var(--ink-muted);
  text-transform: uppercase;
}

.industry {
  color: var(--ink-muted);
}

.points {
  padding-left: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  list-style: disc;
}

.points li::marker {
  color: var(--accent);
}

.points strong,
.intro strong {
  font-weight: 600;
  color: var(--ink);
}

.button {
  display: none;
  align-self: flex-end;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-6);
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--duration-fast) ease-out;
}

.button:hover {
  background: var(--accent);
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--hairline) solid var(--line);
}

.social {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.social a {
  display: block;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--duration-fast) ease-out;
}

.social a:hover {
  color: var(--accent);
}

.social svg {
  display: block;
  width: var(--icon-sm);
  height: var(--icon-sm);
  fill: currentColor;
}

.social .material-symbols-outlined {
  display: block;
  font-size: var(--icon-sm);
}

@media (max-width: 600px) {
  body {
    padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  }

  .top {
    position: relative;
  }

  .top-end {
    gap: var(--space-2);
  }

  .top .social {
    gap: var(--space-2);
  }

  .burger {
    display: grid;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    z-index: 20;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--surface);
    border: var(--hairline) solid var(--line);
    border-radius: var(--radius-sm);
  }

  .top[data-nav="open"] .nav {
    display: flex;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry::before,
  .entry > .node {
    display: none;
  }

  .entry+.entry {
    border-top: var(--hairline) solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}