/* ---------- Theme ---------- */

:root {
  --bg: #FFFFFF;
  --fg: #1F1F1F;
  --aside: #F4F4F4;
  --link-hover: #555555;
}

:root[data-theme="light"] {
  color-scheme: light;
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616;
    --fg: #E6E6E6;
    --aside: #202020;
    --link-hover: #A8A8A8;
  }
}

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #161616;
    --fg: #E6E6E6;
    --aside: #202020;
    --link-hover: #A8A8A8;
  }
}

/* ---------- Base ---------- */

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Montserrat, 'Helvetica Neue', Helvetica, sans-serif;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: var(--fg);
}

a:hover {
  color: var(--link-hover);
}

b {
  font-weight: 700;
}

/* ---------- Page layout (fixed 1240×3508 A4) ---------- */

.page {
  position: relative;
  margin: 0 auto;
  width: 1240px;
  height: 3508px;
  display: flex;
  align-items: stretch;
  background: var(--bg);
}

.sidebar {
  width: 375px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 284px 54px 80px 90px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  background: var(--aside);
  /* Extends the grey band to the left edge of the window. */
  box-shadow: 0 0 0 100vmax var(--aside);
  clip-path: inset(0 0 0 -100vmax);
}

.content {
  flex-grow: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 284px 125px 80px 38px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ---------- Header (name box) ---------- */

.header {
  position: absolute;
  z-index: 1;
  left: 281px;
  top: 58px;
  width: 584px;
  height: 188px;
  box-sizing: border-box;
  border: 2px solid var(--fg);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.header h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
}

.header .subtitle {
  font-size: 17px;
  letter-spacing: 0.06em;
}

/* ---------- Sections ---------- */

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section h2 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--fg);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.section p {
  font-size: 14px;
  line-height: 1.6;
}

.sidebar .section p {
  line-height: 1.5;
}

/* Details */

.details {
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
}

.field-value {
  font-size: 12px;
}

.field-value.multiline {
  line-height: 1.5;
}

/* Links */

.links {
  gap: 10px;
}

.links h2 {
  margin-bottom: 4px;
}

.links a {
  font-size: 14px;
  line-height: 1.45;
}

/* Skills and languages */

.ratings h2 {
  margin-bottom: 4px;
}

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

.dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  display: block;
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid var(--fg);
}

.dot.on {
  border: none;
  background: var(--fg);
}

/* Profile */

.profile {
  gap: 18px;
}

/* Employment and education */

.jobs {
  gap: 32px;
}

.jobs h2 {
  margin-bottom: -8px;
}

.education {
  gap: 22px;
}

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

.job-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.job-title h3 {
  font-size: 17px;
  font-weight: 700;
}

.job-location {
  font-size: 12px;
  flex-shrink: 0;
}

.job-period {
  font-size: 14px;
}

/* ---------- Theme toggle ---------- */

#theme-toggle {
  position: absolute;
  /* Vertically centred on the header, just past the right end of the section rules. */
  top: 132px;
  left: calc(max(0px, 50% - 620px) + 1115px);
  z-index: 10;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--fg);
  border-radius: 50%;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

#theme-toggle:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@media print {
  #theme-toggle {
    display: none;
  }
}
