/* The Engineering Method — site styles
   Palette taken from the logo:
   navy #102544 · deep navy #0c1829 · gold #f5b800 · silver #cfd4da */
:root {
  --navy: #102544;
  --navy-deep: #0c1829;
  --navy-line: rgba(207, 212, 218, 0.07);
  --panel: #152c4f;
  --panel-edge: #24406a;
  --gold: #f5b800;
  --gold-dark: #c99700;
  --silver: #cfd4da;
  --text: #e8ecf1;
  --muted: #a9b4c2;
  --maxw: 1100px;
  --radius: 10px;
  --font-head: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--navy-deep);
  /* blueprint grid, like the logo background */
  background-image:
    linear-gradient(var(--navy-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--navy-line) 1px, transparent 1px);
  background-size: 32px 32px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffd34d; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; font-style: italic; text-transform: uppercase; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; font-style: italic; text-transform: uppercase; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

/* gold bar label, echoing the METHOD bar in the logo */
.bar {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--font-head);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .08em;
  padding: .25em .9em;
  transform: skewX(-12deg);
  margin-bottom: 1rem;
}
.bar > span { display: inline-block; transform: skewX(12deg); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(12, 24, 41, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--panel-edge);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 6px; }
.brand span { font-family: var(--font-head); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .95rem; letter-spacing: .02em; }
.brand b { color: var(--gold); font-weight: 800; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--silver); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 8px 12px; border-radius: 6px;
}
.nav a:hover { background: var(--panel); color: #fff; }
.nav a[aria-current="page"] { color: var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid var(--panel-edge); color: var(--text); border-radius: 6px; padding: 6px 10px; font-size: 1rem; cursor: pointer; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--navy-deep); border-bottom: 1px solid var(--panel-edge); padding: 8px 22px 16px; }
  .nav.open { display: flex; }
  .brand span { font-size: .85rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-weight: 700; text-decoration: none;
  padding: 12px 22px; border-radius: 8px; border: 2px solid var(--gold);
  transition: background .15s, color .15s;
}
.btn-primary { background: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { background: #ffd34d; color: var(--navy-deep); }
.btn-ghost { color: var(--gold); background: transparent; }
.btn-ghost:hover { background: rgba(245, 184, 0, .12); color: #ffd34d; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- sections ---------- */
section { padding: 64px 0; }
.page-head { padding: 56px 0 24px; }
.page-head p { font-size: 1.1rem; color: var(--muted); max-width: 720px; }

.hero { padding: 48px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { color: var(--gold); font-style: italic; }
.hero .lead { font-size: 1.15rem; color: var(--silver); max-width: 540px; }
.hero-img { border-radius: var(--radius); border: 1px solid var(--panel-edge); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero-img { order: -1; } }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin-top: .2em; }
.card .tag { font-size: .75rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.card p:last-child { margin-bottom: 0; }
.card.accent { border-left: 4px solid var(--gold); }

/* the "worked backward" steps */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { position: relative; padding: 22px 22px 22px 70px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 20px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--gold); color: var(--navy-deep); font-family: var(--font-head); font-weight: 800;
}
.step h3 { font-size: 1.05rem; margin-bottom: .3em; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

.band { background: rgba(16, 37, 68, .75); border-top: 1px solid var(--panel-edge); border-bottom: 1px solid var(--panel-edge); }

/* video embed */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--panel-edge); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.placeholder {
  aspect-ratio: 16 / 9; border-radius: var(--radius); border: 2px dashed var(--panel-edge);
  display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px;
  background: rgba(21, 44, 79, .5);
}

/* worked example / article */
.article { max-width: 780px; }
.article h2 { font-size: 1.45rem; margin-top: 1.8em; }
.article table { border-collapse: collapse; width: 100%; margin: 1em 0 1.4em; font-size: .95rem; }
.article th, .article td { border: 1px solid var(--panel-edge); padding: 8px 12px; text-align: left; }
.article th { background: var(--panel); color: var(--silver); }
.math-block { overflow-x: auto; background: rgba(21, 44, 79, .6); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 6px 16px; margin: 0 0 1.2em; }
.note {
  border-left: 4px solid var(--gold); background: rgba(245, 184, 0, .08);
  padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 1.2em 0; font-size: .95rem;
}
.note strong { color: var(--gold); }
.nameplate {
  font-family: "Consolas", "Courier New", monospace; font-size: .92rem;
  background: #dfe3e8; color: #1a2330; border-radius: 6px; padding: 16px 20px;
  border: 3px solid #9aa3ad; max-width: 460px; margin: 1em 0 1.4em;
}
.nameplate div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px dotted #9aa3ad; padding: 2px 0; }
.nameplate div:last-child { border-bottom: 0; }
.nameplate .np-title { display: block; text-align: center; font-weight: 700; letter-spacing: .1em; border-bottom: 2px solid #1a2330; margin-bottom: 6px; }

/* about */
.about-grid { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.about-grid img { border-radius: var(--radius); border: 1px solid var(--panel-edge); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-grid img { max-width: 200px; } }

/* footer */
.site-footer { border-top: 1px solid var(--panel-edge); padding: 36px 0; margin-top: 40px; font-size: .9rem; color: var(--muted); background: rgba(12, 24, 41, .9); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.site-footer a { color: var(--silver); }
.site-footer .disclaimer { flex-basis: 100%; font-size: .82rem; opacity: .85; }
