/* ---------------------------------------------------------------------------
   Jonathan Stansbury — personal projects showcase
   Apple-inspired: bright, bold, colorful. Big type, deep whitespace,
   vivid gradients, blue pill buttons.
--------------------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-subtle: #f5f5f7;       /* Apple's signature light gray */
  --bg-elev: #ffffff;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --muted: #86868b;
  --border: #e6e6ea;
  --border-strong: #d2d2d7;
  --blue: #0071e3;            /* Apple blue, primary actions */
  --blue-hover: #0077ed;
  --grad: linear-gradient(90deg, #ff2d55 0%, #ff9500 22%, #ffcc00 40%, #34c759 58%, #007aff 78%, #af52de 100%);
  --grad-soft: linear-gradient(120deg, #ff5e8a, #ff9500, #34c759, #0a84ff, #bf5af2);
  --tag-bg: #f0f0f3;
  --tag-text: #1d1d1f;
  --radius: 22px;
  --radius-lg: 30px;
  --radius-sm: 12px;
  --maxw: 1040px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-subtle: #101012;
  --bg-elev: #16161a;
  --text: #f5f5f7;
  --text-soft: #a1a1a6;
  --muted: #86868b;
  --border: #29292e;
  --border-strong: #3a3a40;
  --blue: #0a84ff;
  --blue-hover: #409cff;
  --tag-bg: #1c1c1f;
  --tag-text: #f5f5f7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  transition: opacity 0.2s ease;
}
.brand:hover { opacity: 0.6; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover { color: var(--text); background: var(--bg-subtle); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding-top: clamp(80px, 14vw, 168px);
  padding-bottom: clamp(64px, 10vw, 120px);
  max-width: 900px;
}
/* bright colorful glow behind the hero */
.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  height: 460px;
  background: var(--grad-soft);
  filter: blur(90px);
  opacity: 0.28;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
[data-theme="dark"] .hero::before { opacity: 0.42; }

.eyebrow {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(1.9rem, 8.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 auto 22px;
  white-space: nowrap;
}
.hero-title {
  color: var(--text);
}
.lede {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-soft);
  max-width: 30ch;
  margin: 0 auto 34px;
  letter-spacing: -0.015em;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--blue) 30%, transparent);
}
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 10px 28px color-mix(in srgb, var(--blue) 38%, transparent); }
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--text); background: transparent; }

/* ---- Sections ---- */
.section {
  padding-block: clamp(64px, 10vw, 128px);
}
.section-head { margin-bottom: 52px; text-align: center; }
.section-head h2 {
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}
.section-sub { color: var(--muted); margin: 0; font-size: 1.15rem; font-weight: 500; }

/* ---- Featured project ---- */
.project-featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4.5vw, 60px);
}
.project-info .eyebrow { text-align: left; margin-bottom: 10px; font-size: 0.92rem; }
.project-info h3 {
  font-weight: 800;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: -0.035em;
  margin: 0 0 16px;
}
.project-desc { color: var(--text-soft); margin: 0 0 24px; font-size: 1.08rem; font-weight: 450; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  gap: 12px;
}
.feature-list li {
  position: relative;
  padding-left: 30px;
  color: var(--text-soft);
  font-size: 1rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--grad);
  -webkit-mask: no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask: no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tag-text);
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 5px 13px;
}

.project-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.repo-note {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---- Product hero shot (browser + live-looking app preview) ---- */
.showcase {
  padding-top: 8px;
  padding-bottom: clamp(48px, 8vw, 96px);
}
.browser {
  display: block;
  max-width: 940px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1c1c1e;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}
.browser:hover { transform: translateY(-6px); box-shadow: 0 54px 110px rgba(0, 0, 0, 0.26), 0 10px 30px rgba(0, 0, 0, 0.12); }
.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  background: #2a2a2d;
}
.tl { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tl-r { background: #ff5f57; } .tl-y { background: #febc2e; } .tl-g { background: #28c840; }
.browser-url {
  margin-left: 12px;
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  color: #a1a1a6;
  background: #1c1c1e;
  border-radius: 8px;
  padding: 6px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* animated product demo that plays inside the browser frame */
.demo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fff;
}
.bd-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  transform-origin: top left;
  will-change: transform;
}

/* the app preview mimics the real sepia reading UI */
.app-preview {
  --ap-bg: #ffffff;
  --ap-ink: #1d1d1f;
  --ap-soft: #86868b;
  --ap-accent: #0071e3;
  background: var(--ap-bg);
  color: var(--ap-ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.browser .app-preview { height: clamp(360px, 46vw, 520px); }
.ap-top {
  display: flex;
  align-items: center;
  padding: 16px 22px;
  color: var(--ap-soft);
}
.ap-spacer { flex: 1; }
.ap-icon { display: inline-flex; }
.ap-read {
  flex: 1;
  padding: 8px clamp(22px, 5%, 54px) 20px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
}
.ap-read p {
  font-size: clamp(1.02rem, 2vw, 1.32rem);
  line-height: 1.7;
  margin: 0 0 1em;
  color: var(--ap-ink);
}
.ap-read mark {
  background: color-mix(in srgb, var(--ap-accent) 20%, transparent);
  color: var(--ap-ink);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0.05em 0;
}
.ap-player {
  border-top: 1px solid color-mix(in srgb, var(--ap-soft) 30%, transparent);
  padding: 16px clamp(22px, 5%, 54px) 20px;
}
.ap-progress {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ap-soft) 28%, transparent);
  overflow: hidden;
}
.ap-progress span { display: block; height: 100%; width: 12%; background: var(--ap-accent); border-radius: 999px; }
.ap-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ap-soft);
  margin: 8px 0 12px;
}
.ap-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 30px);
  color: var(--ap-ink);
}
.ap-play {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ap-accent);
  color: #fff;
}

/* compact variant inside the featured card */
.project-media { min-width: 0; }
.app-preview-compact {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
  height: clamp(320px, 40vw, 420px);
}
.app-preview-compact .ap-meta { display: none; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---- Project grid (secondary cards) ---- */
.project-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.project-card {
  background: var(--bg-subtle);
  border-radius: var(--radius);
  padding: 34px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1); }
.project-card h3 {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
}
.project-card p { color: var(--text-soft); margin: 0 0 18px; font-size: 1rem; }
.card-link { color: var(--blue); font-weight: 600; font-size: 1rem; }
.card-link:hover { text-decoration: underline; }

/* ---- About ---- */
.about-grid {
  display: block;
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}
.about-grid .section-head { margin-bottom: 24px; }
.about-body p { color: var(--text-soft); margin: 0 0 20px; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.45; font-weight: 500; letter-spacing: -0.015em; }
.about-body p:last-child { margin-bottom: 0; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 44px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-name { font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.footer-links { display: flex; gap: 26px; }
.footer-links a { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--blue); }
.footer-copy { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 780px) {
  .project-featured { grid-template-columns: 1fr; }
  .project-media { order: 2; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

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