/* Consumes the semantic tokens defined in tokens.css. */

@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/mona-sans-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

html {
  height: 100%;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: var(--space-1600) var(--space-600);
  /* Never let content settle beneath the fixed toggle. */
  padding-bottom: max(var(--space-1600), var(--space-control-clearance));
  gap: var(--space-1600);
}

/* Profile
   ---------------------------------------------------------------------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile img {
  width: var(--size-avatar);
  height: var(--size-avatar);
  border-radius: 50%;
  object-fit: cover;
}

.profile h1 {
  margin: var(--space-600) 0 0;
  font-family: var(--font-family-wordmark);
  font-size: var(--font-size-wordmark);
  font-weight: var(--font-weight-wordmark);
  line-height: var(--line-height-wordmark);
  text-transform: uppercase;
}

.social-links {
  margin-top: var(--space-400);
  display: flex;
  gap: var(--space-400);
}

.social-links a {
  color: var(--color-text-body);
  transition: color var(--duration-fast) ease;
}

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

.social-links svg {
  width: var(--size-icon);
  height: var(--size-icon);
}

/* About
   ---------------------------------------------------------------------- */

.about {
  width: 100%;
  max-width: var(--size-measure);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-1200);
}

.about h2 {
  margin: 0 0 var(--space-600);
  font-size: var(--font-size-heading-2);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  color: var(--color-accent);
  text-align: center;
}

.about h3 {
  margin: var(--space-1000) 0 var(--space-500);
  font-size: var(--font-size-heading-3);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  color: var(--color-accent);
  text-align: center;
}

.about p {
  margin: 0 0 var(--space-500);
  color: var(--color-text-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-body);
  line-height: var(--line-height-body);
}

.about .lead {
  color: var(--color-text-primary);
  font-size: var(--font-size-lead);
  font-weight: var(--font-weight-lead);
  line-height: var(--line-height-lead);
}

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

.about a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.expertise {
  margin: 0;
  padding: 0;
  list-style: none;
}

.expertise li {
  color: var(--color-text-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-body);
  line-height: var(--line-height-list);
  padding: var(--space-300) 0;
  border-top: 1px solid var(--color-border);
}

.expertise li:first-child {
  border-top: none;
  padding-top: 0;
}

.expertise strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-emphasis);
}

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

.theme-toggle {
  position: fixed;
  z-index: 10;
  right: var(--space-control-inset);
  bottom: calc(var(--space-control-inset) + env(safe-area-inset-bottom, 0px));
  width: var(--size-control);
  height: var(--size-control);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface-raised);
  color: var(--color-text-body);
  cursor: pointer;
  transition: color var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

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

.theme-toggle svg {
  width: var(--size-icon-small);
  height: var(--size-icon-small);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Show the icon for the theme you'd switch *to*. The system-preference case
   needs its own rule because no data-theme attribute is present yet. */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
}

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

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Narrow viewports
   ---------------------------------------------------------------------- */

@media (max-width: 600px) {
  body {
    padding: var(--space-1200) var(--space-500);
    padding-bottom: max(var(--space-1200), var(--space-control-clearance));
    gap: var(--space-1200);
  }

  .about {
    padding-top: var(--space-800);
  }
}
