/* ============================================================
   Infra Interview Prep — Proforma Infrastructure Engineer
   Dark, restrained, enterprise-study aesthetic.
   Tokens per premium-dark-design-system (proven on financial-audit).
   ============================================================ */

:root {
  --bg: #0b0e0d;
  --bg-alt: #0f1312;
  --card: #111514;
  --code: #0d100f;
  --line: rgba(230, 236, 232, .09);
  --line-strong: rgba(230, 236, 232, .17);
  --text: #edece5;
  --text-2: #a8afab;
  --text-3: #7d8682;
  --accent: #2dd4bf;
  --accent-hi: #5ce3d0;
  --accent-dim: rgba(45, 212, 191, .10);
  --accent-on: #07110f;
  --warn: #e2b96f;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 64px;
  --radius: 14px;
  --content-max: 1080px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: rgba(45, 212, 191, .28); color: var(--text); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-on);
  padding: .5rem .9rem;
  border-radius: 8px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.18; margin: 0 0 .6em; color: var(--text); }

h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -.005em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); margin-bottom: .5em; }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }

p { margin: 0 0 1.1em; max-width: 72ch; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); max-width: 68ch; }

em.acc { font-style: italic; color: var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

.small { font-size: .85rem; }
.muted { color: var(--text-3); }
.t2 { color: var(--text-2); }

.eyebrow {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

main { display: block; }

section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--line);
}
section:last-of-type { border-bottom: none; }
.alt { background: var(--bg-alt); }

[id] { scroll-margin-top: calc(var(--header-h) + 18px); }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 13, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(45, 212, 191, .8);
  flex: none;
}
.brand .sub {
  display: none;
  font-family: var(--font-body);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.main-nav {
  margin-left: auto;
  display: flex;
  gap: .25rem;
  align-items: center;
}
.main-nav a {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: .45rem .55rem;
  border-radius: 7px;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--accent-hi); text-decoration: none; background: var(--accent-dim); }
.main-nav a[aria-current="page"] { color: var(--accent); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  width: 42px; height: 38px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 11px; right: 11px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle span { top: 18px; }
.nav-toggle span::before { top: -6px; left: 0; right: 0; }
.nav-toggle span::after { top: 6px; left: 0; right: 0; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(11, 14, 13, .97);
  padding: .75rem clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
}
.mobile-panel.open { display: block; }
.mobile-panel a {
  display: block;
  padding: .65rem .25rem;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.mobile-panel a:hover { color: var(--accent-hi); text-decoration: none; }
.mobile-panel a[aria-current="page"] { color: var(--accent); }

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .brand .sub { display: none; }
}

@media (min-width: 720px) and (min-width: 1080px) {
  .brand .sub { display: inline; }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -220px; left: 50%;
  transform: translateX(-50%);
  width: 720px; height: 480px;
  background: radial-gradient(ellipse at center, rgba(45, 212, 191, .07), transparent 65%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { max-width: 20ch; margin-bottom: 1.1rem; }
.hero .lede { margin-bottom: 1.75rem; }

/* ---------- Cards & grids ---------- */

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(45, 212, 191, .35); }
.card h3 { font-size: 1.15rem; }
.card p:last-child { margin-bottom: 0; }

a.card { color: var(--text); display: block; }
a.card:hover { text-decoration: none; color: var(--text); }
a.card .go {
  display: inline-block;
  margin-top: .9rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, .22);
  border-radius: 999px;
  padding: .28rem .7rem;
}
.chip.neutral { color: var(--text-2); background: rgba(230, 236, 232, .05); border-color: var(--line-strong); }
.chip.warn { color: var(--warn); background: rgba(226, 185, 111, .08); border-color: rgba(226, 185, 111, .25); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;
  padding: .65rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
}
.btn-primary:hover { background: var(--accent-hi); color: var(--accent-on); text-decoration: none; box-shadow: 0 0 24px rgba(45, 212, 191, .25); }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-hi); text-decoration: none; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
caption { text-align: left; padding: .9rem 1.1rem; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
th, td { text-align: left; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(230, 236, 232, .025); }
td strong { color: var(--text); }

/* ---------- Code blocks ---------- */

pre {
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.6;
  color: #d6dcd8;
  margin: 0 0 1.25rem;
}
pre code { font-family: inherit; }
code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: rgba(230, 236, 232, .07);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .35em;
  color: var(--accent-hi);
}
pre code { background: none; border: none; padding: 0; color: inherit; }
.code-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 .45rem;
}

/* ---------- Callouts ---------- */

.callout {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin: 0 0 1.25rem;
}
.callout.warn { border-left-color: var(--warn); }
.callout p:last-child { margin-bottom: 0; }
.callout .t { font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: .4rem; }
.callout.warn .t { color: var(--warn); }

/* ---------- Details / FAQ ---------- */

details {
  border-bottom: 1px solid var(--line);
  padding: .9rem 0;
}
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.2rem;
  flex: none;
  transition: transform .18s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details .d-body {
  padding: .8rem 0 .4rem;
  color: var(--text-2);
  animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { details .d-body { animation: none; } }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  color: var(--text-3);
  font-size: .85rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }

/* ---------- Prev/next study nav ---------- */

.study-nav {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.study-nav a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9rem 1.2rem;
  color: var(--text-2);
  max-width: 46%;
}
.study-nav a:hover { border-color: var(--accent); color: var(--accent-hi); text-decoration: none; }
.study-nav .dir { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: .3rem; }
.study-nav .next { text-align: right; margin-left: auto; }

/* ---------- Study plan / progress ---------- */

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding: .7rem 0 .7rem 2rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: .95rem;
  width: 15px; height: 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
}
.checklist li.done { color: var(--text); }
.checklist li.done::before {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2307110f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- Misc ---------- */

.hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.mt-2 { margin-top: 2rem; }
.stack > * + * { margin-top: 1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: .45rem; }
li::marker { color: var(--accent); }
.hide { display: none; }
