/* ============================================
   ROUBEN GHAMBARYAN — PORTFOLIO
   Style System
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg: #0a0a0a;
  --color-bg-elevated: #111111;
  --color-bg-card: #161616;
  --color-surface: #1a1a1a;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text-primary: #f2f2f2;
  --color-text-secondary: rgba(242, 242, 242, 0.6);
  --color-text-tertiary: rgba(242, 242, 242, 0.35);
  --color-accent: #c8c8c8;
  --color-highlight: #ffffff;
  --color-overlay: rgba(10, 10, 10, 0.95);

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Albert Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --nav-height: 72px;
  --container-max: 1400px;
  --container-padding: 48px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

/* --- Loading Screen --- */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s;
}

.loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  gap: 8px;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-primary);
  animation: loaderPulse 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loaderPulse {
  0%, 80%, 100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Page Transition --- */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.8s var(--ease-in-out);
  pointer-events: none;
}

.page-transition.active {
  transform: translateY(0);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 100;
  padding: 0 var(--container-padding);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.3s ease;
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-logo-name {
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
}

.nav-logo-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.04em;
}

.nav-links {
  display: contents;
}

/* Pill-shaped nav group - centered */
.nav-pill {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 0;
  width: 180px;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 4px 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}

.nav-pill-link {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  padding: 8px 24px;
  border-radius: 100px;
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  flex: 1;
  text-align: center;
  position: relative;
}

.nav-pill-link:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.nav-pill-link.active {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Glow indicator bar above active pill link */
.nav-pill-link.active::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* External links with arrow */
.nav-external {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 24px;
}

.nav-link-ext {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s ease;
}

.nav-link-ext:hover {
  color: var(--color-text-primary);
}

.nav-link-ext svg {
  transition: transform 0.3s var(--ease-out-expo);
}

.nav-link-ext:hover svg {
  transform: translate(1px, -1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--color-text-primary);
  transition: transform 0.4s var(--ease-out-expo), opacity 0.3s ease;
}

.nav-toggle.active span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle.active span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-overlay);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out-expo), visibility 0.5s;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.mobile-menu-link {
  font-family: var(--font-secondary);
  font-size: 32px;
  font-weight: 300;
  color: var(--color-text-secondary);
  transition: color 0.3s ease, transform 0.5s var(--ease-out-expo);
  transform: translateY(20px);
  opacity: 0;
}

.mobile-menu.active .mobile-menu-link {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu.active .mobile-menu-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-menu-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu-link:nth-child(4) { transition-delay: 0.25s; }

.mobile-menu-link:hover {
  color: var(--color-text-primary);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--container-padding);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  padding-top: calc(var(--nav-height) + 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Browser Mockup - Double Outline Structure */
.hero-browser {
  width: 100%;
  max-width: 882px;
  position: relative;
}

/* --- Card Surface: outer outline wrapper --- */
.window-outline {
  border-radius: 24px;
  padding: 8px;
  outline: 1px solid rgba(242, 242, 242, 0.12);
  outline-offset: -1px;
  background-image:
    radial-gradient(circle farthest-side at 50% 0%, rgba(242, 242, 242, 0.18), transparent 70%),
    radial-gradient(ellipse at 50% 100%, rgba(242, 242, 242, 0.04), transparent 60%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(242, 242, 242, 0.06),
    0 0 80px rgba(0, 0, 0, 0.25),
    0 40px 140px rgba(0, 0, 0, 0.8),
    0 8px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  backdrop-filter: none;
}

/* --- Card Surface: inner card body --- */
.window-main {
  border-radius: 16px;
  border: 1px solid rgba(242, 242, 242, 0.18);
  border-top-color: rgba(242, 242, 242, 0.28);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 242, 242, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 60%, rgba(242, 242, 242, 0.015) 0%, transparent 50%),
    rgba(16, 16, 16, 0.75);
  box-shadow: inset 0 1px 0 rgba(242, 242, 242, 0.08);
}

/* --- Browser Top Bar --- */
.window-bar {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  height: 42px;
  background:
    linear-gradient(180deg, rgba(242, 242, 242, 0.07) 0%, rgba(242, 242, 242, 0.02) 100%),
    linear-gradient(to right, rgba(242, 242, 242, 0.05), rgba(242, 242, 242, 0.12) 50%, rgba(242, 242, 242, 0.05));
  border-bottom: 1px solid rgba(242, 242, 242, 0.08);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(242, 242, 242, 0.06);
  position: relative;
  z-index: 2;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
}

.dot-red {
  background: radial-gradient(circle at 35% 35%, #ff8a84, #ff5f57 60%, #e0453d);
  box-shadow: 0 0 12px 2px rgba(255, 95, 87, 0.35);
}

.dot-yellow {
  background: radial-gradient(circle at 35% 35%, #fdd56a, #febc2e 60%, #e0a21a);
  box-shadow: 0 0 12px 2px rgba(254, 188, 46, 0.35);
}

.dot-green {
  background: radial-gradient(circle at 35% 35%, #5ee075, #28c840 60%, #1aa832);
  box-shadow: 0 0 12px 2px rgba(40, 200, 64, 0.35);
}

/* --- Card Content Area --- */
.window-content {
  padding: 80px 56px 192px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(242, 242, 242, 0.03) 0%, transparent 60%),
    rgba(16, 16, 16, 0.7);
  position: relative;
}

/* Subtle grain texture overlay */
.window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

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

/* --- Hero Heading --- */
.hero-heading {
  font-family: var(--font-secondary);
  font-size: 78px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.06);
  margin-bottom: 64px;
}

.hero-heading em {
  font-family: 'Gloock', serif;
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(
    to bottom,
    rgba(242, 242, 242, 0.95) 0%,
    rgba(242, 242, 242, 0.7) 45%,
    rgba(242, 242, 242, 0.2) 85%,
    transparent 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Bio Grid --- */
.hero-bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.hero-bio-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-bio-text {
  font-family: var(--font-primary);
  font-size: 17px;
  font-weight: 400;
  color: rgba(242, 242, 242, 0.92);
  line-height: 1.7;
  letter-spacing: 0.005em;
}

.hero-bio-text strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

.hero-bio-sub {
  font-family: var(--font-primary);
  font-size: 17px;
  font-weight: 300;
  color: rgba(242, 242, 242, 0.5);
  line-height: 1.7;
  letter-spacing: 0.005em;
  margin-top: 2px;
}

/* Scroll arrow */
.hero-scroll-arrow {
  margin-top: 48px;
  color: var(--color-text-tertiary);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 1.2s forwards;
}

.hero-scroll-arrow svg {
  animation: bounceArrow 2s ease-in-out infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Section Commons --- */
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--color-text-tertiary);
}

.section-title {
  font-family: var(--font-secondary);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-top: 16px;
  color: var(--color-text-primary);
}

/* --- Work Section --- */
.work {
  padding: 120px var(--container-padding) 80px;
  max-width: calc(var(--container-max) + var(--container-padding) * 2);
  margin: 0 auto;
}

.work-header {
  margin-bottom: 64px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.work-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: transform 0.6s var(--ease-out-expo), border-color 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.work-card-coming {
  cursor: default;
  opacity: 0.5;
}

.work-card-coming:hover {
  transform: none;
  border-color: var(--color-border);
  box-shadow: none;
}

.work-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.work-card-image-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s var(--ease-out-expo);
}

.work-card:hover .work-card-image-inner {
  transform: scale(1.03);
}

.work-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-card-placeholder-icon {
  font-family: var(--font-secondary);
  font-size: 48px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.05em;
}

.work-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.work-card-info {
  padding: 28px 28px 32px;
}

.work-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.work-card-org {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-card-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.work-card-title {
  font-family: var(--font-secondary);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.work-card-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.work-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.04em;
  transition: color 0.3s ease, gap 0.3s var(--ease-out-expo);
}

.work-card:hover .work-card-cta {
  color: var(--color-text-primary);
  gap: 12px;
}

/* --- About Brief Section --- */
.about-brief {
  padding: 80px var(--container-padding) 120px;
  max-width: calc(var(--container-max) + var(--container-padding) * 2);
  margin: 0 auto;
}

.about-brief-content {
  max-width: 720px;
}

.about-brief-text {
  font-family: var(--font-secondary);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-top: 24px;
  margin-bottom: 32px;
}

.about-brief-text strong {
  color: var(--color-text-primary);
  font-weight: 500;
}

.about-brief-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  transition: color 0.3s ease, gap 0.3s var(--ease-out-expo);
}

.about-brief-link:hover {
  color: var(--color-text-primary);
  gap: 12px;
}

/* --- Footer --- */
.footer {
  padding: 48px var(--container-padding);
  border-top: 1px solid var(--color-border);
  max-width: calc(var(--container-max) + var(--container-padding) * 2);
  margin: 0 auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-name {
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.04em;
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--color-text-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

/* --- Scroll Animations --- */
[data-scroll] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}

[data-scroll].is-inview {
  opacity: 1;
  transform: translateY(0);
}

.work-card[data-scroll] {
  transition-duration: 1s;
}

.work-card:nth-child(2)[data-scroll] {
  transition-delay: 0.15s;
}

/* Hero reveal animations */
.hero-browser {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 1.2s var(--ease-out-expo), transform 1.2s var(--ease-out-expo);
}

.hero-browser.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}


.hero-scroll-arrow {
  opacity: 0 !important;
  transition: opacity 0.8s var(--ease-out-expo) 0.2s;
}

.hero-scroll-arrow.revealed {
  opacity: 1 !important;
}

/* --- Selection --- */
::selection {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text-primary);
}
