/* ----------------------------------------------------------------------------
   Robert Connely IV — robertconnely.com
   White-background variant inspired by melboucierayane.com.
   Typography: Geist + Geist Mono.
---------------------------------------------------------------------------- */

:root {
  --bg:        #ffffff;
  --bg-soft:   #fafafa;
  --ink:       #0a0a0a;
  --ink-2:     #2a2a2a;
  --muted:     #6b6b6b;
  --muted-2:   #a1a1a1;
  --rule:      #ececec;
  --rule-soft: #f4f4f4;
  --header-bg: rgba(255, 255, 255, 0.35);

  --accent:    #c2410c;   /* warm orange — synapse glow */
  --accent-2:  #2563eb;   /* electric blue */
  --accent-3:  #7c3aed;   /* deep violet */

  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

[data-theme="dark"] {
  --bg:        #0a0a0a;
  --bg-soft:   #121212;
  --ink:       #f5f5f5;
  --ink-2:     #d4d4d4;
  --muted:     #888888;
  --muted-2:   #555555;
  --rule:      #1f1f1f;
  --rule-soft: #161616;
  --header-bg: rgba(10, 10, 10, 0.3);

  --accent:    #60a5fa;   /* electric blue — holds up on black */
  --accent-2:  #38bdf8;   /* sky */
  --accent-3:  #a78bfa;
}

html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  font-size: 16px;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--pad);
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.counter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.counter #synapse-count {
  color: var(--accent);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.site-nav a:hover { color: var(--ink); }
.site-nav .cta {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.site-nav .cta:hover { background: var(--ink); color: var(--bg); }

.theme-toggle {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); transform: rotate(15deg); }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }

@media (max-width: 720px) {
  .counter { display: none; }
  .site-nav { gap: 1rem; }
  .site-nav a:not(.cta) { display: none; }
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: 100vh;
  padding: 6rem var(--pad) 4rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brain-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

#brain {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 1rem;
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: lowercase;
  margin: 0 0 1.25rem;
}

.display {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2.2rem, 6.5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.75rem;
  color: var(--ink);
}

.lede {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin: 0 0 .35rem;
}

.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}
.meta .sep { color: var(--muted-2); margin: 0 .4rem; }

.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-2);
  transition: color .2s ease;
}
.scroll-cue:hover { color: var(--ink-2); }

.scroll-mouse .wheel {
  transform-origin: 11px 10px;
  animation: wheelSlide 1.8s ease-in-out infinite;
}
@keyframes wheelSlide {
  0%   { transform: translateY(-3px); opacity: 0; }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(6px); opacity: 0; }
}

.scroll-chevrons {
  animation: chevNudge 1.8s ease-in-out infinite;
}
@keyframes chevNudge {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(3px); opacity: 1; }
}

/* ---------------------------------------------------------------- sections */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 6rem var(--pad);
  border-top: 1px solid var(--rule);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}
.section-head .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}
.section-head h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---------------------------------------------------------------- experience */

.exp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3.5rem;
}

.exp-group { display: grid; gap: 1rem; }

.exp-company {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
  color: var(--ink);
}
.exp-company .exp-loc { color: var(--muted-2); font-weight: 400; }

.exp-role {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.5rem;
}
.exp-title {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.exp-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.exp-body {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 64ch;
  margin: 0;
}

/* ---------------------------------------------------------------- philosophy */

.phil-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.phil-list li {
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-soft);
  display: grid;
  gap: 0.75rem;
}
.phil-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.phil-list h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.phil-list p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- work */

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem;
}
.work-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-soft);
}
.work-item:first-child { border-top: 0; padding-top: 0; }

.work-meta {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}
.work-num {
  font-family: var(--mono);
  font-size: 28px;
  color: var(--muted-2);
  font-weight: 300;
}
.work-code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.work-body h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}
.work-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 1rem;
}
.work-body p {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 0.75rem;
}
.work-stack {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.5rem;
}

.work-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 0.1rem;
  transition: color .2s ease, border-color .2s ease;
}
.work-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.work-link::after {
  content: " ↗";
  font-size: 11px;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .work-item { grid-template-columns: 1fr; gap: 0.75rem; }
  .work-num  { font-size: 22px; }
}

/* ---------------------------------------------------------------- stack */

.stack-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem 2rem;
}

.stack-group { display: grid; gap: 1rem; align-content: start; }

.stack-group-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
}

.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
.stack-list li {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.stack-list li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------------------------------------------------------- signal */

.signal { padding-bottom: 4rem; }

.signal-lede {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 38ch;
  margin: 0 0 2rem;
}

.signal-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 14px;
}
.signal-links a { color: var(--ink-2); border-bottom: 1px solid var(--rule); padding-bottom: 0.15rem; }
.signal-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-top: 1px solid var(--rule-soft);
}

@media (max-width: 600px) {
  .site-footer { flex-direction: column; gap: 0.5rem; }
}

/* ---------------------------------------------------------------- a11y */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
