:root {
  --bg: #0a0d10;
  --panel: #0f1318;
  --text: #e6f0ff;
  --muted: #9fb3c8;
  --accent: #46d4ff;      /* electric cyan */
  --accent-dim: #1fa3d1;
  --ring: rgba(70,212,255,0.35);
  --border: #1b232c;
  --card: #0d1116;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 60px rgba(70,212,255,0.05);
}
* { box-sizing: border-box }
html,body { height:100% }
body {
  margin:0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text); background: radial-gradient(1200px 600px at 50% -10%, #12202b 0%, transparent 60%), var(--bg);
  letter-spacing: 0.1px;
  position: relative;
}
.stars-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 0; background: transparent }
.container { width:min(1100px, 100vw); margin-inline:auto }
header { padding: 48px 0 24px; position: sticky; top: 0; backdrop-filter: blur(8px); background: linear-gradient(to bottom, rgba(10,13,16,.9), rgba(10,13,16,.6) 60%, transparent); z-index: 100; }
.brand { display:flex; align-items:center; gap: 14px; }
.brand h1 {
  margin: 0;
  font-size: clamp(64px, 10vw, 160px);
  font-family: "lindsey-signature", sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: .5px;
  line-height: 1.05;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(70,212,255,0.25), 0 0 24px rgba(70,212,255,0.15);
  animation: pulseGlow 4s ease-in-out infinite;
}
/* terminal-style typewriter next to the brand */
.brand-terminal {
  margin-left: auto;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0; border-radius: 0;
  min-width: clamp(220px, 32vw, 420px);
  min-height: clamp(56px, 10vw, 120px);
  background: transparent;
  color: #ffffff; font-family: "Courier New", Courier, monospace; font-size: clamp(14px, 1.5vw, 22px);
  overflow: hidden;
}
.brand-terminal .cursor { display: inline-block; width: 10px; height: 1.2em; margin-left: 4px; background: currentColor; animation: caretBlink 1s steps(1) infinite }
.tagline { color: var(--muted); margin-top: 0; font-weight: 400; letter-spacing: .25px; visibility: hidden; height: 0; line-height: 0; overflow: hidden }
nav { margin-top: 35px; display:grid; gap:14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) }
nav { position: relative; z-index: 101 }
.nav-btn {
  position: relative; display: block; text-align: center;
  background: transparent; color: var(--accent-dim); border: 1px solid var(--border);
  padding: 14px 18px; border-radius: 12px; cursor: pointer;
  font-family: "Courier New", Courier, monospace; font-weight: 400; letter-spacing: .4px; text-decoration: none;
  font-size: clamp(14px, 1.4vw, 18px);
  transition: color 240ms ease, border-color 240ms ease, box-shadow 240ms ease, font-weight 240ms ease;
  overflow: hidden;
}
.nav-btn { touch-action: manipulation }
.nav-btn::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(70,212,255,0) 0%, rgba(70,212,255,.7) 35%, #ffffff 50%, rgba(70,212,255,.7) 65%, rgba(70,212,255,0) 100%);
  transform: translateX(-120%);
  transition: transform var(--nav-sweep-ms, 700ms) ease;
  mix-blend-mode: screen;
}
.nav-btn:hover::before { transform: translateX(120%) }
.nav-btn:hover {
  color: #ffffff; font-weight: 700;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring), inset 0 0 0 1px var(--accent);
  text-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
}
.nav-btn:focus { outline: none; box-shadow: 0 0 0 5px var(--ring), inset 0 0 0 1px var(--accent-dim) }
.hero { padding: 30px 0 10px }
/* --- ticker --- */
.ticker { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); pointer-events: none; position: relative; z-index: 0; margin-top: 18px }
.ticker-track { display: inline-flex; gap: 40px; padding: 10px 0; animation: scroll var(--ticker-speed, 28s) linear infinite; white-space: nowrap; color: var(--muted) }
.ticker-item::before { content: "●"; color: var(--accent); margin-right: 10px }
@keyframes scroll { from { transform: translateX(0) } to { transform: translateX(-50%) } }
@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(70,212,255,0.25), 0 0 24px rgba(70,212,255,0.15); transform: scale(1) }
  50% { text-shadow: 0 0 20px rgba(70,212,255,0.45), 0 0 40px rgba(70,212,255,0.25); transform: scale(1.02) }
}
@keyframes caretBlink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .brand h1 { animation: none } }
@media (max-width: 900px){ .brand-terminal { display:none } }
/* --- gallery --- */
.gallery { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, rgba(31,45,58,.12), rgba(17,23,29,.12)), var(--card); border: 1px solid var(--border); box-shadow: var(--shadow) }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--gallery-fade-ms, 800ms) ease-in-out }
.gallery img.active { opacity: 1 }
/* --- sections --- */
section { padding: 48px 0 }
.grid { display:grid; gap:18px }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)) }
@media (max-width: 900px){ .grid-3 { grid-template-columns: 1fr } }
.card { background: linear-gradient(180deg, rgba(31,45,58,.12), rgba(17,23,29,.12)), var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; transition: 180ms ease }
.card:hover { transform: translateY(-2px); border-color: var(--accent-dim); box-shadow: 0 10px 35px rgba(0,0,0,0.55), 0 0 0 1px var(--accent-dim) inset }
.stat .value { font-size: 28px; font-weight: 800; color: var(--accent); margin-bottom: 6px }
.stat .subtitle { color: var(--muted) }
.muted { color: var(--muted) }
.cta { display: inline-flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--accent-dim); color: var(--text); text-decoration: none; box-shadow: 0 0 0 4px var(--ring), inset 0 0 0 1px var(--accent-dim); transition: 160ms ease; font-weight: 700 }
.cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 6px var(--ring), inset 0 0 0 1px var(--accent) }
footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted) }
.social { display:flex; gap:16px; flex-wrap: wrap; justify-content: flex-end }
.social a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted transparent; display:inline-flex; align-items:center }
.social a:hover { color: var(--text); border-bottom-color: var(--accent-dim) }
.social img { width: 24px; height: 24px; display:block; opacity:.9; transition: opacity 160ms ease, filter 160ms ease }
.social a:hover img { opacity:1; filter: drop-shadow(0 0 6px var(--accent)) }
/* footer center link */
.footer-center { display:flex; justify-content:center; align-items:center; flex: 0 1 auto }
.footer-link { color: var(--text); text-decoration: none; transition: color 200ms ease, text-shadow 200ms ease }
.footer-link:hover { color: var(--accent); text-shadow: 0 0 6px var(--accent) }
.footer-grid { display:grid; grid-template-columns: 1fr auto 1fr; gap:18px; align-items:center }
.footer-rows { display:grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto; row-gap: 6px; align-items:center }
.footer-rows > #copyright { grid-column: 1; grid-row: 1; justify-self: start }
.footer-rows > #privacyBox { grid-column: 2; grid-row: 1; justify-self: center; align-self: center; display: flex; align-items: center }
.footer-rows > #social { grid-column: 3; grid-row: 1; justify-self: end }
.footer-rows > #poweredBy { grid-column: 2; grid-row: 2; justify-self: center; text-align: center; color: var(--muted) }
.footer-powered a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted transparent }
.footer-powered a:hover { color: var(--text); border-bottom-color: var(--accent-dim) }
/* privacy modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity 180ms ease; z-index: 1000 }
.modal-backdrop.show { opacity: 1; pointer-events: auto }
.modal-panel { position: fixed; left: 50%; top: 55%; transform: translate(-50%, -50%) scale(.98); opacity: 0; width: min(860px, 92vw); max-height: 70vh; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; z-index: 1001; transition: transform 200ms ease, opacity 200ms ease; pointer-events: none }
.modal-backdrop.show + .modal-panel { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto }
.modal-panel h3 { margin: 0 0 8px 0 }
.modal-panel p { margin: 0 0 12px 0; color: var(--muted) }
.modal-actions { display:flex; justify-content:flex-end; gap:12px; margin-top: 8px }
.btn { background: transparent; color: var(--text); border: 1px solid var(--accent-dim); padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: 160ms ease }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring) }
/* subtle grid overlay */
.grid-overlay { position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(1px 1px at 25px 25px, rgba(70,212,255,.12) 0, transparent 1px); background-size: 50px 50px; opacity: .08; mix-blend-mode: screen }
/* --- mobile & tablet adaptations --- */
/* Base touch affordances */
.nav-btn { min-height: 44px; -webkit-tap-highlight-color: transparent }
.nav-btn:active { color: #ffffff; font-weight: 700; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring), inset 0 0 0 1px var(--accent); text-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent) }
@media (pointer: coarse) { .nav-btn:hover::before { transform: translateX(-120%) } }
/* Smartphones portrait up to 430px wide */
@media (max-width: 430px) {
  .container { width: 100vw; padding: 0 12px }
  header { padding: calc(18px + env(safe-area-inset-top)) 0 12px }
  footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)) }
  .brand h1 { font-size: clamp(44px, 12vw, 96px) }
  nav { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px }
  .nav-btn { padding: 12px 14px; font-size: 14px }
  .ticker-track { gap: 24px }
  .ticker { mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent) }
  .gallery { aspect-ratio: 3 / 4 }
  .footer-rows { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; row-gap: 6px; text-align: center }
  .footer-rows > #copyright { grid-column: 1; grid-row: 1; justify-self: center }
  .footer-rows > #poweredBy { grid-column: 1; grid-row: 2; justify-self: center; text-align: center }
  .footer-rows > #social { grid-column: 1; grid-row: 3; justify-self: center }
  .footer-rows > #privacyBox { grid-column: 1; grid-row: 4; justify-self: center; align-self: center }
}
/* Tall/narrow phones */
@media (max-width: 430px) and (min-height: 800px) { .gallery { aspect-ratio: 9 / 16 } }
/* Large phones portrait 431-480px */
@media (min-width: 431px) and (max-width: 480px) and (orientation: portrait) {
  .container { padding: 0 14px }
  .brand h1 { font-size: clamp(52px, 11vw, 110px) }
  nav { grid-template-columns: 1fr }
  .gallery { aspect-ratio: 10 / 16 }
}
/* Landscape compact */
@media (max-height: 450px) and (orientation: landscape) {
  header { position: static; padding: 12px 0 }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
  .gallery { aspect-ratio: 21 / 9 }
  .ticker-track { gap: 22px }
}
/* Tablet portrait 768x1024 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .container { padding: 0 18px }
  .brand h1 { font-size: clamp(64px, 9vw, 130px) }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .gallery { aspect-ratio: 16 / 10 }
}
/* iPad Air/Pro 11 portrait */
@media (min-width: 820px) and (max-width: 1180px) and (orientation: portrait) {
  .brand h1 { font-size: clamp(72px, 8.5vw, 140px) }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}
/* iPad Pro 12.9 / Surface Go portrait */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
  .brand h1 { font-size: clamp(80px, 8vw, 150px) }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)) }
}

/* --- Contact-specific overrides --- */
@media (max-width: 430px) {
  #contactSection { grid-template-columns: 1fr !important; grid-auto-flow: row }
  #calendlyBox { position: static; top: auto; margin-top: 14px }
}
@media (max-width: 430px) and (min-height: 800px) { #calendlyBox { top: 12px } }
@media (max-height: 450px) and (orientation: landscape) { #contactSection { grid-template-columns: 1fr 1fr } }

/* --- About-specific styles --- */
.timeline { margin: 28px 0 24px }
.timeline-line { position: relative; height: 3px; background: var(--accent); border-radius: 999px; box-shadow: 0 0 12px rgba(70,212,255,.45); z-index: 0; margin-top: 5px }
.timeline-items { display:flex; justify-content: space-between; align-items: flex-start; margin-top: -18px }
.timeline-item { display:flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0 }
.timeline-emoji { display:flex; align-items:center; justify-content:center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--accent-dim); background: var(--panel); color: var(--text); cursor: pointer; box-shadow: 0 0 0 4px var(--ring), inset 0 0 0 1px var(--accent-dim); transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease; font-size: 20px; position: relative; z-index: 1 }
.timeline-emoji:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 0 0 6px var(--ring), inset 0 0 0 1px var(--accent) }
.timeline-year { font-size: 14px; color: var(--muted); background: transparent; border: none; cursor: pointer; padding: 0 }
.timeline-details { display: none; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--accent-dim); box-shadow: var(--shadow) }
.timeline-details.show { display: block }
.timeline-details .title { font-weight: 700; color: var(--text); margin-bottom: 6px; display:flex; align-items:center; gap:8px }
.timeline-details .body { color: var(--muted) }
/* timeline mobile controls */
.timeline-mobile { display: none; align-items:center; gap:10px; margin-top: 12px }
.timeline-mobile-current { flex: 1 1 auto; text-align:center; font-family: "Courier New", Courier, monospace; font-weight:700; color: var(--text) }
/* about narrative */
.narrative { margin: 32px 0 28px }
.narrative-buttons { display: grid; gap: 14px; grid-template-columns: repeat(var(--narrative-count, 4), 1fr) }
.narrative-btn { display:flex; align-items:center; justify-content:center; height: calc(52px * var(--narrative-font-scale, 1)); font-size: calc(clamp(14px, 1.4vw, 18px) * var(--narrative-font-scale, 1)) }
.narrative-btn .title { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.narrative-btn:hover .emoji, .narrative-btn:focus .emoji { display: none }
.narrative-btn:hover .title, .narrative-btn:focus .title { display: inline; font-size: 12px }
.narrative-details { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--accent-dim); box-shadow: var(--shadow); overflow: auto }
.narrative-details .title { font-weight: 700; color: var(--text); margin-bottom: 24px; display:flex; align-items:center; gap:8px; font-size: 18px }
.narrative-details .title strong { font-weight: 800 }
.narrative-details .body { color: var(--muted) }
.narrative-details .body p { margin: 0 0 8px }
.narrative-details .body p:last-child { margin-bottom: 0 }
/* narrative mobile controls */
.narrative-mobile { display: none; align-items:center; gap:10px; margin-top: 12px }
.narrative-mobile-current { flex: 1 1 auto; text-align:center; font-family: "Courier New", Courier, monospace; font-weight:700; color: var(--text) }
/* skills row */
.skills { margin: 32px 0 28px }
.skills-grid { display:grid; grid-template-columns: var(--skills-left-fr, 1fr) var(--skills-right-fr, 1fr); gap:18px; align-items:center }
@media (max-width: 900px){ .skills-grid { grid-template-columns: 1fr } }
.skills-left { display:flex; align-items:center; gap:12px; flex-wrap: nowrap }
.skills-label { font-weight: 700; color: var(--text) }
.skills-carousel { display:flex; align-items:center; gap:10px; position: relative }
.skills-view { position: relative; width: clamp(220px, 40vw, 420px); height: 48px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); z-index: 1 }
.skill-item { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: "Courier New", Courier, monospace; font-weight: 700 }
.skill-current { left: 50%; transform: translate(-50%, -50%); font-size: 22px; color: var(--text) }
.skill-prev { left: calc(50% - 140px); opacity: .45; color: var(--muted) }
.skill-next { left: calc(50% + 140px); opacity: .45; color: var(--muted) }
.skills-nav { width: 40px; height: 40px; border-radius: 10px; display:flex; align-items:center; justify-content:center; border: 1px solid var(--accent-dim); background: transparent; color: var(--text); cursor: pointer; transition: 160ms ease; position: relative; z-index: 2 }
.skills-nav:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring) }
.skills-right { display:flex; justify-content:flex-end; gap: 12px; flex-wrap: wrap }
.skills-right.single .nav-btn { flex: 1 1 100%; width: 100%; text-align: center }
/* heartbeat row */
.heartbeat { margin: 24px 0 12px }
.heartbeat-canvas { display:block; width: 100%; height: 64px; background: transparent; border: none }
/* About spacing tweaks */
#aboutTimeline { padding-top: 16px; padding-bottom: 12px }
#aboutNarrative { padding-top: 12px; padding-bottom: 12px }
#aboutNarrative.narrative { margin: 16px 0 16px }
#aboutNarrative .narrative-details { margin-top: 10px }
#heartbeat { margin: 12px 0; padding: 0 }
#aboutSkills { padding-top: 12px; padding-bottom: 12px }
#aboutSkills.skills { margin: 16px 0 16px }
/* About mobile & tablet adaptations */
@media (max-width: 430px) {
  .timeline-items { display: none }
  .timeline-mobile { display: flex }
  .narrative-buttons { grid-template-columns: repeat(var(--narrative-count, 4), 1fr) }
  .narrative-buttons { display: none }
  .narrative-mobile { display: flex }
  .skills-grid { grid-template-columns: 1fr }
  .skills-left { flex-direction: column; align-items: center }
  .skills-label { width: 100%; text-align: center; margin-bottom: 8px }
  .skills-carousel { justify-content: center }
  .skills-right { justify-content: center }
  .skills-right .nav-btn { width: 100%; max-width: 420px; white-space: normal }
}
@media (max-height: 450px) and (orientation: landscape) {
  header { position: static; padding: 12px 0 }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
}
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .container { padding: 0 18px }
  .brand h1 { font-size: clamp(64px, 9vw, 130px) }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}
@media (min-width: 820px) and (max-width: 1180px) and (orientation: portrait) {
  .brand h1 { font-size: clamp(72px, 8.5vw, 140px) }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
  .brand h1 { font-size: clamp(80px, 8vw, 150px) }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)) }
}


