/* ============================================================
   Matthew Thompson — design system
   Monochrome technical. Two-column editorial split on desktop,
   single column on mobile, resume-shaped in print.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Graphite Warmed — cool neutral ground, warm amber accent. */
  --bg:        #101216;
  --surface:   #191c22;
  --shell:     #1e222a;
  --text:      #e6e9ee;
  --soft:      #98a1af;
  --faint:     #6b7482;
  --rule:      #262b33;
  --hair:      rgba(255, 255, 255, .07);
  --accent:    #d9954a;
  --accent-dim:rgba(217, 149, 74, .14);

  --radius:    20px;
  --radius-in: 15px;
  --rail:      19rem;
  --measure:   40rem;

  --sans: "Geist", ui-sans-serif, system-ui, "SF Pro Text", "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "cv05";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--accent-dim); }

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

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 100;
  background: var(--surface); color: var(--text);
  padding: .6rem .9rem; border-radius: 10px; border: 1px solid var(--accent);
}

/* ---------- Shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 4rem;
  max-width: 74rem;
  margin-inline: auto;
  padding: 0 2.5rem;
}

.rail { position: relative; }

.rail-inner {
  position: sticky;
  top: 0;
  padding-block: 4.5rem 3rem;
  max-height: 100dvh;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-inner::-webkit-scrollbar { display: none; }

.content { padding-block: 4.5rem 2rem; min-width: 0; }

/* ---------- Identity ---------- */

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: .2rem .6rem;
  margin-bottom: 1.25rem;
}

.name {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.title {
  margin: .7rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

.certline {
  margin: .5rem 0 0;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.6;
  color: var(--soft);
}

/* ---------- Rail nav ---------- */

.nav { margin: 2.25rem 0 0; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li { margin-bottom: .1rem; }

.nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .3rem 0;
  color: var(--faint);
  text-decoration: none;
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .02em;
  transition: color .4s var(--ease);
}
.nav a::before {
  content: "";
  width: 1.5rem; height: 1px;
  background: currentColor;
  transition: width .4s var(--ease), background-color .4s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--text); }
.nav a:hover::before, .nav a.is-active::before { width: 2.75rem; background: var(--accent); }

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

.contact { list-style: none; margin: 2.25rem 0 0; padding: 0; font-size: .8125rem; }
.contact li { margin-bottom: .4rem; }
.contact a { color: var(--soft); text-decoration: none; transition: color .3s var(--ease); }
.contact a:hover { color: var(--accent); }

/* Button-in-button: label plus its own nested icon disc. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1.75rem;
  padding: .4rem .5rem .4rem 1.1rem;
  font: inherit;
  font-size: .8125rem;
  font-weight: 550;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 100px;
  cursor: pointer;
  transition: transform .5s var(--ease), border-color .5s var(--ease);
}
.btn .disc {
  display: grid;
  place-items: center;
  width: 1.6rem; height: 1.6rem;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: .8rem;
  transition: transform .5s var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:hover .disc { transform: translate(2px, -1px) scale(1.06); }
.btn:active { transform: scale(.975); }

/* ---------- Sections ---------- */

.content section { margin-bottom: 4.5rem; scroll-margin-top: 2rem; }
.content section:last-of-type { margin-bottom: 2rem; }

h2 {
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--faint);
  font-weight: 500;
  margin: 0 0 1.5rem;
}

h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }

h4 {
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--faint);
  font-weight: 500;
  margin: 1.5rem 0 .5rem;
}

p { margin: 0 0 .85rem; max-width: var(--measure); }
ul.list { margin: 0 0 .85rem; padding-left: 1.1rem; max-width: var(--measure); }
ul.list li { margin-bottom: .4rem; color: var(--soft); }

.lede { font-size: 1.0625rem; line-height: 1.6; color: var(--soft); }
.lede strong { color: var(--text); font-weight: 550; }

.section-note { color: var(--soft); font-size: .875rem; margin: -.75rem 0 1.5rem; }

/* ---------- Card: outer shell + inner core ---------- */

.card {
  background: var(--shell);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 1rem;
  transition: border-color .6s var(--ease), transform .6s var(--ease);
}
.card-in {
  background: var(--surface);
  border-radius: var(--radius-in);
  padding: 1.35rem 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card p { color: var(--soft); }
.card p:last-child { margin-bottom: 0; }

/* Hover one, dim the rest. */
.dimmable:hover > .card { opacity: .55; transition: opacity .5s var(--ease); }
.dimmable > .card:hover { opacity: 1; }

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .3rem 1rem;
  margin-bottom: .5rem;
}
.meta { font-family: var(--mono); font-size: .75rem; color: var(--faint); white-space: nowrap; }
.loc { font-weight: 400; color: var(--soft); font-size: .875rem; }
.role-line { margin: .15rem 0 .6rem; font-size: .9375rem; font-weight: 500; color: var(--text); }
.stack { display: block; margin-top: .2rem; font-family: var(--mono); font-size: .75rem; font-weight: 400; color: var(--faint); }

/* ---------- Skills ---------- */

.skills { margin: 0; }
.skills > div { padding: .85rem 0; border-top: 1px solid var(--rule); }
.skills > div:first-child { border-top: 0; padding-top: 0; }
.skills dt {
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text);
  margin-bottom: .35rem;
}
.skills dd { margin: 0; color: var(--soft); font-size: .9375rem; line-height: 1.55; }

/* ---------- Tags ---------- */

.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 0; padding: 0; max-width: none; }
.tag {
  font-family: var(--mono);
  font-size: .6875rem;
  line-height: 1.6;
  padding: .1rem .55rem;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--soft);
  white-space: nowrap;
}

/* ---------- Stats ---------- */

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
  padding: 1.25rem 0;
  border-block: 1px solid var(--rule);
}
.stats strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stats span { font-family: var(--mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }

/* ---------- Certs ---------- */

.certs { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.certs th {
  text-align: left;
  font-family: var(--mono);
  font-size: .625rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--faint);
  font-weight: 500;
  padding: 0 1rem .5rem 0;
}
.certs td { padding: .6rem 1rem .6rem 0; border-top: 1px solid var(--rule); vertical-align: top; color: var(--soft); }
.certs td:first-child { color: var(--text); }

/* ---------- Footer ---------- */

.foot {
  max-width: 74rem;
  margin-inline: auto;
  padding: 2rem 2.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-family: var(--mono);
  font-size: .75rem;
}

/* ---------- Scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.shown {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.no-js .reveal, .reveal.shown { opacity: 1; transform: none; }

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

/* ---------- Mobile ---------- */

@media (max-width: 60rem) {
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 1.25rem; max-width: 44rem; }
  .rail-inner { position: static; max-height: none; padding-block: 3rem 0; overflow: visible; }
  .content { padding-block: 2.5rem 1rem; }
  .nav { display: none; }
  .contact { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin-top: 1.5rem; }
  .contact li { margin-bottom: 0; }
  .foot { padding-inline: 1.25rem; }
  .content section { margin-bottom: 3rem; }
}

/* ============================================================
   PRINT — the resume page is the PDF. The rail flattens into a
   masthead and everything returns to one column.
   ============================================================ */

@media print {
  @page { margin: 0.55in 0.6in; }

  :root {
    --bg:#fff; --surface:#fff; --shell:#fff; --text:#000; --soft:#222;
    --faint:#444; --rule:#bbb; --hair:#bbb; --accent:#000; --accent-dim:#fff;
  }

  body { font-size: 10pt; line-height: 1.4; }

  .shell { display: block; max-width: none; padding: 0; }
  .rail-inner { position: static; max-height: none; padding: 0; overflow: visible; }
  .content { padding: 0; }

  .nav, .btn, .skip-link, .foot, .tags, .portfolio-link, .backlink { display: none !important; }

  .eyebrow { display: none; }
  .name { font-size: 21pt; }
  .title { font-size: 11pt; margin-top: .3rem; }
  .certline { font-size: 9pt; }
  .contact {
    display: flex; flex-wrap: wrap; gap: .1rem 1rem;
    margin: .5rem 0 .7rem; padding-bottom: .5rem;
    border-bottom: 1.5px solid #000;
    font-size: 9pt;
  }
  .contact li { margin: 0; }
  .contact a { color: #000; }

  a { color: #000; text-decoration: none; }

  .content section { margin-bottom: 1rem; }
  h2 { font-size: 8.5pt; margin-bottom: .5rem; padding-bottom: .15rem; border-bottom: 1px solid #999; }
  h3 { font-size: 11pt; }
  h4 { font-size: 8pt; margin: .5rem 0 .15rem; }
  .lede { font-size: 10pt; }
  ul.list li { margin-bottom: .1rem; }

  /* Cards flatten — no shells, no nesting, no shadows on paper. */
  .card { border: 0; padding: 0; margin-bottom: .7rem; background: none; }
  .card-in { border: 0; padding: 0; background: none; box-shadow: none; }
  .stats { border-block: 1px solid #999; }

  .reveal { opacity: 1 !important; transform: none !important; }

  h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
  .card, li, tr, .stats { break-inside: avoid; page-break-inside: avoid; }
}
