/* ============================================================
   Bythorn — Team (v2)
   Cool slate-navy. Periwinkle -> teal accent. Profile cards.
   Display: Space Grotesk. Data: JetBrains Mono.
   ============================================================ */

:root {
  --bg:        #0a0d15;
  --bg-2:      #0e1220;
  --card:      #12172552;
  --card-solid:#141a29;
  --line:      #222a3d;
  --line-soft: #1a2131;
  --text:      #e6e9f2;
  --muted:     #8a93ad;
  --faint:     #5c657f;

  --iris:      #7c9cff;   /* periwinkle primary */
  --teal:      #4fe0c5;   /* mint/teal secondary */
  --iris-deep: #5a78e0;

  /* contribution heat ramp — cool blues into bright periwinkle */
  --h0: #161c2b;
  --h1: #253563;
  --h2: #3a56a6;
  --h3: #5a7fe0;
  --h4: #93b4ff;

  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 960px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

/* ambient aurora — cool wash, distinct from v1's warm grain */
.aurora {
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 20% 0%, rgba(124,156,255,0.16), transparent 70%),
    radial-gradient(45% 55% at 85% 10%, rgba(79,224,197,0.10), transparent 70%);
  filter: blur(10px);
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.mono { font-family: var(--mono); }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  padding: 26px 24px;
}
.socials { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--iris), var(--teal), var(--iris));
  box-shadow: 0 0 16px -2px var(--iris);
}
.brand-name { font-family: var(--sans); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }

.org-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--muted); text-decoration: none;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,0.015);
  transition: color 0.18s, border-color 0.18s;
}
.org-link:hover { color: var(--iris); border-color: var(--iris-deep); }
.org-link svg { color: inherit; }
.org-link.ghost { border: 0; background: none; padding: 0; }

/* ---------- site nav (header) ---------- */
.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--muted); text-decoration: none;
  padding: 8px 15px; border-radius: 999px;
  transition: color 0.18s, background 0.18s;
}
.nav-link:hover { color: var(--text); background: rgba(124,156,255,0.07); }
.nav-link.active { color: var(--iris); background: rgba(124,156,255,0.1); }

/* ---------- page head (team / projects / contact) ---------- */
.page-head { padding: 42px 0 8px; }
.page-head h1 {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(1.7rem, 4.6vw, 2.4rem);
  letter-spacing: -0.02em; margin: 0;
}
.page-head p { margin: 12px 0 0; max-width: 58ch; color: var(--muted); font-size: 1rem; }

/* ---------- home teasers ---------- */
.teaser-text { color: var(--muted); max-width: 56ch; margin: 0; }
.contact-socials { margin-top: 18px; }
.inline-link { color: var(--iris); }
.inline-link:hover { color: var(--teal); }
.see-more {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--iris); text-decoration: none;
  margin-top: 20px;
}
.see-more span { display: inline-block; transition: transform 0.18s; }
.see-more:hover { color: var(--teal); }
.see-more:hover span { transform: translateX(4px); }

/* ---------- intro ---------- */
.intro { padding: 46px 0 34px; }
.intro-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal);
  margin: 0 0 18px;
}
.intro-eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--iris), var(--teal), var(--iris));
  box-shadow: 0 0 10px -1px var(--teal);
}
.intro-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2rem, 6.2vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0;
}
.intro-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--iris), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(79,224,197,0.18));
}
.intro-sub {
  margin: 18px 0 0; max-width: 46ch;
  color: var(--muted); font-size: 1.02rem;
}

/* ---------- blocks ---------- */
.block { padding: 40px 0 6px; }
.block-title {
  font-family: var(--sans);
  font-size: 0.82rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--faint);
  margin: 0 0 22px;
  display: flex; align-items: center; gap: 12px;
}
.block-title::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--iris); box-shadow: 0 0 8px -1px var(--iris);
}
.block-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* scroll-reveal — sections fade + rise into place as they enter the viewport */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- people ---------- */
.people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.pcard {
  background: linear-gradient(180deg, rgba(124,156,255,0.05), rgba(20,26,41,0.4));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pcard::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,156,255,0.5), transparent);
}
.pcard:hover {
  border-color: rgba(124,156,255,0.4); transform: translateY(-4px);
  box-shadow: 0 24px 44px -28px rgba(124,156,255,0.35);
}

/* the injected identity block — center everything on one axis */
.pcard-top {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-ring {
  margin: 0 auto;
  width: 108px; height: 108px;
  border-radius: 26px;
  padding: 3px;
  background: conic-gradient(from 140deg, var(--iris), var(--teal), var(--iris-deep), var(--iris));
  box-shadow: 0 10px 34px -12px rgba(124,156,255,0.55);
}
.avatar {
  width: 100%; height: 100%;
  border-radius: 23px;
  display: block;
  object-fit: cover;
  background: var(--bg-2);
}
.avatar.fallback {
  display: grid; place-items: center;
  font-family: var(--sans); font-weight: 700; font-size: 2.2rem;
  color: var(--iris);
}

.pname {
  font-family: var(--sans); font-weight: 700;
  font-size: 1.5rem; letter-spacing: -0.02em;
  margin: 18px 0 2px;
}
.pfullname {
  font-size: 0.85rem; color: var(--muted);
  font-family: var(--sans); margin: 0 0 6px;
}
.prole {
  font-size: 0.9rem; color: var(--teal);
  font-family: var(--mono); margin: 0 0 16px;
}
.pcard-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pgh {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--muted); text-decoration: none;
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.pgh:hover { color: var(--text); border-color: var(--iris-deep); background: rgba(124,156,255,0.08); }

/* ---------- calendar (inside pcard) ---------- */
.cal-wrap { width: 100%; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-label { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.cal-total { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.cal-total strong { color: var(--text); font-weight: 500; }

.cal-mini { display: flex; justify-content: center; }
/* mini month grid: slightly larger cells so it reads as a heatmap */
.cal-mini .cal-weeks { gap: 4px; }
.cal-mini .cal-week { gap: 4px; }
.cal-mini .cal-cell { width: 14px; height: 14px; border-radius: 3px; }

/* expandable full-year panel — accordion, animates height */
.cal-full {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.cal-full.open { opacity: 1; margin-top: 14px; }
.cal-full-inner { padding-top: 2px; }

.cal-scroll { overflow-x: auto; padding-bottom: 4px; }
.cal-weeks { display: flex; gap: 3px; }
.cal-week { display: flex; flex-direction: column; gap: 3px; }
.cal-cell {
  width: 11px; height: 11px; border-radius: 3px;
  background: var(--h0);
  cursor: pointer;
  transition: transform 0.08s ease;
}
.cal-cell[data-level="1"] { background: var(--h1); }
.cal-cell[data-level="2"] { background: var(--h2); }
.cal-cell[data-level="3"] { background: var(--h3); }
.cal-cell[data-level="4"] { background: var(--h4); box-shadow: 0 0 7px -1px rgba(147,180,255,0.6); }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell:hover, .cal-cell.active {
  transform: scale(1.3);
  outline: 1.5px solid var(--iris);
  outline-offset: 1px;
}
.cal-cell:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }

.cal-months {
  display: flex; font-family: var(--mono); font-size: 0.58rem;
  color: var(--faint); margin-bottom: 4px;
}
.cal-months span { flex: none; }

.cal-toggle {
  margin-top: 14px;
  width: 100%;
  font-family: var(--mono); font-size: 0.74rem;
  color: var(--iris);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.18s, border-color 0.18s;
}
.cal-toggle:hover { background: rgba(124,156,255,0.07); border-color: var(--iris-deep); }
.cal-toggle .caret { transition: transform 0.3s ease; }
.cal-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }

.cal-legend {
  display: flex; align-items: center; gap: 5px; justify-content: flex-end;
  margin-top: 10px; font-family: var(--mono); font-size: 0.62rem; color: var(--faint);
}
.cal-legend .sw { width: 11px; height: 11px; border-radius: 3px; }
.cal-legend .sw[data-level="0"] { background: var(--h0); }
.cal-legend .sw[data-level="1"] { background: var(--h1); }
.cal-legend .sw[data-level="2"] { background: var(--h2); }
.cal-legend .sw[data-level="3"] { background: var(--h3); }
.cal-legend .sw[data-level="4"] { background: var(--h4); }

.cal-note { font-family: var(--mono); font-size: 0.62rem; color: var(--faint); margin: 10px 0 0; opacity: 0.8; }
.cal-loading { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); text-align: center; padding: 6px 0; }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.proj {
  display: block;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none; color: inherit;
  transition: border-color 0.25s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.proj:hover {
  border-color: rgba(79,224,197,0.4); transform: translateY(-3px);
  box-shadow: 0 20px 38px -26px rgba(79,224,197,0.35);
}
.proj-row { display: flex; align-items: center; justify-content: space-between; }
.proj-name { font-family: var(--sans); font-weight: 600; font-size: 1.18rem; margin: 0; }
.proj-go { color: var(--muted); font-size: 1.1rem; transition: transform 0.18s, color 0.18s; }
.proj:hover .proj-go { color: var(--teal); transform: translateX(3px); }
.proj-desc { color: var(--muted); font-size: 0.92rem; margin: 10px 0 14px; min-height: 1.2em; }
.proj-desc.empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--mono); font-size: 0.66rem;
  color: var(--iris);
  background: rgba(124,156,255,0.08);
  border: 1px solid rgba(124,156,255,0.24);
  border-radius: 999px; padding: 2px 10px;
}
.proj-url { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--faint); margin-top: 12px; }

/* expandable project card (e.g. Ertenix) — click reveals info instead of navigating */
.proj-expand { padding: 0; overflow: hidden; }
.proj-trigger {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; color: inherit; font: inherit;
  padding: 22px; cursor: pointer;
}
.proj-expand:hover {
  border-color: rgba(79,224,197,0.4); transform: translateY(-3px);
  box-shadow: 0 20px 38px -26px rgba(79,224,197,0.35);
}
.proj-caret { transition: transform 0.3s ease; }
.proj-trigger[aria-expanded="true"] .proj-caret { transform: rotate(180deg); }
.proj-panel {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.proj-panel.open { opacity: 1; }
.proj-panel-inner { padding: 0 22px 22px; border-top: 1px solid var(--line-soft); }

/* featured project card (homepage) — bigger preview bleeding to the card edges */
.proj-feature {
  display: block;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.proj-feature:hover {
  border-color: rgba(79,224,197,0.4); transform: translateY(-4px);
  box-shadow: 0 28px 50px -28px rgba(79,224,197,0.3);
}
.proj-feature .proj-preview {
  height: 180px; margin: 0; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--line-soft);
}
.proj-feature-body { padding: 22px; }
.proj-feature-body .proj-desc { margin: 10px 0 14px; }

/* CSS-only stylized preview (Ertenix has no real screenshot/og:image to pull) */
.proj-preview {
  position: relative;
  height: 128px;
  margin: 16px 0 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: linear-gradient(135deg, rgba(124,156,255,0.16), rgba(79,224,197,0.08) 55%, rgba(10,13,21,0.92));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.proj-preview::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,156,255,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,156,255,0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}
.proj-preview-pixels { position: absolute; inset: 0; pointer-events: none; }
.proj-preview-pixels span {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  background: var(--teal); opacity: 0.55;
  box-shadow: 0 0 10px 1px rgba(79,224,197,0.5);
  animation: pixel-float 5s ease-in-out infinite;
}
.proj-preview-pixels span:nth-child(1) { top: 18%; left: 12%; animation-delay: 0s; }
.proj-preview-pixels span:nth-child(2) { top: 65%; left: 22%; background: var(--iris); box-shadow: 0 0 10px 1px rgba(124,156,255,0.5); animation-delay: 0.6s; }
.proj-preview-pixels span:nth-child(3) { top: 28%; left: 82%; animation-delay: 1.2s; }
.proj-preview-pixels span:nth-child(4) { top: 75%; left: 70%; background: var(--iris); box-shadow: 0 0 10px 1px rgba(124,156,255,0.5); animation-delay: 1.8s; }
.proj-preview-pixels span:nth-child(5) { top: 45%; left: 48%; animation-delay: 2.4s; }
@keyframes pixel-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.55; }
  50% { transform: translateY(-6px) scale(1.15); opacity: 0.9; }
}
.proj-preview-word {
  position: relative; z-index: 1;
  font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em;
  font-size: 1.3rem; color: var(--text);
}
.proj-preview-word em { font-style: normal; color: var(--teal); }
.proj-preview-modes {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em;
}

.proj-panel-text { color: var(--muted); font-size: 0.88rem; line-height: 1.55; margin: 16px 0 16px; }
.proj-links { display: flex; flex-wrap: wrap; gap: 8px; }
.proj-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.76rem;
  color: var(--muted); text-decoration: none;
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  transition: color 0.18s, border-color 0.18s;
}
.proj-link:hover { color: var(--iris); border-color: var(--iris-deep); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  margin-top: 70px; padding: 34px 24px 44px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8rem;
}
.site-footer .socials { justify-content: center; }
.foot-mono { font-family: var(--mono); color: var(--faint); }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: #05070d; border: 1px solid var(--line);
  color: var(--text); font-family: var(--mono); font-size: 0.7rem;
  padding: 6px 9px; border-radius: 8px;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  box-shadow: 0 10px 28px -12px rgba(0,0,0,0.9);
}
.tooltip strong { color: var(--iris); font-weight: 500; }
.tooltip[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .people { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .block { padding: 32px 0 6px; }
  .page-head { padding: 30px 0 4px; }
  .proj-feature .proj-preview { height: 140px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .cal-full { transition: none; }
}
