/* ============================================================
   1883 — frontier / aged-parchment theme
   Day = sun-bleached land deed.  Night = lantern on the prairie.
   ============================================================ */
:root {
  --font-display: "Rye", "Playfair Display", serif;   /* the name, the brand */
  --font-head: "Playfair Display", Georgia, serif;     /* section + card titles */
  --font-body: "EB Garamond", Georgia, serif;          /* prose */
  --font-type: "Special Elite", "Courier New", monospace; /* stamped/typed bits */

  --accent: #9c3d1c;        /* dried-blood rust */
  --accent-2: #8a6d22;      /* faded brass / sun-gold */
  --bg: #e7dcc1;            /* aged parchment */
  --bg-soft: #ddcfae;       /* deeper dust */
  --card: #f2e8cf;          /* fresh ledger paper */
  --border: #bda377;        /* worn leather edge */
  --text: #2a1f12;          /* iron-gall ink */
  --text-soft: #6a563b;     /* faded ink */
  --shadow: 0 1px 2px rgba(58, 40, 18, 0.10), 0 10px 26px rgba(58, 40, 18, 0.14);
  --radius: 6px;
  --maxw: 940px;
}

[data-theme="dark"] {
  --accent: #cf6a30;        /* lantern flame */
  --accent-2: #c7a04a;      /* brass glow */
  --bg: #181208;            /* night camp */
  --bg-soft: #211910;
  --card: #241b0f;
  --border: #4a3a20;
  --text: #ece0c4;          /* firelight on canvas */
  --text-soft: #b09b73;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  position: relative;
  font-family: var(--font-body);
  font-size: 1.12rem;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

/* Paper grain + corner vignette laid over everything */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(120% 120% at 50% 0%, transparent 55%, rgba(40, 26, 8, 0.16) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.6; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 3px double var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; position: relative; z-index: 2; }
.brand { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent); letter-spacing: 0.02em; }
.brand-dot { color: var(--text); }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-family: var(--font-type); color: var(--text-soft); font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.06em; transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.theme-toggle {
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1rem;
  display: grid; place-items: center; transition: border-color 0.2s, transform 0.3s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(180deg); }

/* ---------- Hero ---------- */
.hero { padding: 92px 24px 64px; text-align: center; }
.eyebrow {
  display: inline-block; font-family: var(--font-type); font-size: 0.78rem;
  color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 7px 16px; margin-bottom: 26px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.8rem); letter-spacing: 0.01em;
  line-height: 1.05; margin-bottom: 22px; color: var(--text);
  text-shadow: 1px 1px 0 color-mix(in srgb, var(--accent) 22%, transparent);
}
.tagline {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--text-soft);
  max-width: 620px; margin: 0 auto; font-style: italic;
}
.accent {
  color: var(--accent); font-weight: 600; font-style: normal;
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 34px 0 26px; }

.btn {
  display: inline-block; padding: 12px 26px; border-radius: var(--radius); font-weight: 600;
  font-family: var(--font-type); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s, color 0.2s;
}
.btn-primary {
  color: #f6ecd2; background: linear-gradient(160deg, var(--accent), #6f2a12);
  border: 1px solid #5d2410;
  box-shadow: 0 4px 0 #5d2410, var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #5d2410, var(--shadow); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.socials { list-style: none; display: flex; gap: 24px; justify-content: center; }
.socials a {
  font-family: var(--font-type); color: var(--text-soft); font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.06em; position: relative;
}
.socials a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 0;
  background: var(--accent); transition: width 0.25s ease;
}
.socials a:hover { color: var(--accent); }
.socials a:hover::after { width: 100%; }

/* ---------- Sections ---------- */
.section { padding: 60px 24px; }
.section-title {
  font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--text);
  margin-bottom: 34px; padding-bottom: 12px; border-bottom: 3px double var(--border);
  display: flex; align-items: baseline; gap: 14px;
}
.section-title .num {
  font-family: var(--font-type); font-size: 0.9rem; color: var(--accent); font-weight: 400;
}
.section-title::after {
  content: "✦"; margin-left: auto; color: var(--accent); font-size: 1rem; align-self: center;
}
.lead { font-size: 1.18rem; color: var(--text-soft); max-width: 700px; }
.lead em { color: var(--text); font-style: italic; }

/* ---------- Skills ---------- */
.skills {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-top: 32px;
}
.skill-group {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.skill-group h3 {
  font-family: var(--font-type); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 12px;
}
.skill-group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group li {
  font-family: var(--font-type); font-size: 0.78rem; background: var(--card);
  border: 1px solid var(--border); padding: 4px 11px; border-radius: var(--radius);
}

/* ---------- Timeline (experience / education) ---------- */
.timeline { display: flex; flex-direction: column; gap: 26px; }
.job { border-left: 2px solid var(--border); padding-left: 24px; position: relative; }
.job::before {
  content: "✦"; position: absolute; left: -10px; top: 2px; color: var(--accent);
  background: var(--bg); line-height: 1; font-size: 1rem;
}
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 8px; }
.job-head h3 { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.company { font-family: var(--font-type); font-size: 0.85rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.period { font-family: var(--font-type); font-size: 0.78rem; color: var(--text-soft); margin-left: auto; }
.job ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.job ul li { color: var(--text-soft); position: relative; padding-left: 20px; }
.job ul li::before { content: "✧"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Project cards (ledger pages) ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card::after {
  content: ""; position: absolute; inset: 5px; border: 1px solid var(--border);
  border-radius: 3px; opacity: 0.5; pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-top h3 { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; }
.card-link { flex-shrink: 0; color: var(--text-soft); font-size: 1.3rem; line-height: 1; transition: color 0.2s, transform 0.2s; }
.card-link:hover { color: var(--accent); transform: translate(2px, -2px); }
.card > p { color: var(--text-soft); margin-bottom: 14px; }
.live-demo { margin-top: -6px; }
.live-demo a {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-type); font-size: 0.8rem; letter-spacing: 0.04em;
  color: var(--accent-2); transition: opacity 0.2s;
}
.live-demo a:hover { opacity: 0.75; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 70%, transparent);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 70%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.card-points { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 14px 0 16px; }
.card-points li { color: var(--text-soft); font-size: 1.02rem; position: relative; padding-left: 20px; }
.card-points li::before { content: "✧"; position: absolute; left: 0; color: var(--accent); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-family: var(--font-type); font-size: 0.72rem; color: var(--accent);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: 0.03em;
}

/* ---------- Contact ---------- */
.contact .lead { margin-bottom: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center; color: var(--text-soft); font-family: var(--font-type);
  font-size: 0.78rem; letter-spacing: 0.04em;
  padding: 40px 24px; border-top: 3px double var(--border); margin-top: 40px;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .live-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding-top: 60px; }
  .period { margin-left: 0; }
  .section-title::after { display: none; }
}
