:root {
  --primary: hsl(187, 85%, 60%);
  --link-hover: hsl(207, 100%, 94%);
  --color-dark: #1d1d1d;
  --color-subheading: #6b6b6b;

  /* Typography – single family for cohesive brand */
  --font-sans: "Plus Jakarta Sans", sans-serif;
  --line-height: 1.5;
  --line-height-tight: 1.2;
  --line-height-heading: 1.25;

  /* Editorial typescale – clear hierarchy (ratio ~1.2) */
  --text-xs: 0.8rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* 8px baseline spacing system (space-n = n × 8px) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
}

* {
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  padding: 0;
  margin: 0;
  scroll-behavior: smooth;
  scroll-padding-top: 2em;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background-color: white;
  line-height: var(--line-height);
  transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark {
  --color-dark: #e4e4e7;
  --color-subheading: #a1a1aa;
}

html.dark body {
  background-color: #18181b;
  color: #e4e4e7;
}

html.dark main {
  color: #e4e4e7;
}

html.dark h1,
html.dark h2,
html.dark h3 {
  color: #e4e4e7;
}

html.dark hr {
  background: #e4e4e7;
}

html.dark .back-to-top {
  background: #3f3f46;
  color: #e4e4e7;
}

html.dark main a {
  color: #93c5fd;
}

html.dark header h2.subheading a {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: underline;
  transition: all 0.3s ease;
}

a:hover,
a:focus {
  text-decoration-thickness: 2px;
}

main {
  color: var(--color-dark);
  padding: var(--space-6);
  padding-top: 120px;
  max-width: 1080px;
  margin: 0 auto;
}

header {
  margin-bottom: var(--space-8);
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: var(--space-3);
  text-align: left;
}

main > section {
  margin-top: calc(var(--space-6) + var(--space-1));
}

main > section:first-of-type {
  margin-top: 0;
}

main > section h3 {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

header h2 {
  margin-top: 0;
  font-weight: 100;
}

header h2.subheading {
  color: var(--color-subheading);
}

header h2.subheading a {
  color: inherit;
}

header svg {
  width: 1em;
  fill: currentColor;
  position: relative;
  top: 2px;
  margin: 0 5px;
  display: inline-block;
}

@media screen and (min-width: 600px) {
  header {
    grid-template-columns: 50% 1fr;
  }
  header:has(h1):not(:has(.showcase)) {
    grid-template-columns: 1fr;
  }
  .showcase {
    grid-column: 2;
    grid-row: 1/5;
  }
  .intro,
  .info,
  .author {
    grid-column: 1;
  }
}

@media screen and (min-width: 900px) {
  header {
    grid-template-columns: 60% 1fr;
  }
}

.showcase {
  z-index: 99;
  max-width: min(330px, 80vw);
  margin: auto;
}

h1 {
  margin-top: 0;
  margin-bottom: 0.25em;
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-dark);
  line-height: var(--line-height-tight);
}

h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  margin-top: 4em;
  margin-bottom: 0.25em;
  line-height: var(--line-height-heading);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-dark);
  line-height: var(--line-height-heading);
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
}

p {
  margin: 0 0 0.25em;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--line-height);
}

p.small {
  font-size: var(--text-sm);
  color: var(--color-subheading);
}

h1 sup {
  font-weight: 300;
  font-size: 0.5em;
}

h1 a,
h2 a,
h3 a {
  color: inherit;
  text-decoration: underline;
  display: inline-flex;
}

h2 + p,
h2 + p + p {
  font-style: italic;
  margin-bottom: 1em;
}

h2 sup {
  font-weight: 300;
  font-size: 0.75em;
  margin-left: 0.5em;
  font-style: italic;
  opacity: 0.8;
}

hr {
  border: none;
  background: var(--color-dark);
  height: 1px;
  opacity: 0.25;
  margin: 1em -1em;
}

mark {
  background: #006065;
  color: white;
  font-style: italic;
  font-weight: bold;
  padding-inline: 0.25em;
  border-radius: 3px;
}

.back-to-top {
  font-weight: bold;
  position: fixed;
  bottom: 1em;
  right: 1em;
  padding: .5em 1em;
  border-radius: 5em;
  background: var(--primary);
  color: hsl(192, 87%, 15%);
  text-decoration: none;
  box-shadow: 0 7px 13px -5px rgba(0, 0, 0, 0.125);
}