/* The Delphi Way - site stylesheet
   Design language matches the book cover: deep navy base, gold accents,
   classical-meets-technical typography. Pure CSS, no frameworks. */

:root {
  --navy-deep: #050d1f;
  --navy: #0a1830;
  --navy-soft: #122042;
  --gold: #d4a233;
  --gold-light: #f0c554;
  --gold-bright: #f5d97c;
  --cream: #f4ead4;
  --cream-soft: #e8e1cd;
  --cream-mute: #d8caa3;
  --teal-glow: rgba(120, 230, 255, 0.10);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-deep);
  color: var(--cream-soft);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Page background with the same atmospheric gradient as the cover */
body {
  background:
    radial-gradient(ellipse 1100px 700px at 80% 0%, rgba(212, 162, 51, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 900px 700px at 0% 100%, rgba(120, 230, 255, 0.05) 0%, transparent 55%),
    linear-gradient(180deg, #050d1f 0%, #0a1830 30%, #0a1830 70%, #050d1f 100%);
  min-height: 100vh;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; }

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

/* ============ HEADER / NAV ============ */
.site-header {
  border-bottom: 1px solid rgba(212, 162, 51, 0.18);
  background: rgba(5, 13, 31, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .brand-the {
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--gold-light);
}
.brand .brand-way {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-light);
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 14px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--cream-soft);
  font-weight: 500;
}
.nav-links a:hover { color: var(--gold-bright); text-decoration: none; }
.nav-links a.active { color: var(--gold-light); }

/* ============ MAIN ============ */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 28px;
}
.narrow { max-width: 760px; margin: 0 auto; }

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 60px;
  align-items: center;
  margin: 30px 0 60px;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero-cover { order: -1; max-width: 280px; margin: 0 auto; }
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  margin: 0 0 8px;
  font-weight: 400;
}
.hero-title .accent {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-light);
}
.hero-title .big {
  display: inline-block;
  font-weight: 700;
  font-size: 76px;
  letter-spacing: -2px;
  background: linear-gradient(180deg, #f5d97c, #d4a233 70%, #b78420 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1.45;
  color: var(--cream);
  margin: 24px 0 32px;
  max-width: 560px;
}
.hero-sub strong { font-style: normal; font-weight: 600; color: var(--gold-light); }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-block;
  padding: 13px 24px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1.5px solid var(--gold);
  background: linear-gradient(180deg, rgba(240, 197, 84, 0.12) 0%, rgba(240, 197, 84, 0.04) 100%);
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  color: var(--navy-deep);
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(212, 162, 51, 0.3);
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  color: var(--navy-deep);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-light) 100%);
}
.btn-ghost { background: transparent; }

.hero-cover {
  position: relative;
}
.hero-cover img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(212, 162, 51, 0.15);
}
.hero-cover::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(212, 162, 51, 0.20);
  border-radius: 6px;
  pointer-events: none;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3 { color: var(--cream); font-family: var(--serif); }
h1 { font-size: 42px; font-weight: 700; margin: 0 0 12px; line-height: 1.1; }
h1 .accent { color: var(--gold-light); font-style: italic; font-weight: 400; }
h2 { font-size: 28px; font-weight: 600; margin-top: 50px; padding-bottom: 8px; border-bottom: 1px solid rgba(212, 162, 51, 0.18); }
h3 { font-size: 20px; margin-top: 30px; }
p { margin: 0 0 14px; }
strong { color: var(--cream); font-weight: 600; }
em { color: var(--gold-light); }
ul, ol { margin: 0 0 14px; padding-left: 24px; }
li { margin: 6px 0; }
code, pre, kbd { font-family: var(--mono); }
code { background: rgba(212, 162, 51, 0.08); padding: 1px 6px; border-radius: 3px; color: var(--gold-light); font-size: 0.92em; }
pre {
  background: rgba(5, 13, 31, 0.7);
  border: 1px solid rgba(212, 162, 51, 0.18);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.5;
}
blockquote {
  border-left: 3px solid var(--gold);
  margin: 18px 0;
  padding: 8px 18px;
  background: rgba(212, 162, 51, 0.05);
  font-style: italic;
  color: var(--cream-soft);
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 51, 0.4), transparent);
  margin: 40px 0;
}

/* ============ TILES / GRIDS ============ */
.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin: 36px 0;
}
.tile {
  background: rgba(18, 32, 66, 0.45);
  border: 1px solid rgba(212, 162, 51, 0.15);
  padding: 22px 24px;
  border-radius: 5px;
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover { border-color: rgba(212, 162, 51, 0.45); transform: translateY(-2px); }
.tile-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  color: var(--gold-light);
  display: block;
  margin-bottom: 4px;
}
.tile-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--cream-mute);
}
.tile-body { margin-top: 8px; color: var(--cream-soft); font-size: 14.5px; line-height: 1.5; }

/* Feature pills */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.pill {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  border: 1px solid rgba(240, 197, 84, 0.4);
  background: rgba(240, 197, 84, 0.06);
  padding: 6px 14px;
  border-radius: 18px;
  text-transform: uppercase;
}

/* TOC */
.toc-part {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-light);
  font-size: 18px;
  margin-top: 28px;
}
.toc-list { list-style: none; padding-left: 0; }
.toc-list li { padding: 4px 0; border-bottom: 1px dotted rgba(212, 162, 51, 0.10); display: flex; gap: 14px; }
.toc-num { font-family: var(--mono); color: var(--gold); width: 36px; flex-shrink: 0; }

/* Buy options */
.buy-card {
  background: rgba(18, 32, 66, 0.45);
  border: 1px solid rgba(212, 162, 51, 0.18);
  padding: 28px 32px;
  border-radius: 5px;
  margin: 18px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.buy-card h3 { margin: 0 0 6px; color: var(--cream); }
.buy-card .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}
.buy-card .price {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-light);
}

/* Forms */
.form-card {
  background: rgba(18, 32, 66, 0.45);
  border: 1px solid rgba(212, 162, 51, 0.20);
  padding: 32px;
  border-radius: 5px;
  max-width: 640px;
  margin: 30px auto;
}
.form-card label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin: 18px 0 6px;
}
.form-card input[type=text], .form-card input[type=email], .form-card select {
  width: 100%;
  background: rgba(5, 13, 31, 0.7);
  border: 1px solid rgba(212, 162, 51, 0.30);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 3px;
  transition: border-color 0.15s;
}
.form-card input:focus, .form-card select:focus {
  border-color: var(--gold);
  outline: none;
}
.form-card .question {
  background: rgba(212, 162, 51, 0.08);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  margin: 8px 0;
  font-style: italic;
  color: var(--cream);
  border-radius: 3px;
}
.form-card .submit-row { margin-top: 24px; }
.form-card .small { font-size: 12px; color: var(--cream-mute); margin-top: 18px; }

/* Errata table */
.errata-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.errata-table th {
  background: rgba(212, 162, 51, 0.10);
  color: var(--gold-light);
  text-align: left;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(212, 162, 51, 0.30);
}
.errata-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(212, 162, 51, 0.10);
  vertical-align: top;
}
.errata-table tr:hover { background: rgba(212, 162, 51, 0.03); }

/* Blog cards */
.post-card {
  background: rgba(18, 32, 66, 0.45);
  border: 1px solid rgba(212, 162, 51, 0.15);
  padding: 24px 28px;
  border-radius: 5px;
  margin: 18px 0;
  transition: border-color 0.15s;
}
.post-card:hover { border-color: rgba(212, 162, 51, 0.4); }
.post-card h3 { margin: 0 0 6px; }
.post-card h3 a { color: var(--cream); text-decoration: none; }
.post-card h3 a:hover { color: var(--gold-light); }
.post-card .post-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.post-card .post-excerpt { color: var(--cream-soft); font-size: 15px; line-height: 1.6; }

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid rgba(212, 162, 51, 0.18);
  background: rgba(5, 13, 31, 0.8);
  margin-top: 100px;
  padding: 36px 28px;
  text-align: center;
  color: var(--cream-mute);
  font-size: 13px;
}
.site-footer .footer-brand {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-light);
  font-size: 16px;
  margin-bottom: 8px;
}
.site-footer a { color: var(--cream-soft); }

/* ============ STATUS / FLASH ============ */
.flash-ok {
  background: rgba(31, 122, 31, 0.18);
  border: 1px solid rgba(31, 200, 80, 0.40);
  border-left: 4px solid #1fc850;
  padding: 14px 18px;
  border-radius: 4px;
  color: #c8f5d3;
  margin: 16px 0;
}
.flash-err {
  background: rgba(176, 48, 48, 0.18);
  border: 1px solid rgba(220, 80, 80, 0.40);
  border-left: 4px solid #dc5050;
  padding: 14px 18px;
  border-radius: 4px;
  color: #f5cccc;
  margin: 16px 0;
}

/* ============ DECORATIVE ELEMENTS ============ */
.divider-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
  gap: 16px;
}
.divider-gold .line { flex: 1; max-width: 100px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.divider-gold .diamond { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }

.section-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}
