/* ============================================================
   logansmith.us — dark security/tech theme
   System fonts only (no external CDNs). Built for speed + privacy.
   ============================================================ */

:root {
  --bg: #0a0e14;
  --bg-soft: #0e131c;
  --surface: #11161f;
  --surface-2: #151c27;
  --border: #1e2733;
  --border-soft: #18212d;
  --text: #e6edf3;
  --muted: #8b98a5;
  --muted-2: #5b6672;
  --accent: #2dd4bf;
  --accent-2: #22d3ee;
  --accent-3: #7c3aed;
  --danger: #f43f5e;
  --maxw: 1080px;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --header-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

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

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
::selection { background: rgba(45,212,191,.25); }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }

/* ---------- Mono section label ---------- */
.label {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: .6rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.label::before { content: "//"; color: var(--muted-2); }

h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
section h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: 1rem; }
.muted { color: var(--muted); }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 100;
  display: flex; align-items: center;
  background: rgba(10,14,20,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: .02em; color: var(--text); }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--mono); font-size: .95rem; }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); list-style: none; }
.nav-links a { color: var(--muted); font-size: .92rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { color: var(--accent) !important; border: 1px solid var(--border); padding: .4rem .9rem; border-radius: 999px; }
.nav-cta:hover { border-color: var(--accent); background: rgba(45,212,191,.08); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: .4rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg::before { /* grid */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(45,212,191,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(45,212,191,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 35%, transparent 78%);
}
.hero-bg::after { /* glow */
  content: ""; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; max-width: 120vw;
  background: radial-gradient(circle at 50% 40%, rgba(45,212,191,.16), rgba(124,58,237,.08) 45%, transparent 70%);
  filter: blur(10px);
}
.hero .container { position: relative; z-index: 1; }
.hero-kicker { font-family: var(--mono); color: var(--accent); font-size: .9rem; margin-bottom: 1rem; }
.hero-kicker .blink { color: var(--accent-2); animation: blink 1.1s steps(1) infinite; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); margin-bottom: .5rem; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.typed-wrap { font-size: clamp(1.1rem, 3.4vw, 1.7rem); font-weight: 600; color: var(--text); min-height: 1.6em; }
.typed { color: var(--accent); }
.cursor { display: inline-block; width: .6ch; color: var(--accent-2); animation: blink 1.1s steps(1) infinite; }
.hero p.lead { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.18rem); max-width: 58ch; margin: 1.2rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; padding: .7rem 1.3rem; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; transition: all .18s ease; }
.btn-primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #04130f; border-color: transparent; }
.btn-primary:hover { color: #04130f; transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(45,212,191,.5); }
.btn-ghost { color: var(--text); background: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: rgba(45,212,191,.06); }

/* ---------- Sections ---------- */
section { padding: clamp(3.5rem, 9vw, 6rem) 0; position: relative; }
.section-soft { background: var(--bg-soft); border-block: 1px solid var(--border-soft); }
.lead-2 { color: var(--muted); max-width: 62ch; }

/* About */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: start; }
.headshot { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.headshot img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.headshot::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(45,212,191,.25); border-radius: 18px; pointer-events: none; }
.about-body p + p { margin-top: 1rem; }
.facts { list-style: none; margin-top: 1.5rem; display: grid; gap: .55rem; }
.facts li { display: flex; gap: .7rem; align-items: baseline; font-size: .95rem; }
.facts .k { font-family: var(--mono); color: var(--accent); font-size: .82rem; min-width: 92px; }

/* Skills */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-top: 1.8rem; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; transition: transform .18s ease, border-color .18s ease; }
.skill-card:hover { transform: translateY(-3px); border-color: rgba(45,212,191,.4); }
.skill-card h3 { font-size: 1.05rem; margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; }
.skill-card h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { font-family: var(--mono); font-size: .78rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .28rem .6rem; }

/* Timeline */
.timeline { margin-top: 1.8rem; border-left: 1px solid var(--border); padding-left: 1.6rem; display: grid; gap: 1.8rem; }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: calc(-1.6rem - 5px); top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(45,212,191,.12); }
.tl-when { font-family: var(--mono); font-size: .8rem; color: var(--muted-2); }
.tl-role { font-weight: 700; font-size: 1.1rem; }
.tl-org { color: var(--accent); font-weight: 600; }

/* Work cards */
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 1.8rem; }
.work-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, border-color .18s ease; }
.work-card:hover { transform: translateY(-4px); border-color: rgba(45,212,191,.4); }
.work-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.work-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-card .body { padding: 1.3rem; }
.work-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.work-card p { color: var(--muted); font-size: .92rem; }
.work-tag { font-family: var(--mono); font-size: .72rem; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }

/* Blog teaser / list */
.post-list { display: grid; gap: 1rem; margin-top: 1.8rem; }
.post-item { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.5rem; transition: transform .16s ease, border-color .16s ease; }
.post-item:hover { transform: translateX(4px); border-color: rgba(45,212,191,.4); }
.post-item .date { font-family: var(--mono); font-size: .78rem; color: var(--muted-2); }
.post-item h3 { color: var(--text); font-size: 1.2rem; margin: .3rem 0 .4rem; }
.post-item p { color: var(--muted); font-size: .92rem; }
.post-item .more { color: var(--accent); font-family: var(--mono); font-size: .82rem; margin-top: .7rem; display: inline-block; }

/* Contact */
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); margin-top: 1.8rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.contact-actions .btn { font-family: var(--mono); font-size: .88rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0; color: var(--muted-2); font-size: .85rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); font-family: var(--mono); font-size: .82rem; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Article (blog post + blog index) ---------- */
.page-top { padding-top: calc(var(--header-h) + 3rem); }
.article { max-width: 760px; }
.article .meta { font-family: var(--mono); font-size: .82rem; color: var(--muted-2); margin-bottom: .6rem; }
.article h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-bottom: 1.2rem; }
.article h2 { font-size: 1.4rem; margin: 2rem 0 .8rem; }
.article p { color: #cdd6df; margin-bottom: 1rem; }
.article ul, .article ol { color: #cdd6df; margin: 0 0 1rem 1.3rem; display: grid; gap: .4rem; }
.article code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); padding: .12rem .4rem; border-radius: 6px; color: var(--accent-2); }
.article pre { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.2rem; overflow-x: auto; margin: 0 0 1.2rem; }
.article pre code { background: none; border: 0; padding: 0; color: #cdd6df; }
.article blockquote { border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.1rem; color: var(--muted); margin: 0 0 1.2rem; }
.back-link { font-family: var(--mono); font-size: .85rem; color: var(--muted); display: inline-block; margin-bottom: 1.6rem; }
.back-link:hover { color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Animations ---------- */
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: rgba(10,14,20,.97); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: .5rem 0; transform: translateY(-130%); transition: transform .28s ease; }
  .nav-links.open { transform: none; }
  .nav-links li { border-top: 1px solid var(--border-soft); }
  .nav-links a { display: block; padding: .9rem clamp(1.1rem,4vw,2rem); }
  .nav-cta { border: 0 !important; border-radius: 0; }
  .nav-toggle { display: inline-flex; }
  .about-grid { grid-template-columns: 1fr; }
  .headshot { max-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cursor, .blink { animation: none !important; }
}
