:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #252b28;
  --muted: #606760;
  --accent: #874326;
  --line: #dedfd8;
  --selection: #e8d7b9;
  --textile-ground: #eee5d4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #191c1a;
    --ink: #e7e8e2;
    --muted: #a6aea5;
    --accent: #dfab8b;
    --line: #3a403b;
    --selection: #544435;
    --textile-ground: #292c25;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191c1a;
  --ink: #e7e8e2;
  --muted: #a6aea5;
  --accent: #dfab8b;
  --line: #3a403b;
  --selection: #544435;
  --textile-ground: #292c25;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-left: 72px;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 72px;
  background: url("tibeb-border.svg") center top / 72px 72px repeat-y var(--textile-ground);
  pointer-events: none;
}

::selection { background: var(--selection); }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
strong { font-weight: 600; }
p { margin: 0 0 12px; }

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 8px;
  background: var(--paper);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 40px 24px;
}

.name-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3.5vw, 40px);
  font-weight: 400;
  letter-spacing: -1.3px;
  line-height: 1.15;
}
.name-period { color: var(--accent); }

.intro > p { max-width: 660px; }
.links { display: flex; gap: 22px; margin: 18px 0 28px; }
.links a { font-size: 14px; }
.links span { color: var(--accent); }

.index {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  align-items: start;
}

h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 4px;
}
.section-heading h2 { margin: 0; }
.hint { font-size: 11px; color: var(--muted); }
.job { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.job summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 10px;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
}
summary:hover { color: var(--accent); }
.job-main { display: flex; flex-direction: column; gap: 1px; }
.job-main > span { font-size: 12px; color: var(--muted); }
.date { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toggle { position: relative; width: 10px; height: 10px; color: var(--muted); }
.toggle::before, .toggle::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.toggle::before { top: 4px; left: 0; width: 9px; height: 1px; }
.toggle::after { top: 0; left: 4px; height: 9px; width: 1px; }
details[open] > summary .toggle::after { display: none; }
.job-detail { padding: 0 18px 10px 0; font-size: 14px; }
.location { font-size: 12px; color: var(--muted); }
.school { margin-bottom: 16px; }
.school h3 { font-size: 14px; font-weight: 600; margin: 0; }
abbr[title] { text-decoration: none; }
.school p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.extra { border-top: 1px solid var(--line); font-size: 13px; }
.extra summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.extra p { font-size: 13px; }
.extra ul { margin: 0 0 12px; padding-left: 16px; font-size: 12px; }
.extra li + li { margin-top: 10px; }

.music {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.music .section-heading { margin-bottom: 12px; }
.spotify-link { font-size: 12px; color: var(--muted); }
.playlist-player iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 12px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.theme-toggle {
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }
footer a { margin-left: auto; align-self: center; }

@media (max-width: 680px) {
  body { padding-left: 18px; }
  body::before { width: 18px; background-size: 18px 18px; }
  .page { padding: 28px 22px 22px; }
  .name-line { gap: 12px; }
  h1 { max-width: 15ch; }
  .index { grid-template-columns: 1fr; gap: 28px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .sidebar > section { grid-row: span 2; }
  .extra { align-self: start; }
}

@media (max-width: 360px) {
  .page { padding-inline: 18px; }
  .job summary { gap: 8px; }
  .sidebar { grid-template-columns: 1fr; }
}

@media print {
  .page { max-width: none; padding: 0; }
  :root, :root[data-theme], :root:not([data-theme="light"]) {
    color-scheme: light;
    --ink: #252b28;
    --muted: #606760;
    --accent: #874326;
    --line: #dedfd8;
  }
  body { padding-left: 0; background: white; color: black; }
  body::before, .music, .skip-link, .hint, .toggle, .theme-toggle { display: none; }
  details::details-content { content-visibility: visible; }
}
