/* ============================================
   mikesargs — portfolio
   ============================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #08090b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f0e9;
  --text-soft: #b6bac2;
  --muted: #8b8f98;
  --acid: #d8ff4a;
  --violet: #8b7cff;
  --font-display: "Unbounded", "Manrope", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 88% -8%, rgba(216, 255, 74, 0.09), transparent 60%),
    radial-gradient(900px 800px at 4% 24%, rgba(139, 124, 255, 0.11), transparent 62%),
    radial-gradient(800px 600px at 60% 100%, rgba(216, 255, 74, 0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button {
  font-family: var(--font-body);
}

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

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

button {
  color: inherit;
}

h1, h2, h3, p {
  margin: 0;
}

main {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
}

::selection {
  background: var(--acid);
  color: #0a0b0d;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0a0b0d;
}

::-webkit-scrollbar-thumb {
  background: #24272d;
  border-radius: 99px;
  border: 2px solid #0a0b0d;
}

::-webkit-scrollbar-thumb:hover {
  background: #34383f;
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Background FX ---------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background:
    radial-gradient(circle at 40% 40%, rgba(216, 255, 74, 0.10), transparent 58%),
    radial-gradient(circle at 62% 62%, rgba(139, 124, 255, 0.10), transparent 55%);
  filter: blur(18px);
  transition: opacity 0.8s ease;
  will-change: transform;
}

.cursor-glow.is-on {
  opacity: 1;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 17px 40px;
}

.logo {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.logo span {
  color: var(--acid);
}

/* Tabs */
.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.35s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: #0a0b0d;
}

.tab-indicator {
  position: absolute;
  top: 5px;
  left: 0;
  height: calc(100% - 10px);
  width: 0;
  border-radius: 999px;
  background: var(--acid);
  box-shadow: 0 0 26px rgba(216, 255, 74, 0.35);
  z-index: 0;
  transform: translateX(0);
}

.tabs.is-ready .tab-indicator {
  transition:
    transform 0.5s var(--ease),
    width 0.5s var(--ease);
}

.header-year {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 112px) 40px clamp(52px, 6vw, 80px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  animation: fadeUp 0.9s var(--ease) both;
}

.hero h1 {
  max-width: 1120px;
  margin: 26px 0 clamp(26px, 3.4vw, 40px);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, 6.5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
  animation: fadeUp 0.9s var(--ease) 0.08s both;
}

.hero h1 em {
  position: relative;
  font-style: normal;
  color: var(--acid);
  text-shadow: 0 0 46px rgba(216, 255, 74, 0.25);
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0.02em;
  right: 0.02em;
  bottom: 0.02em;
  height: 0.055em;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.3;
  transform: rotate(-1.2deg);
}

.hero-lead {
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.68;
  color: var(--text-soft);
  animation: fadeUp 0.9s var(--ease) 0.18s both;
}

/* ---------- Work / panels ---------- */
.work {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px 40px;
  scroll-margin-top: 110px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 2px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
  animation: panelIn 0.55s var(--ease) both;
}

/* ---------- Empty state ---------- */
.empty {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(340px, 46vh, 480px);
  padding: 32px 4px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.empty-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.empty-index {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.empty-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
}

.empty-note::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px rgba(216, 255, 74, 0.7);
}

.empty-word {
  position: absolute;
  left: -0.03em;
  bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 10.5vw, 160px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.07em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.10);
  pointer-events: none;
  user-select: none;
}

/* ---------- Essay card (essays tab) ---------- */
.essay-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: clamp(340px, 46vh, 480px);
  padding: 32px 4px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.essay-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.essay-card-meta {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.essay-card-body {
  position: relative;
  z-index: 1;
  max-width: 46ch;
  margin-top: auto;
  padding-bottom: clamp(110px, 12vw, 180px);
}

.essay-card-body .empty-note {
  margin-bottom: 12px;
  line-height: 1.2;
}

.essay-card-desc {
  margin-bottom: 26px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
}

.essay-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 22px;
  border: 1px solid var(--acid);
  border-radius: 999px;
  background: var(--acid);
  color: #0a0b0d;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s var(--ease);
}

.essay-button span {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}

.essay-button:hover {
  background: transparent;
  color: var(--acid);
  box-shadow: 0 0 26px rgba(216, 255, 74, 0.18);
  transform: translateY(-2px);
}

.essay-button:hover span {
  transform: translateX(4px);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  margin-top: clamp(30px, 5vw, 60px);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) 40px 26px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: clamp(34px, 5vw, 56px);
}

.footer-note {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  transition: color 0.3s ease;
}

.footer-top span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s var(--ease);
}

.footer-top:hover {
  color: var(--acid);
}

.footer-top:hover span {
  background: var(--acid);
  border-color: var(--acid);
  color: #0a0b0d;
  transform: translateY(-3px);
}

.footer-mark {
  font-family: var(--font-display);
  font-size: clamp(52px, 14vw, 210px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.07em;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.10);
  user-select: none;
  pointer-events: none;
}

/* ---------- Reading page (essay) ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--acid);
}

.reading {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 92px) 40px clamp(60px, 8vw, 110px);
}

.reading .eyebrow {
  animation: none;
}

.reading-title {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.6vw, 3.3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
}

.reading-subtitle {
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-soft);
}

.reading-body {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
  font-size: clamp(16px, 1.6vw, 17.5px);
  line-height: 1.85;
  color: var(--text-soft);
}

.reading-body p {
  margin-bottom: 22px;
}

.reading-body .dialogue {
  margin: 28px 0 30px 2px;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
  color: var(--text);
}

.reading-body .dialogue p {
  margin-bottom: 8px;
}

.reading-body .speech {
  font-style: italic;
  color: var(--text);
}

.reading-foot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.reading-foot .back-link {
  margin-left: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 14px 24px;
  }

  .tabs {
    order: 3;
    width: 100%;
    margin-top: 2px;
    margin-left: 0;
  }

  .tab {
    flex: 1;
  }

  .header-year {
    margin-left: auto;
  }

  .hero {
    padding-left: 24px;
    padding-right: 24px;
  }

  .work {
    padding-left: 24px;
    padding-right: 24px;
  }

  .footer-inner {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 12px 18px;
    gap: 10px 14px;
  }

  .logo {
    font-size: 17px;
  }

  .header-year {
    font-size: 9px;
  }

  .tab {
    padding: 9px 10px;
    font-size: 12.5px;
  }

  .hero {
    padding: 44px 18px 46px;
  }

  .hero h1 {
    margin-top: 20px;
  }

  .hero-lead {
    font-size: 15.5px;
  }

  .work {
    padding: 0 18px 24px;
  }

  .empty,
  .essay-card {
    min-height: 320px;
    padding: 24px 2px;
  }

  .empty-copy,
  .essay-card-head {
    gap: 12px;
  }

  .empty-word {
    bottom: -0.1em;
  }

  .footer-inner {
    padding: 26px 18px 22px;
  }

  .footer-bottom {
    padding-bottom: 34px;
  }

  .reading {
    padding: 44px 18px 70px;
  }

  .header-inner .back-link {
    font-size: 11px;
  }

  .essay-card-body {
    padding-bottom: 76px;
  }
}

@media (max-width: 420px) {
  .header-year {
    display: none;
  }

  .hero h1 {
    font-size: clamp(2rem, 10.4vw, 2.6rem);
  }

  .empty-word {
    font-size: clamp(38px, 10.5vw, 44px);
  }

  .essay-card-body {
    padding-bottom: 60px;
  }
}

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

  .cursor-glow {
    display: none;
  }
}
