/* Alec Vogelsang — IT / SRE portfolio
   Hand-written, no preprocessor. Light and dark are both designed, not flipped.

   The look is meant to read as an instrument panel: system sans for prose,
   monospace for anything that behaves like a reading off a gauge (section
   eyebrows, stat values, metadata, tool names). One accent colour, used
   sparingly enough that it still means something when it shows up. */

/* ---------- tokens ---------- */

:root {
  /* light */
  --bg:        #fbfaf8;
  --surface:   #ffffff;
  --surface-2: #f3f1ed;
  --line:      #e2ded7;
  --line-firm: #cbc5ba;
  --ink:       #1c1b19;
  --ink-2:     #4a4741;
  --ink-3:     #6f6b63;
  --accent:    #0f6b6f;
  --accent-2:  #0b5457;
  --accent-bg: #e3f0ef;
  --shadow:    0 1px 2px rgba(28, 27, 25, .05), 0 8px 24px -12px rgba(28, 27, 25, .18);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --measure: 68ch;
  --pad: clamp(1.25rem, 5vw, 3rem);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14161a;
    --surface:   #1b1e23;
    --surface-2: #22262c;
    --line:      #2c3138;
    --line-firm: #3d444d;
    --ink:       #e9e7e3;
    --ink-2:     #b6b2ab;
    --ink-3:     #8b877f;
    --accent:    #5ec8c3;
    --accent-2:  #8fe0dc;
    --accent-bg: #17302f;
    --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

/* ---------- base ---------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 clamp(1rem, .97rem + .15vw, 1.0625rem)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; margin: 0; font-weight: 620; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

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

img { max-width: 100%; height: auto; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .1em .35em;
}

pre {
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.6;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;          /* wide content scrolls itself, never the page */
  margin: 0 0 1.5rem;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--line); }

.prose { max-width: var(--measure); }

/* Eyebrow — the little mono label above each section heading. */
.eyebrow {
  font: 500 .75rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section h2 {
  font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.9rem);
  margin-bottom: 1rem;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}
.brand {
  font: 600 .95rem/1 var(--mono);
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--accent); }

.nav { display: flex; gap: clamp(.75rem, 2.5vw, 1.5rem); flex-wrap: wrap; }
.nav a {
  font: 500 .875rem/1 var(--sans);
  color: var(--ink-2);
  text-decoration: none;
  padding: .35rem 0;
}
.nav a:hover { color: var(--accent); }
/* Narrow screens stack the header into two rows and let the nav wrap. It used
   to hide every link past the third, which with six items meant Contact — the
   one link that has to work — disappeared on a phone. */
@media (max-width: 44rem) {
  .site-head__in {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding-block: .6rem;
  }
  .nav { gap: .5rem .9rem; }
  .nav a { font-size: .8rem; padding: .2rem 0; }
}

/* ---------- hero ---------- */

/* Bottom padding is deliberately small: the stat row is a strong horizontal
   edge on its own, and the following section's own padding does the rest. */
.hero { padding-block: clamp(3rem, 9vw, 6rem) 0; }
.hero h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  letter-spacing: -.02em;
  margin-bottom: .6rem;
}
.hero__role {
  font: 500 clamp(.95rem, .9rem + .3vw, 1.1rem)/1.4 var(--mono);
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero__lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  color: var(--ink-2);
}
.hero__lede strong { color: var(--ink); font-weight: 600; }

.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Portrait sits beside the text on wide screens and above it on narrow ones,
   where a tall 2:3 image would otherwise push the whole intro below the fold. */
.hero__grid { display: grid; gap: clamp(1.75rem, 4vw, 3rem); align-items: start; }

.hero__portrait { margin: 0 0 .5rem; order: -1; }
.hero__portrait img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  /* Crops to the face rather than the centre of a full-length frame. */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 57% 20%;
}

@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .hero__portrait { order: 0; margin-bottom: 0; max-width: 22rem; margin-left: auto; }
  .hero__portrait img { aspect-ratio: 3 / 4; object-position: 57% 25%; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 500 .9rem/1 var(--sans);
  padding: .7rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn { color: #10201f; }
  .btn:hover { color: #10201f; }
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-firm);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }

/* ---------- stat row ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  margin-top: 3rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--surface); padding: 1.25rem 1.35rem; }
.stat__value {
  /* Proportional figures, not tabular — these are standalone display numbers,
     and tabular widths make something like "100+" read loose at this size. */
  font: 600 clamp(1.6rem, 1.3rem + 1.4vw, 2.15rem)/1 var(--sans);
  letter-spacing: -.02em;
  color: var(--ink);
  display: block;
}
.stat__label {
  font: 400 .8rem/1.4 var(--sans);
  color: var(--ink-3);
  margin-top: .45rem;
  display: block;
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.card p { color: var(--ink-2); font-size: .95rem; margin-bottom: 0; }

/* Case-study card — the whole thing is a link target. */
.work { display: grid; gap: 1.25rem; }
.work__item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.work__item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}
.work__meta {
  font: 500 .72rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}
.work__item h3 {
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  margin-bottom: .6rem;
}
.work__item:hover h3 { color: var(--accent); }
.work__item p { color: var(--ink-2); margin-bottom: 1rem; }
.work__more {
  font: 500 .85rem/1 var(--sans);
  color: var(--accent);
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag {
  font: 500 .72rem/1 var(--mono);
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .32rem .6rem;
}

/* ---------- experience ---------- */

.roles { display: grid; gap: 0; }
.role {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.role:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 42rem) {
  .role { grid-template-columns: 1fr; gap: .5rem; }
}
.role__when {
  font: 500 .78rem/1.5 var(--mono);
  color: var(--ink-3);
  letter-spacing: .02em;
  padding-top: .2rem;
}
.role h3 { font-size: 1.05rem; margin-bottom: .15rem; }
.role__where { font-size: .9rem; color: var(--accent); margin-bottom: .7rem; }
.role ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); font-size: .95rem; }
.role li { margin-bottom: .35rem; }
.role li::marker { color: var(--ink-3); }

/* ---------- skills ---------- */

.skills { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.skills h3 {
  font: 500 .75rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .8rem;
}
.skills ul { list-style: none; margin: 0; padding: 0; }
.skills li {
  font-size: .92rem;
  color: var(--ink-2);
  padding: .28rem 0;
  border-bottom: 1px solid var(--line);
}
.skills li:last-child { border-bottom: 0; }

/* ---------- data sources ---------- */

.sources {
  display: grid;
  gap: 1.75rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.sources h4 {
  font: 500 .75rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .8rem;
}
.sources .tags { margin-top: 0; }

/* ---------- certifications ---------- */

.certs { display: grid; gap: .75rem; margin-bottom: 2.5rem; }
.cert {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .85rem 1.1rem;
}
.cert strong { font-weight: 600; font-size: .98rem; }
.cert span { font: 400 .8rem/1.4 var(--mono); color: var(--ink-3); margin-left: auto; }
@media (max-width: 34rem) {
  .cert { flex-direction: column; gap: .2rem; }
  .cert span { margin-left: 0; }
}

/* ---------- contact ---------- */

.form { display: grid; gap: 1rem; max-width: 34rem; margin-top: 1.75rem; }
.field { display: grid; gap: .35rem; }
.field label { font: 500 .82rem/1 var(--sans); color: var(--ink-2); }
.field input, .field textarea {
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-firm);
  border-radius: var(--radius);
  padding: .65rem .8rem;
  width: 100%;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }

.form__status { font-size: .9rem; color: var(--ink-2); min-height: 1.4em; }
.form__status.is-ok  { color: var(--accent); }
.form__status.is-bad { color: #c2410c; }
@media (prefers-color-scheme: dark) { .form__status.is-bad { color: #fb923c; } }

.hp { position: absolute; left: -9999px; }  /* honeypot */

.contact__direct {
  font-size: .95rem;
  color: var(--ink-2);
  margin-top: 1.5rem;
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  font-size: .875rem;
  color: var(--ink-3);
}
.site-foot__in { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.site-foot a { color: var(--ink-2); }

/* ---------- case-study pages ---------- */

.study { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 8vw, 5rem); }

.crumb {
  font: 500 .8rem/1 var(--sans);
  margin-bottom: 2rem;
  display: inline-block;
}

.study h1 {
  font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem);
  letter-spacing: -.02em;
  margin-bottom: 1rem;
  max-width: 22ch;
}

.study__lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1rem + .3vw, 1.15rem);
  color: var(--ink-2);
  margin-bottom: 2rem;
}

.study__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 3rem;
}
.fact { background: var(--surface); padding: .9rem 1.1rem; }
.fact dt {
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .4rem;
}
.fact dd { margin: 0; font-size: .92rem; color: var(--ink); }

.study__body { max-width: var(--measure); }
.study__body h2 {
  font-size: clamp(1.2rem, 1.1rem + .6vw, 1.45rem);
  margin: 2.75rem 0 .9rem;
}
.study__body h3 {
  font-size: 1.02rem;
  margin: 1.75rem 0 .5rem;
}
.study__body ul, .study__body ol { padding-left: 1.2rem; margin: 0 0 1.25rem; color: var(--ink-2); }
.study__body li { margin-bottom: .5rem; }
.study__body li::marker { color: var(--ink-3); }
.study__body > p { color: var(--ink-2); }
.study__body strong { color: var(--ink); font-weight: 600; }

/* Pull-out for the thing worth remembering from each study. */
.takeaway {
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 2rem 0;
}
.takeaway p { color: var(--ink); margin-bottom: 0; }
.takeaway strong { display: block; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .55rem; }

/* Steps table in the TLS study. Scrolls itself on narrow screens. */
.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; min-width: 30rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
td { color: var(--ink-2); }
td:first-child { color: var(--ink); font-family: var(--mono); font-size: .85rem; white-space: nowrap; }

.study__next {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

/* A short, honest note about what's been left out. Every case study has one. */
.redaction-note {
  font-size: .85rem;
  color: var(--ink-3);
  border-left: 2px solid var(--line-firm);
  padding-left: 1rem;
  margin: 2.5rem 0 0;
  max-width: var(--measure);
}
