:root {
  /* Typography tokens */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-body: clamp(1rem, 1.05vw + 0.85rem, 1.125rem);
  --line-height-body: 1.7;
  --font-weight-hero: 800;
  --font-weight-heading: 700;
  --font-weight-semibold: 600;
  --font-size-hero: clamp(2.5rem, 5vw + 1rem, 3.5rem);
  --line-height-hero: 1.15;
  --letter-spacing-hero: -0.02em;
  --font-size-section-label: 0.75rem;
  --letter-spacing-section-label: 0.1em;

  /* Spacing tokens */
  --content-max: 760px;
  --page-padding: clamp(2.25rem, 5vw + 1rem, 3rem);
  --space-section: clamp(3.75rem, 6vw + 2rem, 5rem);
  --space-card-padding: clamp(1.25rem, 3vw, 1.5rem);
  --space-card-gap: clamp(1rem, 2.5vw, 1.25rem);
  --space-lg: clamp(1.75rem, 3vw, 2.25rem);
  --space-md: 1.25rem;
  --space-sm: 0.75rem;
  --space-xs: 0.5rem;

  /* Colors */
  --color-text: #2a2a2a;
  --color-muted: rgba(42, 42, 42, 0.55);
  --color-border: rgba(42, 42, 42, 0.1);
  --color-background: #f8f7f5;
  --color-surface: rgba(255, 255, 255, 0.65);
  --shadow-soft: 0 12px 32px -18px rgba(17, 17, 17, 0.28);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--page-background, var(--color-background));
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 6vw, 1.75rem);
  padding-block: var(--page-padding);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
  flex: 1 0 auto;
}

.homepage-hero {
  display: grid;
  gap: var(--space-card-gap);
}

.homepage-hero__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.homepage-hero__title {
  font-size: var(--font-size-hero);
  line-height: var(--line-height-hero);
  font-weight: var(--font-weight-hero);
  letter-spacing: var(--letter-spacing-hero);
  margin: 0;
}

.homepage-hero__location {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-muted);
  font-size: 0.875rem;
}

.homepage-hero__tagline {
  color: var(--color-muted);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.homepage-hero__description {
  display: grid;
  gap: var(--space-sm);
  max-width: 52ch;
}

.homepage-hero__description p {
  margin: 0;
}

.homepage-section {
  display: grid;
  gap: var(--space-card-gap);
}

.homepage-section__title {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-section-label);
  color: var(--color-muted);
}

.page-section {
  display: grid;
  gap: var(--space-section);
}

.homepage-links__grid {
  display: grid;
  gap: var(--space-card-gap);
}

.homepage-currently__grid {
  display: grid;
  gap: var(--space-card-gap);
}

.homepage-currently-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-card-padding);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.homepage-currently-card__label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  color: var(--color-muted);
  font-weight: var(--font-weight-semibold);
}

.homepage-currently-card__description {
  margin: 0;
  color: var(--color-text);
}

.homepage-link-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-card-padding);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-decoration: none;
  background: var(--color-surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.homepage-link-card:hover {
  border-color: currentColor;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.homepage-link-card:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  box-shadow: var(--shadow-soft);
}

.homepage-link-card__label {
  font-weight: var(--font-weight-semibold);
}

.homepage-link-card__description {
  color: var(--color-muted);
}

.homepage-projects__grid {
  display: grid;
  gap: var(--space-card-gap);
}

.project-list {
  display: grid;
  gap: var(--space-card-gap);
}

.project-card {
  display: block;
  padding: var(--space-card-padding);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-decoration: none;
  background: var(--color-surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  border-color: currentColor;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.project-card:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  box-shadow: var(--shadow-soft);
}

.project {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-card-padding);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
  background: var(--color-surface);
}

.project:hover,
.project:focus-within {
  border-color: currentColor;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.project-link {
  font-weight: var(--font-weight-semibold);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.project-link::after {
  content: "→";
  font-size: 0.875rem;
}

.project-link:hover,
.project-link:focus-visible {
  border-color: currentColor;
}

.timeline {
  display: grid;
  gap: var(--space-card-gap);
}

.timeline-item {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: var(--space-card-padding);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--space-sm);
}

.timeline-item__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.timeline-item__company {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
}

.timeline-item__role {
  margin: 0;
  font-size: clamp(1.1rem, 0.8vw + 1rem, 1.35rem);
  font-weight: var(--font-weight-heading);
}

.timeline-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  color: var(--color-muted);
  font-size: 0.9rem;
}

.timeline-item__meta span + span::before {
  content: "•";
  margin-inline: 0.4rem;
  opacity: 0.5;
}

.timeline-item__description {
  margin: 0;
  color: var(--color-text);
}

.now-sections {
  display: grid;
  gap: var(--space-section);
}

.now-section__title {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  font-size: var(--font-size-section-label);
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.now-grid {
  display: grid;
  gap: var(--space-card-gap);
}

.now-card {
  padding: var(--space-card-padding);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--space-sm);
}

.now-card__label {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: var(--font-weight-semibold);
}

.now-card__description {
  margin: 0;
  color: var(--color-text);
}

.collection-groups {
  display: grid;
  gap: var(--space-section);
}

.collection-group__header {
  display: grid;
  gap: var(--space-xs);
}

.collection-group__title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  font-size: var(--font-size-section-label);
  color: var(--color-muted);
}

.collection-group__description {
  margin: 0;
  color: var(--color-text);
}

.collection-grid {
  display: grid;
  gap: var(--space-card-gap);
}

.collection-card {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-card-padding);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-2px);
  border-color: currentColor;
  outline: none;
}

.collection-card__name {
  font-weight: var(--font-weight-semibold);
}

.collection-card__note {
  margin: 0;
  color: var(--color-muted);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 1200px) {
  :root {
    --content-max: 840px;
    --space-section: clamp(4.5rem, 3vw + 3rem, 6rem);
  }
}

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* Navigation bar */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: var(--space-section);
}

.nav-link {
  color: var(--color-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.125rem 0.35rem;
  border-radius: 4px;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
  border-color: currentColor;
  background: rgba(42, 42, 42, 0.08);
}

.nav-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Headings + textual elements share a single size */
h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.page-subtitle,
.list-item-title,
.project-title {
  margin: 0;
  font-size: inherit;
  font-weight: var(--font-weight-heading);
}

p,
ul,
ol {
  margin: var(--space-md) 0;
}

ul,
ol {
  padding-left: 1.1rem;
}

li + li {
  margin-top: var(--space-xs);
}

a {
  color: inherit;
  text-decoration-color: rgba(31, 31, 31, 0.25);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

blockquote {
  margin: var(--space-section) 0;
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
  font-style: italic;
}

/* Generic layout helpers */
.page-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.page-subtitle {
  color: var(--color-muted);
}

.page-subtitle p {
  margin: 0;
}

.section-description {
  color: var(--color-muted);
  max-width: 60ch;
}

.list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.list-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}

.list-item:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.list-item:last-of-type {
  border-bottom: none;
}

.subscribe-card {
  margin-top: var(--space-section);
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  display: grid;
  gap: var(--space-sm);
  box-shadow: var(--shadow-soft);
  max-width: 36rem;
}

.subscribe-card__label {
  font-weight: var(--font-weight-heading);
  letter-spacing: var(--letter-spacing-section-label);
  text-transform: uppercase;
  color: var(--color-muted);
  font-size: 0.75rem;
}

.subscribe-card__description {
  margin: 0;
  color: var(--color-text);
}

.subscribe-card__link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.subscribe-card__link::after {
  content: "→";
  font-size: 0.875rem;
}

.subscribe-card__link:hover,
.subscribe-card__link:focus-visible {
  border-color: currentColor;
}

.list-item-details {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-muted);
}

.list-divider {
  flex: 1;
  height: 1px;
  border-bottom: 1px solid var(--color-border);
  display: none;
}

.post-meta {
  color: var(--color-muted);
}

.post-body {
  display: grid;
  gap: var(--space-md);
}

.post {
  display: grid;
  gap: var(--space-section);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-card-gap);
}

.project-meta {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
  color: var(--color-muted);
}

.project-description {
  color: var(--color-muted);
}

.now-photo {
  width: 100%;
  border-radius: 12px;
  margin: var(--space-md) 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-section);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.back-link:hover {
  border-color: currentColor;
}

footer {
  margin-top: var(--space-section);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
}

.footer-copy {
  margin: 0;
  font-weight: 500;
}

.footer-rss {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.footer-rss__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-section-label);
}

.footer-rss__note {
  font-weight: var(--font-weight-semibold);
}

.footer-rss:hover,
.footer-rss:focus-visible {
  transform: translateY(-2px);
  border-color: currentColor;
  outline: none;
}

@media (min-width: 680px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 680px) {
  .list-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .list-divider {
    display: block;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homepage-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .homepage-links__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homepage-projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homepage-currently__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline-item__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }

  .now-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  :root {
    --content-max: 880px;
  }
}
