:root {
  --bg: #fbfaf8;  /* page background */
  --ink: #1c1b19;   /* main text */
  --mute: #85827a;   /* secondary text */
  --line: #e6e3dc;   /* dividers and borders */
  --chip: #efede8;   /* small filled boxes  */
  --acc: #7b846c;   /* green accent  */
  --dur: 0.5s;   /*  animation length */
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);   /* animation cadence */
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #161615;
  --ink: #ecebe6;
  --mute: #8f8c85;
  --line: #2c2b29;
  --chip: #232220;
  --acc: #a3ad93;
  color-scheme: dark;
}

/* fonts */
@font-face {
  font-family: 'Instrument Sans';
  font-weight: 400;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@fontsource/instrument-sans@5.3.0/files/instrument-sans-latin-400-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-weight: 500;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@fontsource/instrument-sans@5.3.0/files/instrument-sans-latin-500-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-weight: 600;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@fontsource/instrument-sans@5.3.0/files/instrument-sans-latin-600-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-mono@5.3.0/files/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
}

/* base */
* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

/* hide scroll bar */
html {
  scrollbar-width: none;
}

::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur) ease, color var(--dur) ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover,
button:not(:disabled):hover {
  color: var(--acc);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

strong {
  font-weight: 500;
}

.mute {
  color: var(--mute);
}

/* screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 2px;
}

/* icons */
.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.i-chevron {
  --icon: url(https://cdn.jsdelivr.net/npm/@tabler/icons@3.34.1/icons/outline/chevron-down.svg);
}

.i-moon {
  --icon: url(https://cdn.jsdelivr.net/npm/@tabler/icons@3.34.1/icons/outline/moon.svg);
}

.i-sun {
  --icon: url(https://cdn.jsdelivr.net/npm/@tabler/icons@3.34.1/icons/outline/sun.svg);
}


/* headings */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--mute);
}

/* light/dark toggle*/
.theme {
  display: inline-flex;
  align-self: center;
}

/* resources */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.chip {
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* homepage */

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 40px 120px;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: flex-start;
}

/* 2 columns */
.main {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* sidebar */
.side {
  flex: 0 1 240px;
  min-width: 200px;
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--chip);
}

.side h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.side-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-loc {
  font-size: 14px;
}

/* animated name */
.name .Typewriter__cursor {
  display: none;
}

.name.typing .Typewriter__cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  margin: 0 -1px;
  vertical-align: -0.08em;
  background: var(--acc);
  animation: caret-blink 1s steps(2, start) infinite;
}

@keyframes caret-blink {
  to {
    visibility: hidden;
  }
}

.intro {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.contact button:hover,
.contact button.copied {
  color: var(--acc);
}

.side-controls {
  display: flex;
  align-items: center;
  margin-top: 6px;
  color: var(--mute);
}

/* top education + languages */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.facts>div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.facts>div>strong {
  font-size: 15px;
  margin-top: 8px;
}

/* expandable rows */
.entry {
  border-bottom: 1px solid var(--line);
}

.entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  gap: 16px;
  width: 100%;
  padding: 16px 0;
  align-items: baseline;
}

.entry-head:disabled {
  cursor: default;
}

/* rows with nothing to expand */
.entry-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.role {
  font-size: 16px;
  font-weight: 500;
  transition: color 0.2s;
}

.org {
  font-size: 14px;
  color: var(--mute);
}

.entry-meta {
  font-size: 13px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sign {
  display: flex;
  justify-content: center;
  align-self: start;
  margin-top: 3px;
  color: var(--mute);
  transition: transform var(--dur) var(--ease), color 0.2s;
}

/* chips */
.entry.open .sign {
  transform: rotate(180deg);
  color: var(--acc);
}

.entry-head:not(:disabled):hover .role,
.entry-head:not(:disabled):hover .sign {
  color: var(--acc);
}

/* row styles */
.entry-content {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.entry.open .entry-content {
  opacity: 1;
  transition: opacity 0.35s ease 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  .entry-body {
    transition: none !important;
  }
}

.entry-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 36px 22px 0;
}

.entry-content p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.loc {
  font-size: 13px;
  color: var(--mute);
}

/* course list 3 column */
.course {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  align-items: baseline;
}

.code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.term {
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
}

/* skills */
.skill {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
}

/* 404 layout  */
.notfound {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.notfound-bar {
  position: absolute;
  top: 24px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}

.hello-body {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: clamp(40px, 9vw, 160px);
  right: clamp(40px, 9vw, 160px);
}

.hello-body p {
  margin: 0;
  max-width: 1100px;
  text-wrap: pretty;
  font-size: clamp(32px, 4.6vw, 68px);
  line-height: 1.4;
  letter-spacing: 0.005em;
}

.hello-body strong {
  font-weight: 600;
}

.hello-body .home-link {
  color: var(--acc);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

.hello-body .home-link:hover {
  color: var(--ink);
}

.hello-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: clamp(24px, 4vh, 48px);
  font-size: 14px;
}

.hello-portrait {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: clamp(88px, 10vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--chip);
}

/* screen sizes */

/* Side by side */
@media (min-width: 856px) {
  .main {
    margin-top: 90px;
  }

  .side {
    height: calc(100vh - 112px);
    min-height: max-content;
  }

  .side-controls {
    margin-top: auto;
  }
}

/* Short screens  */
@media (min-width: 856px) and (max-height: 720px) {
  .side {
    position: static;
    height: auto;
  }
}

/* Tablets and phones  */
@media (max-width: 855px) {
  .page {
    padding: 40px 16px 80px;
    gap: 40px;
  }

  .side {
    position: static;
    flex: 1 1 100%;
  }
}

/* Small phones  */
@media (max-width: 520px) {
  .notfound-bar {
    left: 16px;
    right: 16px;
    top: 18px;
  }

  .hello-body {
    left: 20px;
    right: 20px;
    top: 42%;
  }

  .hello-body p {
    font-size: clamp(26px, 8vw, 34px);
  }

  .hello-portrait {
    width: 72px;
    right: 16px;
    bottom: 18px;
  }

  .entry-head {
    grid-template-columns: minmax(0, 1fr) 20px;
    row-gap: 6px;
  }

  .entry-meta {
    grid-column: 1;
    grid-row: 2;
    white-space: normal;
  }

  .sign {
    grid-column: 2;
    grid-row: 1;
  }

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

  .term {
    grid-column: 2;
  }

  .skill {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}