/* =========================================================
   Jacob Starlite — site styles
   Theme: "Da Vinci" — Renaissance notebook / sketchbook
   (parchment background, italic serif headlines, rust-ink accent,
   dog-eared cards, sketch-line ornament)
   ========================================================= */

:root {
  --bg: #efe3c8;
  --bg-alt: #f6ecd6;
  --text: #3d2e1f;
  --text-muted: #5c4a37;
  --text-faint: #7a6650;
  --border: #d8c7a3;
  --accent: #8b3a2e;
  --accent-dark: #6b2c22;
  --accent-soft: #e8d7bd;
  --code-bg: #2b2018;
  --code-text: #efe3c8;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 4px;
  --max-width: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: var(--mono);
}

/* ---------- Top bar / nav ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.tagline {
  margin: 0;
  font-family: var(--sans);
  font-style: normal;
  color: #800000;
  font-size: 0.8rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Hamburger button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 19px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 60;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* Nav menu (dropdown, works as hamburger menu at all sizes) */
.nav-menu {
  position: absolute;
  top: 100%;
  right: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(43, 32, 24, 0.18);
  padding: 8px;
  display: flex;
  flex-direction: column;
  width: 50vw;
  gap: 2px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-menu a {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
}

.nav-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
}

.nav-menu a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

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

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 90px;
}

.page-header {
  margin-bottom: 40px;
}

.page-header .eyebrow {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1rem;
  margin: 0 0 8px;
}

.page-header h1 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0 0 12px;
  font-size: 2.1rem;
}

.page-header p {
  color: var(--text-muted);
  margin: 0;
  max-width: 60ch;
}

/* ---------- Hero (home page) ---------- */

.hero {
  position: relative;
  padding: 8px 0 0;
}

.sketch-circle {
  display: block;
  width: 130px;
  margin: 0 auto 18px;
  color: var(--text-muted);
  opacity: 0.75;
}

.seal {
  position: absolute;
  top: 4px;
  right: 0;
  width: 58px;
  height: 58px;
  opacity: 0.85;
  color: var(--accent);
}

.hero .eyebrow {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.25;
  margin: 0 0 20px;
}

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

.hero p.lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0;
  line-height: 1.75;
}

.hero .cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quill-divider {
  display: flex;
  justify-content: center;
  padding: 4px 0 30px;
  color: var(--accent);
  opacity: 0.7;
}

.btn {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.92rem;
  padding: 10px 22px;
  border-radius: 2px;
  border: 1.5px solid var(--text);
  background: transparent;
  color: var(--text) !important;
}

.btn:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg) !important;
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted) !important;
}

.btn.ghost:hover {
  background: var(--bg);
  border-color: var(--text);
  color: var(--text) !important;
}

/* ---------- Pull quote (home page accent block) ---------- */

.pull-quote {
  margin: 0;
  padding: 6px 20px;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1;
}

.pull-quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent-dark);
  margin: 0;
  line-height: 1.25;
}

.pull-quote .attribution {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-family: var(--sans);
  font-style: normal;
  margin: 2px 0 0;
  line-height: 1.25;
  text-align: right;
}

/* ---------- Section blocks ---------- */

.section {
  margin-top: 60px;
}

/* No gap directly under the home page hero/pull-quote */
.home-section-first {
  margin-top: 24px;
}

.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2::before,
.section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Cards (blog + apps) ---------- */

.card-grid {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 22px 24px;
  position: relative;
  box-shadow: 1px 2px 4px rgba(43, 32, 24, 0.08);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* dog-eared corner */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, transparent 50%, var(--border) 50%);
  box-shadow: -1px 1px 2px rgba(43, 32, 24, 0.15);
}

.card-image {
  margin: -22px -24px 16px;
  overflow: hidden;
}

.card-image img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: top;
}

.card .meta {
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--accent-dark);
  margin: 0 0 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.card .meta .status {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-style: normal;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.card h3 a {
  color: var(--text);
}

.card h3 a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.card p {
  margin: 0 0 12px;
  color: var(--text-muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--sans);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.card .card-links {
  margin-top: 14px;
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
}

/* ---------- Blog post page ---------- */

.post-meta {
  font-family: var(--sans);
  font-style: italic;
  color: var(--accent-dark);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.post-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin-top: 36px;
}

.post-body p {
  margin: 0 0 16px;
}

.post-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.86rem;
}

.post-body code:not(pre code) {
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 8px 0 24px;
}

.back-link {
  font-size: 0.92rem;
  display: inline-block;
  margin-bottom: 26px;
}

.not-found {
  color: var(--text-muted);
  font-style: italic;
}

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

footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  font-style: italic;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }
  .nav-menu {
    right: 12px;
    width: 50vw;
  }
}
