/* ===========================================
   Logan Brandall - Personal Site
   Modern, sleek, black + green
   Light/dark theme via [data-theme]
   =========================================== */

:root, [data-theme="light"] {
  --bg: #FAFAFA;
  --bg-alt: #F2F2F0;
  --bg-deep: #E8E8E5;
  --text: #0A0A0A;
  --text-soft: #3D3D3D;
  --text-muted: #7A7A7A;
  --accent: #1F7A4D;
  --accent-soft: #2E9460;
  --accent-deep: #155A38;
  --line: rgba(10, 10, 10, 0.08);
  --line-strong: rgba(10, 10, 10, 0.18);
  --orb: rgba(31, 122, 77, 0.16);
  --orb-2: rgba(46, 148, 96, 0.12);
  --code-bg: #1A1A1A;
  --code-text: #ECECEC;
  --shadow: 0 12px 28px -10px rgba(10, 10, 10, 0.18);
}

[data-theme="dark"] {
  --bg: #0B0B0E;
  --bg-alt: #131318;
  --bg-deep: #1B1B22;
  --text: #ECECEC;
  --text-soft: #B5B5B5;
  --text-muted: #707070;
  --accent: #34D399;
  --accent-soft: #4ADE80;
  --accent-deep: #10B981;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --orb: rgba(52, 211, 153, 0.18);
  --orb-2: rgba(16, 185, 129, 0.12);
  --code-bg: #1B1B22;
  --code-text: #ECECEC;
  --shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6);
}

:root {
  --display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out);
}

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

a { color: var(--accent); text-decoration: none; transition: color .25s var(--ease-out); }
a:hover { color: var(--accent-deep); }

::selection { background: var(--accent); color: var(--bg); }

/* Typography - all sans, no italics */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
}
h1 { font-size: clamp(2.6rem, 6.5vw, 5.75rem); font-weight: 700; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; }

p { color: var(--text-soft); }
p + p { margin-top: 1.1em; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}

/* Layout */
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

section { padding: clamp(4rem, 10vw, 8rem) 0; position: relative; }

/* ========== NAVIGATION ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease-out), padding .35s var(--ease-out), background-color .35s var(--ease-out);
}
.nav.scrolled { border-bottom-color: var(--line); padding-top: 0.85rem; padding-bottom: 0.85rem; }

.nav-brand {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-brand:hover { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 1.5rem; }

.nav-links { display: flex; gap: 1.85rem; list-style: none; align-items: center; }
.nav-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .3s var(--ease-out);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all .25s var(--ease-out);
  padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* "Try dark mode!" hint - only shows on first visit */
.theme-toggle-wrap { position: relative; display: inline-flex; }
.theme-hint {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
  z-index: 99;
}
.theme-hint .hint-arrow {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
}
.theme-hint .hint-text {
  background: var(--accent);
  color: #FFFFFF;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 50%, transparent);
}
[data-theme="dark"] .theme-hint .hint-text { color: #0A0A0A; }
.theme-hint.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  animation: hint-bounce 1.4s ease-in-out infinite;
}
@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-hint.show { animation: none; }
}
@media (max-width: 760px) {
  .theme-hint .hint-text { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
}

.nav-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; color: var(--text); cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed; inset: 0;
    background: var(--bg);
    flex-direction: column; justify-content: center; align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform .4s var(--ease-out);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { font-size: 1.4rem; }
  .nav-toggle { display: block; z-index: 101; }
}

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: 6rem; padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-content { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(3rem, 8.5vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 1.25rem 0 2rem;
  font-weight: 700;
}
.hero-title .accent { color: var(--accent); }
.hero-lede {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  max-width: 560px;
  color: var(--text-soft);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* Scroll indicator */
.scroll-cue {
  position: absolute; bottom: 2.5rem; left: var(--gutter);
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.scroll-cue .line {
  width: 40px; height: 1.5px; background: var(--text-muted); position: relative; overflow: hidden;
}
.scroll-cue .line::after {
  content: ""; position: absolute; left: -100%; top: 0;
  width: 100%; height: 100%; background: var(--accent);
  animation: scroll-cue 2.4s infinite var(--ease-in-out);
}
@keyframes scroll-cue { 0% { left: -100%; } 60%, 100% { left: 100%; } }

/* Decorative orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.65;
  z-index: 1;
  pointer-events: none;
}
.hero-orb.one { width: 420px; height: 420px; background: var(--orb); top: 8%; right: -90px; }
.hero-orb.two { width: 300px; height: 300px; background: var(--orb-2); bottom: 8%; left: 20%; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.92rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.92rem; font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  cursor: pointer; border: 1px solid transparent;
  transition: all .25s var(--ease-out);
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
[data-theme="dark"] .btn-primary { color: #0A0A0A; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 55%, transparent); color: #FFFFFF; }
[data-theme="dark"] .btn-primary:hover { color: #0A0A0A; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn .arrow { display: inline-block; transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-row { display: flex; gap: 0.85rem; flex-wrap: wrap; }

/* ========== SECTION HEADERS ========== */
.section-head { margin-bottom: 3.5rem; max-width: 720px; }
.section-head h2 { margin-top: 1rem; }
.section-head p { margin-top: 1.1rem; font-size: 1.05rem; }

/* ========== CARDS / GRID ========== */
.grid { display: grid; gap: 1.75rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.85rem;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s var(--ease-out), background-color .35s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-tag { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.card h3 { margin: 0.7rem 0 0.55rem; }
.card p { font-size: 0.94rem; }
.card-meta { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--text-muted); margin-top: 1.1rem; font-weight: 500; }

/* Featured / list block on home */
.feature-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr auto;
  align-items: baseline;
  gap: 2rem;
  padding: 1.65rem 0;
  border-top: 1px solid var(--line);
  transition: padding .35s var(--ease-out), background-color .35s var(--ease-out);
}
.feature-row:last-child { border-bottom: 1px solid var(--line); }
.feature-row:hover { padding-left: 1rem; }
.feature-row .meta { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.feature-row h3 { font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
.feature-row .arrow { color: var(--accent); transition: transform .35s var(--ease-out); font-size: 1.1rem; }
.feature-row:hover .arrow { transform: translate(6px, -6px); }
.feature-row a, a.feature-row { color: inherit; }
a.feature-row:hover h3 { color: var(--accent); }

@media (max-width: 720px) {
  .feature-row { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ========== ABOUT BLOCK / SPLIT ========== */
.split {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split .label { position: sticky; top: 100px; }
.split .label h2 { margin-top: 1rem; }

/* ========== STATS / NUMBERS ========== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; padding: 3rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat .num { font-family: var(--display); font-size: clamp(2.4rem, 4vw, 3.4rem); color: var(--accent); line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.stat .lbl { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.6rem; font-weight: 600; }

/* ========== FOOTER ========== */
.footer {
  border-top: 1px solid var(--line);
  padding: 3rem var(--gutter) 2rem;
  background: var(--bg-alt);
}
.footer-inner { max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; }
.footer-brand { font-family: var(--display); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; list-style: none; }
.footer-links a { color: var(--text-soft); font-size: 0.9rem; }
.footer-bottom { max-width: var(--max); margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); align-items: center; }
.footer-signin {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  transition: all .25s var(--ease-out);
  letter-spacing: 0.05em;
}
.footer-signin:hover { color: var(--accent); border-color: var(--accent); }

/* ========== ARTICLE / POST ========== */
.article { padding-top: 8rem; padding-bottom: 6rem; }
.article-head { max-width: 760px; margin: 0 auto 3.5rem; padding: 0 var(--gutter); text-align: center; }
.article-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 1.25rem 0; }
.article-meta { font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.article-body { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); font-size: 1.07rem; line-height: 1.8; }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote, .article-body pre, .article-body figure { margin-bottom: 1.4rem; }
.article-body h2 { margin: 2.8rem 0 1rem; font-size: 1.7rem; }
.article-body h3 { margin: 2.2rem 0 0.75rem; font-size: 1.3rem; }
.article-body blockquote { border-left: 3px solid var(--accent); padding: 0.4rem 1.5rem; color: var(--text-soft); }
.article-body code { background: var(--bg-deep); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; font-family: var(--mono); }
.article-body pre { background: var(--code-bg); color: var(--code-text); padding: 1.4rem; border-radius: 8px; overflow-x: auto; font-size: 0.88em; font-family: var(--mono); }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ========== RESUME ========== */
.resume-section { margin-bottom: 3rem; }
.resume-section h3 {
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 1.5rem;
}
.resume-item { padding: 1.25rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 180px 1fr; gap: 2rem; }
.resume-item:last-child { border-bottom: none; }
.resume-item .when { font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.06em; font-weight: 600; text-transform: uppercase; }
.resume-item h4 { font-family: var(--display); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.25rem; letter-spacing: -0.01em; }
.resume-item .where { color: var(--accent); font-size: 0.92rem; margin-bottom: 0.5rem; font-weight: 500; }
.resume-item p { font-size: 0.94rem; }
@media (max-width: 720px) { .resume-item { grid-template-columns: 1fr; gap: 0.5rem; } }

.skills-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.skill-pill { padding: 0.4rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 0.82rem; color: var(--text-soft); font-weight: 500; transition: border-color .25s var(--ease-out), color .25s var(--ease-out); }
.skill-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ========== ANIMATIONS ========== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

.split-reveal { overflow: hidden; display: inline-block; }
.split-reveal > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease-out); }
.split-reveal.in > span { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .split-reveal > span { transform: none; }
  html { scroll-behavior: auto; }
  .scroll-cue .line::after { animation: none; }
}

/* Prevent flash of unstyled theme */
html { background: var(--bg); }

/* ========== UTILITY ========== */
.divider { height: 1px; background: var(--line); margin: 4rem 0; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Print (resume) */
@media print {
  .nav, .footer, .hero, .scroll-cue, .btn-row, .theme-toggle { display: none !important; }
  body { background: white; color: black; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
