/* Layout & page sections — classless: element, id and structural selectors only. */

/* Sticky footer: body is the page column. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

/* Shared measure. Header and sections centre themselves; the footer stays
   full-bleed so its top border spans the viewport, and centres its inner div. */
header,
main > section,
footer > div {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-s);
}

/* --- Header --- */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-s);
  padding-block: var(--space-m);
}

/* Wordmark */
header > a {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

header nav {
  display: flex;
  gap: var(--space-s);
  font-size: var(--step--1);
}

header nav a {
  color: var(--text-muted);
  text-decoration: none;
}

header nav a:hover {
  color: var(--text);
  opacity: 1;
}

/* --- Main --- */

main {
  flex: 1;
}

main > section {
  padding-block: var(--space-l);
}

#intro {
  padding-block: var(--space-xl) var(--space-l);
}

/* Eyebrow: the first paragraph of the intro. */
#intro > p:first-child {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

/* Lede: the paragraph after the h1. */
#intro > h1 + p {
  font-size: var(--step-1);
  color: var(--text-muted);
  margin-top: var(--space-s);
}

/* --- Action rows (intro and contact) --- */

#intro > div,
#contact > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-m);
}

#intro > div > a,
#contact > div > a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.65em 1.25em;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--step--1);
  font-weight: 550;
  text-decoration: none;
  transition: transform var(--transition), opacity var(--transition);
}

#intro > div > a:hover,
#contact > div > a:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Secondary action: any button after the first is the ghost variant. */
#intro > div > a ~ a,
#contact > div > a ~ a {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

#intro > div > a ~ a:hover,
#contact > div > a ~ a:hover {
  border-color: var(--text-muted);
}

/* --- Card grid --- */

#work > div {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin-top: var(--space-m);
}

#work article {
  padding: var(--space-s);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

#work article h3 {
  font-size: var(--step-0);
  margin-bottom: var(--space-2xs);
}

#work article p {
  font-size: var(--step--1);
  color: var(--text-muted);
  max-width: none;
}

/* --- Footer --- */

footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-l);
  padding-block: var(--space-m);
}

footer > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  font-size: var(--step--1);
  color: var(--text-muted);
}
