/* ============================================
   CSS VARIABLES
   ============================================ */

:root {
  /* Colours */
  --color-bg: hsl(20 37% 98.5%);
  --color-text: #111111;
  --color-text-muted: #888888;
  --color-accent: hsl(9 88% 55%);
  --color-border: #e2e2e2;
  --color-card-bg: hsl(20 15% 94%);

  /* Typography */
  --text-caption: 1rem;
  --text-body: 1.25rem;
  --text-heading-sm: 1.5rem;
  --text-heading-md: 2.25rem;
  --text-heading-lg: 3rem;

  --leading-tight: 1.25;
  --leading-base: 1.625;
  --leading-compact: 1.35;

  --font-regular: 450;
  --font-medium: 550;
  --font-semibold: 650;
  --font-bold: 750;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 3rem;
  --space-xl: 4.5rem;
  --space-2xl: 6rem;

  --stack-xs: var(--space-xs);
  --stack-sm: var(--space-sm);
  --stack-md: var(--space-md);
  --stack-lg: var(--space-lg);
  --section-gap: 2.5rem;

  /* Layout */
  --prose-width: 48rem;
  --page-gutter: 1.5rem;
  --radius: 9px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: hsl(20 11% 7%);
    --color-text: rgb(244, 238, 230);
    --color-text-muted: rgb(149, 143, 135);
    --color-accent: hsl(9 88% 62%);
    --color-border: hsl(20 8% 12%);
    --color-card-bg: hsl(20 8% 10%);
  }
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  background-color: var(--color-bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: var(--text-body);
  font-weight: var(--font-regular);
  line-height: var(--leading-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  margin: 0;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-heading-lg); }
h2 { font-size: var(--text-heading-md); }
h3 { font-size: var(--text-heading-sm); }

p {
  margin: 0;
}

a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.3s;
}

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

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: var(--prose-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  display: grid;
  /* Spacing scales with viewport height so the page fits without scrolling on short screens */
  gap: clamp(1.25rem, 3.5vh, 2rem);
  padding-top: clamp(1rem, 4vh, 3rem);
  padding-bottom: clamp(0.5rem, 2vh, 2.5rem);
}

.hero-mark {
  display: block;
  width: clamp(3.5rem, 10vh, 5rem);
  height: clamp(3.5rem, 10vh, 5rem);
  transform: translateX(-0.4rem);
}

.hero-name {
  font-size: var(--text-heading-md);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
}

.hero-summary {
  display: grid;
  gap: calc(var(--stack-md) * 2);
}

.hero-summary p {
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

.hero-summary p:first-child {
  font-weight: var(--font-medium);
  color: var(--color-text);
}

.project-row {
  display: block;
  padding: var(--stack-xs) 0;
  text-decoration: none;
  transition: opacity 0.3s, color 0.3s;
}

.project-row:hover {
  color: var(--color-text);
}

@media (hover: hover) {
  .project-list:has(.project-row:hover) .project-row:not(:hover) {
    opacity: 0.42;
  }
}

.project-row-title {
  font-size: var(--text-body);
  font-weight: var(--font-medium);
  line-height: var(--leading-tight);
  transition: color 0.3s;
}

.project-row:hover .project-row-title {
  color: var(--color-accent);
}

.project-row-summary,
.project-row-external {
  color: var(--color-text-muted);
  font-size: var(--text-body);
  font-weight: var(--font-medium);
  line-height: var(--leading-tight);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.7rem;
}

.hero-link {
  font-size: var(--text-body);
  font-weight: var(--font-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
}

.hero-link::before {
  content: "→";
  display: inline-block;
  margin-right: 0.2em;
}

.hero-link:hover {
  color: var(--color-accent);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  display: grid;
  gap: var(--stack-xs);
  width: 100%;
  max-width: var(--prose-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--page-gutter);
  padding-bottom: var(--space-md);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

.site-footer-legal {
  font-size: 0.8125rem;
  line-height: var(--leading-compact);
}
