/* Engineering portfolio – plain CSS, no external fonts or scripts. */

:root {
  --bg: #f4f6f8;
  --ink: #13202b;
  --muted: #55636f;
  --line: #c3ccd4;
  --accent: #1f4fd8;
  --on-accent: #ffffff;
  --max: 62rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  /* Bahnschrift ships with Windows; DIN Alternate with macOS. */
  --font: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1821;
    --ink: #e4eaf0;
    --muted: #97a5b1;
    --line: #2c3b48;
    --accent: #7ea0ff;
    --on-accent: #0e1821;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  outline: 2px solid var(--accent);
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

p {
  max-width: 42rem;
  margin: 0 0 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
}

h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

/* Header and footer */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-block: 1.25rem;
}

.brand {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

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

.site-header nav a:hover {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-footer a {
  color: var(--muted);
}

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

.site-footer p {
  margin: 0;
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 10vw, 7rem) clamp(2.5rem, 6vw, 4rem);
}

.hero h1 {
  font-size: clamp(2.75rem, 10vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* Dimension line, as on a technical drawing */

.dim {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: none;
  margin: 1.25rem 0 2rem;
  color: var(--accent);
  font-size: 0.95rem;
}

.dim span {
  flex: 0 1 auto;
  text-align: center;
}

.dim i {
  position: relative;
  flex: 1 1 1.5rem;
  min-width: 1.5rem;
  height: 1px;
  background: currentColor;
}

.dim i::before {
  content: "";
  position: absolute;
  top: -4px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.dim i:first-child::before {
  left: 0;
  border-right: 9px solid currentColor;
}

.dim i:last-child::before {
  right: 0;
  border-left: 9px solid currentColor;
}

.dim i::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 1px;
  height: 19px;
  background: currentColor;
}

.dim i:first-child::after {
  left: 0;
}

.dim i:last-child::after {
  right: 0;
}

.lead {
  max-width: 36rem;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

/* Sections */

.block {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

/* Project register (table in the style of a parts list) */

.register {
  width: 100%;
  border-collapse: collapse;
}

.register th {
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  text-align: left;
}

.register td {
  padding: 1.1rem 1rem 1.1rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.register td:first-child {
  font-size: 1.2rem;
  font-weight: 600;
  white-space: nowrap;
}

.register tbody tr {
  position: relative;
}

.register tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

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

.register a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.register tbody tr:hover a {
  color: var(--accent);
}

@media (max-width: 42rem) {
  .register thead {
    display: none;
  }

  .register,
  .register tbody,
  .register tr,
  .register td {
    display: block;
  }

  .register tr {
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .register td {
    padding: 0;
    border: 0;
  }

  .register td:first-child {
    white-space: normal;
  }

  .register td:last-child {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.95rem;
  }
}

/* Workshop tiles and image placeholders */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.5rem 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.tiles figure {
  margin: 0;
}

.tiles figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.placeholder {
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.tiles .placeholder {
  aspect-ratio: 4 / 3;
}

.media {
  margin: 2rem 0;
}

.media .placeholder {
  aspect-ratio: 16 / 9;
}

.media figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Fact lists (about, project meta) */

.facts {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) 1fr;
  gap: 0.75rem 2rem;
  max-width: 46rem;
  margin: 2rem 0 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

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

@media (max-width: 36rem) {
  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .facts dd {
    margin-bottom: 1rem;
  }
}

/* Project pages */

.project-head {
  padding-block: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.5rem);
}

.project-head h1 {
  font-size: clamp(2.25rem, 7vw, 4rem);
  letter-spacing: -0.02em;
}

.project-head .lead {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.5rem;
}

.prose h2:first-child {
  margin-top: 0;
}

/* Visible draft notes: delete these paragraphs when the text is written */

.todo {
  color: var(--muted);
  font-style: italic;
}

/* Legal pages */

.legal h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
}

.legal h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}
