/* =========================================
   Ryan Kohanski — Portfolio
   ========================================= */

:root {
  --bg: #0a0a0d;
  --bg-elev: #101014;
  --surface: #14141a;
  --surface-2: #1a1a22;
  --border: #23232d;
  --border-strong: #2e2e3a;

  --text: #ececf1;
  --text-muted: #9a9aa8;
  --text-faint: #6b6b78;

  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-glow: rgba(124, 92, 255, 0.35);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --max: 1180px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 260ms;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-glow); color: #fff; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* Subtle grain overlay for texture */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* =========================================
   Navigation
   ========================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 13, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0b12;
}
.brand-name { font-size: 15px; }

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur) var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 36px; height: 36px;
  margin-left: auto;
  padding: 0;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

/* =========================================
   Hero
   ========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 140px 0 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(500px 380px at 85% 70%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(900px 700px at 50% -10%, rgba(124, 92, 255, 0.08), transparent 60%);
  filter: blur(0.5px);
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 24px;
}
.hero-title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title .typed {
  color: var(--text);
}
.caret {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
  font-weight: 300;
}
@keyframes blink {
  50% { opacity: 0; }
}

.hero-sub {
  max-width: 620px;
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--text-muted);
  margin: 0 0 36px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6a4dff);
  color: #fff;
  box-shadow: 0 8px 30px -8px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px -10px var(--accent-glow);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.hero-socials {
  display: flex;
  gap: 14px;
  color: var(--text-muted);
}
.hero-socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.hero-socials a:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  display: grid;
  place-items: start center;
  padding-top: 6px;
  opacity: 0.7;
  z-index: 2;
}
.scroll-indicator span {
  display: block;
  width: 2px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 2px;
  animation: scroll-hint 1.8s ease-in-out infinite;
}
@keyframes scroll-hint {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* =========================================
   Sections
   ========================================= */
.section {
  padding: 120px 0;
  position: relative;
  z-index: 2;
}
.section-alt {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015) 20%, rgba(255,255,255,0.015) 80%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head { margin-bottom: 56px; max-width: 780px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 12px;
}
.section-title {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.1;
}
.section-lede {
  color: var(--text-muted);
  margin: 0;
  font-size: 16.5px;
}

/* =========================================
   About
   ========================================= */
.about-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-text p {
  font-size: 17px;
  color: var(--text);
  margin: 0 0 18px;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 600; }

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 100px;
}
.about-portrait {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.about-card:hover .about-portrait img { transform: scale(1.04); }

.about-facts {
  margin: 0;
  padding: 22px 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.about-facts > div { min-width: 0; }
.about-facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.about-facts dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* =========================================
   Currently Building
   ========================================= */
.now-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.now-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
  align-items: center;
}
.now-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(450px 160px at 0% 0%, rgba(124, 92, 255, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.now-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -25px rgba(0,0,0,0.5);
}
.now-card:hover::before { opacity: 1; }

/* Alternate image side on even cards */
.now-card:nth-child(even) .now-preview { order: 2; }
.now-card:nth-child(even) .now-content { order: 1; }

.now-preview {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
  position: relative;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.now-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(10,10,13,0.35));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.now-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 600ms var(--ease);
}
.now-card:hover .now-preview {
  border-color: var(--border-strong);
}
.now-card:hover .now-preview img {
  transform: scale(1.03);
}
.now-card:hover .now-preview::after { opacity: 1; }

.now-content { min-width: 0; display: flex; flex-direction: column; }

.now-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 7px 14px 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.18);
  border-radius: 999px;
  width: fit-content;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.08); }
}

.now-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}
.now-head h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.now-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-2);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.now-link:hover { color: #fff; transform: translateX(2px); }
.now-link svg { transition: transform var(--dur) var(--ease); }
.now-link:hover svg { transform: translate(2px, -2px); }

.now-tagline {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}
.now-content > p:not(.now-tagline) {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 15px;
}

.now-tech {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.now-tech span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.015);
}

@media (max-width: 860px) {
  .now-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .now-card:nth-child(even) .now-preview { order: 0; }
  .now-card:nth-child(even) .now-content { order: 0; }
}

/* =========================================
   Projects
   ========================================= */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.filter {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #6a4dff);
  border-color: transparent;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--border-strong);
}
.project.is-hidden { display: none; }

.project-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}
.project-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,10,13,0.5));
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.project:hover .project-thumb img { transform: scale(1.06); }

.project-body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.project h3 {
  margin: 0 0 10px;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  font-weight: 600;
}
.project p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14.5px;
}
.project-tech {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.project-tech span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* =========================================
   Skills
   ========================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.skill-group {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.skill-group:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.skill-group h3 {
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chips span:hover { border-color: var(--accent); color: #fff; }

/* =========================================
   Contact
   ========================================= */
.contact-inner {
  text-align: center;
}
.contact-email {
  display: inline-block;
  margin: 16px 0 28px;
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  transition: transform var(--dur) var(--ease);
}
.contact-email:hover { transform: translateY(-2px); }
.contact-email::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.4;
}

.contact-socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.contact-socials a { transition: color var(--dur) var(--ease); }
.contact-socials a:hover { color: var(--text); }
.contact-socials span { color: var(--text-faint); }

/* =========================================
   Footer
   ========================================= */
.footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-meta { margin: 0; }
.footer p { margin: 0; }

/* =========================================
   Scroll reveal
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 900px) {
  .about-content { grid-template-columns: 1fr; gap: 40px; }
  .about-card { position: static; }
  .section { padding: 90px 0; }
  .hero { padding: 120px 0 60px; min-height: auto; }
}

@media (max-width: 680px) {
  .container { padding: 0 20px; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 13, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav.open .nav-links a {
    padding: 14px 28px;
    border-top: 1px solid var(--border);
  }
  .nav.open .nav-links a::after { display: none; }

  .hero-cta .btn { flex: 1; }
  .about-facts { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

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