/* ===================================================
   RESET & ROOT
   =================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #090909;
  --surface:      #111111;
  --surface-2:    #191919;
  --surface-3:    #202020;
  --border:       #1e1e1e;
  --border-2:     #2a2a2a;
  --text-1:       #f0f0f0;
  --text-2:       #888888;
  --text-3:       #444444;
  --accent:       #f97316;
  --accent-dim:   rgba(249, 115, 22, 0.08);
  --accent-glow:  rgba(249, 115, 22, 0.18);
  --nav-h:        64px;
  --radius:       12px;
  --radius-sm:    7px;
  --font-head:    'Archivo', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===================================================
   PAGE ENTRY
   =================================================== */

body { animation: pageIn 0.45s var(--ease) both; }

@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===================================================
   SCROLL ANIMATIONS
   =================================================== */

[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

[data-animate].visible {
  opacity: 1;
  transform: none;
}

[data-delay="1"] { transition-delay: 0.08s; }
[data-delay="2"] { transition-delay: 0.16s; }
[data-delay="3"] { transition-delay: 0.24s; }
[data-delay="4"] { transition-delay: 0.32s; }
[data-delay="5"] { transition-delay: 0.40s; }
[data-delay="6"] { transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  [data-animate], .char {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
  body { animation: none; }
}

/* ===================================================
   NAV
   =================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(9, 9, 9, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text-1);
  cursor: pointer;
  transition: color 0.2s;
}

.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: 7px 13px;
  border-radius: 7px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--text-1); background: var(--surface-2); }
.nav-links a.active { color: var(--text-1); background: var(--surface-2); }

.nav-contact > a { color: var(--accent) !important; }
.nav-contact > a:hover { background: var(--accent-dim) !important; }

/* hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  transition: background 0.2s;
}
.nav-burger:hover { background: var(--surface-2); }

.nav-burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-1);
  border-radius: 2px;
  transition: transform 0.28s var(--ease), opacity 0.2s;
}

.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* mobile drawer */
.nav-mobile {
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 28px;
  z-index: 199;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  padding: 11px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-mobile a:hover,
.nav-mobile a.active { color: var(--text-1); background: var(--surface-2); }

.nav-m-contact { color: var(--accent) !important; }
.nav-m-contact:hover { background: var(--accent-dim) !important; }

/* ===================================================
   HERO — HOME
   =================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 28px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeSlideUp 0.5s var(--ease) 0.15s both;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero-headline {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-1);
  max-width: 860px;
  margin-bottom: 30px;
}

.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(22px);
  animation: charIn 0.4s var(--ease) both;
}

@keyframes charIn {
  to { opacity: 1; transform: none; }
}

.hero-sub {
  font-size: 18px;
  color: var(--text-2);
  font-weight: 400;
  margin-bottom: 52px;
  opacity: 0;
  animation: fadeSlideUp 0.5s var(--ease) 0.9s both;
}

.hero-sub strong {
  color: var(--text-1);
  font-weight: 500;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeSlideUp 0.5s var(--ease) 1.1s both;
}

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

/* ===================================================
   BUTTONS
   =================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #000;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: #ea6c0a;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-ghost {
  color: var(--text-1);
  border: 1px solid var(--border-2);
  background: transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13px;
  border-radius: 7px;
}

/* ===================================================
   TILES — HOME
   =================================================== */

.tiles-wrap {
  padding: 0 28px 120px;
  max-width: 1200px;
  margin: 0 auto;
}

.tiles-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.tiles-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 260px 260px;
  gap: 10px;
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
  transition: border-color 0.3s, transform 0.25s var(--ease);
}

.tile:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
}

/* Tile backgrounds */
.tile-about {
  grid-row: 1 / 3;
  background: linear-gradient(145deg, #0c1118 0%, #0c1e31 60%, #0d2438 100%);
}
.tile-about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 25% 70%, rgba(249,115,22,0.07) 0%, transparent 55%);
}

.tile-projects {
  background: linear-gradient(145deg, #0e0c08 0%, #1a1200 100%);
}
.tile-projects::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 75% 25%, rgba(249,115,22,0.12) 0%, transparent 55%);
}

.tile-experience {
  background: linear-gradient(145deg, #090911 0%, #0d0d1e 100%);
}
.tile-experience::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 80%, rgba(99,102,241,0.07) 0%, transparent 55%);
}

/* Subtle grid texture on tiles */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  pointer-events: none;
}

.tile-body {
  position: absolute;
  inset: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 55%);
  transition: background 0.35s;
}

.tile:hover .tile-body {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.05) 100%);
}

.tile-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.85;
}

.tile-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1.15;
  color: var(--text-1);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0;
  transition: gap 0.3s;
}

.tile:hover .tile-name { gap: 10px; }

.tile-arrow {
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s, transform 0.3s;
  flex-shrink: 0;
}

.tile:hover .tile-arrow {
  opacity: 1;
  transform: none;
}

/* ===================================================
   PAGE HERO (inner pages)
   =================================================== */

.page-hero {
  padding: calc(var(--nav-h) + 64px) 28px 56px;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.page-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.page-hero h1 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 16px;
  color: var(--text-1);
}

.page-hero .lead {
  font-size: 17px;
  color: var(--text-2);
  max-width: 600px;
  line-height: 1.65;
}

/* ===================================================
   SHARED LAYOUT
   =================================================== */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: 80px 28px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===================================================
   CARDS GRID (portfolio / experience)
   =================================================== */

.cards-list {
  display: grid;
  gap: 10px;
}

.cards-list-2 { grid-template-columns: repeat(2, 1fr); }
.cards-list-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.22s var(--ease), box-shadow 0.22s;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.card-tag {
  display: inline-flex;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(249,115,22,0.28);
  padding: 4px 11px;
  border-radius: 5px;
}

.card-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-1);
  transition: color 0.2s;
}

.card:hover .card-title { color: var(--accent); }

.card-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

.card-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  flex: 1;
}

.card-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.2s, gap 0.2s;
  margin-top: 4px;
}

.card:hover .card-cta {
  color: var(--accent);
  gap: 10px;
}

.card-cta svg { width: 15px; height: 15px; }

/* ===================================================
   DETAIL PAGES
   =================================================== */

.detail-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 28px 120px;
  align-items: start;
}

.detail-main { min-width: 0; }

.detail-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: 44px;
  letter-spacing: 0.01em;
}

.back-link:hover {
  color: var(--text-1);
  border-bottom-color: var(--border-2);
}

.back-link svg { width: 15px; height: 15px; }

/* Detail hero area */
.detail-header {
  margin-bottom: 48px;
}

.detail-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.detail-cat::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.detail-header h1 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text-1);
}

.detail-role {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 20px;
}

.detail-desc {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.72;
  max-width: 620px;
  margin-bottom: 28px;
}

/* Tags row */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 48px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  padding: 5px 13px;
  border-radius: 100px;
  letter-spacing: 0.01em;
  transition: color 0.2s, border-color 0.2s;
}

.tag:hover {
  color: var(--text-1);
  border-color: var(--text-3);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 56px;
}

.stat {
  background: var(--surface);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-val {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2.4rem;
  letter-spacing: -0.04em;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

/* Content sections */
.ds {
  margin-bottom: 52px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--border);
}

.ds:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ds h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin-bottom: 20px;
}

.ds p {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.78;
  margin-bottom: 14px;
}

.ds p:last-child { margin-bottom: 0; }

.ds ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.ds ul li {
  display: flex;
  gap: 13px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.65;
}

.ds ul li::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  min-width: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 10px;
}

/* Notebook block */
.notebook-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 56px;
}

.notebook-block h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-1);
  margin-bottom: 8px;
}

.notebook-block p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
}

/* Sidebar */
.sb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
}

.sb-card:last-child { margin-bottom: 0; }

.sb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.sb-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  margin-bottom: 8px;
  cursor: pointer;
}

.sb-item:last-child { margin-bottom: 0; }

.sb-item:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.sb-item-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sb-item-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.25;
}

.sb-item-role {
  font-size: 12px;
  color: var(--text-2);
}

/* ===================================================
   ABOUT PAGE
   =================================================== */

.about-layout {
  max-width: 800px;
}

.about-subhead {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 28px;
}

.about-body p {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.82;
  margin-bottom: 20px;
}

.about-body p:last-child { margin-bottom: 0; }

.skills-block {
  margin-top: 64px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}

.skills-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pill {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border-2);
  padding: 9px 17px;
  border-radius: 9px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  cursor: default;
}

.skill-pill:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* ===================================================
   FOOTER
   =================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 28px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

.footer-icons {
  display: flex;
  gap: 2px;
}

.footer-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--text-3);
  border-radius: 9px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}

.footer-icons a:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

.footer-icons svg { width: 18px; height: 18px; }

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }

  .tiles-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 220px 220px;
  }
  .tile-about { grid-row: auto; }

  .cards-list-2,
  .cards-list-3 { grid-template-columns: 1fr; }

  .detail-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .detail-sidebar { position: static; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .hero { padding: calc(var(--nav-h) + 40px) 20px 60px; }
  .hero-headline { font-size: 2.1rem; }
  .tiles-wrap { padding: 0 20px 80px; }
  .section { padding: 60px 20px; }
  .page-hero { padding: calc(var(--nav-h) + 48px) 20px 44px; }
  .detail-wrap { padding: 44px 20px 80px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-ctas { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
