/* ==========================================================================
   VeDevelopment stylesheet
   Plain document: white background, system fonts, no animation.
   ========================================================================== */

:root {
  --text:   #111;
  --muted:  #555;
  --rule:   #ddd;
  --link:   #00e;
  --visited:#551a8b;

  --measure: 44rem;  /* reading width of the content column */
  --sidebar: 12rem;  /* width of the fixed nav */
  --gutter:  3rem;   /* space between sidebar and content */
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2.5rem 1.25rem 4rem;

  background: #fff;
  color: var(--text);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* Narrow screens: single column, sidebar sits above the content. */
.content {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ── Links ─────────────────────────────────────────────────────────────── */

a {
  color: var(--link);
}

a:visited {
  color: var(--visited);
}

/*
 * In-page section links: same-page anchors, not "visited" in any real sense.
 * Pin every state so :visited (and any lingering :active/:focus tint) can't
 * override the normal link color.
 */
.sidebar a:link,
.sidebar a:visited,
.sidebar a:hover,
.sidebar a:active {
  color: var(--link);
}

a:hover {
  text-decoration: none;
}

/* Visible keyboard focus. */
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ── Header ────────────────────────────────────────────────────────────── */

header h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

header .role {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

header .intro {
  margin: 1rem 0 0;
  max-width: 38rem;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */

.sidebar {
  max-width: var(--measure);
  margin: 0 auto 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.sidebar__name {
  margin: 0;
  font-weight: 600;
}

.sidebar__name a {
  color: inherit;
  text-decoration: none;
}

.sidebar__role {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;

  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

/*
 * Wide screens: sidebar becomes a fixed left rail and the content column is
 * offset to clear it. Falls back to the stacked layout above when there isn't
 * room for both columns.
 */
@media (min-width: 60rem) {
  .sidebar {
    position: fixed;
    top: 2.5rem;
    left: 1.25rem;
    width: var(--sidebar);

    max-width: none;
    margin: 0;
    padding-bottom: 0;
    border-bottom: 0;

    /* Keep long nav lists reachable on short viewports. */
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }

  .sidebar ul {
    display: block;
  }

  .sidebar li + li {
    margin-top: 0.15rem;
  }

  .content {
    margin-left: calc(var(--sidebar) + var(--gutter));
    margin-right: auto;
  }
}

/* Centre the pair once the viewport is wide enough to hold both comfortably. */
@media (min-width: 76rem) {
  .sidebar {
    left: calc(50% - (var(--measure) / 2) - var(--gutter) - var(--sidebar));
  }

  .content {
    margin-left: auto;
  }
}

/*
 * Very wide screens: the fixed line length of --measure leaves an empty gap
 * on the right, unbalanced against the sidebar on the left. Widen the column
 * itself rather than adding a third visual element.
 */
@media (min-width: 90rem) {
  :root {
    --measure: 54rem;
  }
}

/* ── Sections ──────────────────────────────────────────────────────────── */

section {
  margin-top: 2.5rem;
}

section h2 {
  margin: 0 0 0.85rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);

  font-size: 1.1rem;
  line-height: 1.3;
}

section > p {
  margin: 0 0 0.75rem;
}

/* ── Entry lists (work, achievements) ──────────────────────────────────── */

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

.entries > li + li {
  margin-top: 1.5rem;
}

/*
 * Past Work only: flow entries into two columns once there's room, so a long
 * list doesn't read as one tall single-file column. Achievements stays
 * single-column since it only ever holds a couple of entries.
 */
@media (min-width: 40rem) {
  .entries--columns {
    column-count: 2;
    column-gap: 2rem;
  }

  .entries--columns > li {
    break-inside: avoid;
  }

  /* Multicol flow already separates entries visually; drop the extra gap
     so columns don't feel taller than they need to. */
  .entries--columns > li + li {
    margin-top: 1.25rem;
  }
}

.entries h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.entries p {
  margin: 0.2rem 0 0;
}

/*
 * Compact entries (no description): collapse title, meta, and link onto one
 * line instead of three stacked paragraphs.
 */
.entries__compact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.5rem;
}

.entries > li + .entries__compact,
.entries__compact + .entries__compact {
  margin-top: 0.5rem;
}

.entries__compact .meta,
.entries__compact .link {
  margin: 0;
}

.entries__compact .meta::before {
  content: "\00b7";
  margin-right: 0.5rem;
}

.entries__compact .link::before {
  content: "\00b7";
  margin-right: 0.5rem;
}

.meta,
.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.link {
  font-size: 0.9rem;
}

/* ── Definition lists (skills, contact) ────────────────────────────────── */

dl {
  margin: 0;
}

dt {
  font-weight: 600;
}

dt + dd {
  margin: 0.1rem 0 0;
}

dd + dt {
  margin-top: 0.9rem;
}

dd {
  margin-left: 0;
}

/* Contact reads as a two-column pair list on wider screens. */
@media (min-width: 34rem) {
  dl.contact {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.35rem 1rem;
  }

  dl.contact dt,
  dl.contact dd,
  dl.contact dd + dt {
    margin: 0;
  }
}

/* ── Pricing table ─────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.85rem;
}

caption {
  text-align: left;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

tbody th {
  font-weight: 600;
  white-space: nowrap;
}

td.price {
  white-space: nowrap;
}

tr > *:last-child {
  padding-right: 0;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);

  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

/* ── Print ─────────────────────────────────────────────────────────────── */

@media print {
  body {
    padding: 0;
  }

  .sidebar {
    display: none;
  }

  .content {
    max-width: none;
    margin: 0;
  }

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