/* =========================================================
   Roham Rasouli — Portfolio
   Theme: dark / modern
   Colors: --bg #0E0E10  --text #FFFFFF  --accent #4F8CFF  --muted #8A8A8A
   Fonts: Poppins (display + body), JetBrains Mono (labels)
   ========================================================= */

:root {
  --bg: #0E0E10;
  --bg-elevated: #17171a;
  --bg-elevated-2: #1e1e22;
  --text: #FFFFFF;
  --muted: #8A8A8A;
  --accent: #4F8CFF;
  --accent-dim: rgba(79, 140, 255, 0.14);
  --accent-glow: rgba(79, 140, 255, 0.35);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.05);

  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Poppins', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --max-width: 1180px;
  --radius: 14px;
  --radius-sm: 8px;

  --nav-height: 76px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

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

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

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

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

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; }

::selection {
  background: var(--accent);
  color: #05070d;
}

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

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: none;
  margin-bottom: 14px;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { color: var(--muted); }

.section {
  padding: 96px 0;
  border-top: 1px solid var(--border-soft);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head p { font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color .2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #06090f;
  font-weight: 600;
}
.btn-primary:hover { transform: translateY(-2px); background: #6fa0ff; }

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

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  background: rgba(14, 14, 16, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.nav-logo img { height: 32px; width: auto; }

.nav-logo .mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #1f3f7a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: #06090f;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

/* The Contact button already has its own background as a visual indicator,
   so it doesn't need (and shouldn't get) the underline used for text links. */
.nav-links a.nav-cta.active::after {
  display: none;
}

.nav-links a.nav-cta {
  padding: 8px 40px; /* shorter top/bottom, wider left/right */
  font-size: 13px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 32px 24px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
  .nav-cta { border-bottom: none !important; }
}

/* ---------- Hero (background grid signature) ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 96px) 0 96px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 40%, transparent 90%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -200px; right: -160px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.hero-copy h1 { margin-bottom: 22px; }
.hero-copy .role {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 4px;
}
.hero-copy p.lead {
  font-size: 1.15rem;
  max-width: 520px;
  margin-bottom: 36px;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual .placeholder-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.hero-stats .stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
}
.hero-stats .stat span {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

/* ---------- Cards grid (services / highlights) ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color .25s ease, transform .25s ease;
}
.info-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.info-card .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 18px;
  display: block;
}
.info-card h3 { margin-bottom: 10px; }
.info-card p { font-size: 0.95rem; }

@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Project cards (gallery) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.project-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  position: relative;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 50px -20px var(--accent-glow);
}

.project-card .thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, var(--bg-elevated-2), var(--bg));
  overflow: hidden;
  position: relative;
}
.project-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.project-card:hover .thumb img { transform: scale(1.06); }

.project-card .thumb .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.project-card .body { padding: 22px 24px 26px; }
.project-card .tag-row {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}
.project-card h3 { margin-bottom: 8px; font-size: 1.15rem; }
.project-card p { font-size: 0.92rem; margin-bottom: 0; }

.project-card .arrow {
  position: absolute;
  top: 20px; right: 20px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity .25s ease, transform .25s ease;
}
.project-card:hover .arrow { opacity: 1; transform: translate(0,0); }
.project-card .arrow svg { width: 16px; height: 16px; stroke: var(--text); }

@media (max-width: 980px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .project-grid { grid-template-columns: 1fr; } }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: calc(var(--nav-height) + 72px) 0 64px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.page-hero .eyebrow { margin-bottom: 18px; }
.page-hero p.lead {
  max-width: 640px;
  font-size: 1.1rem;
  margin-top: 18px;
}

/* ---------- About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: start;
}
.about-photo {
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo .ph { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: center; padding: 20px; }

.about-copy p { margin-bottom: 20px; font-size: 1.02rem; }
.about-copy h3 { margin: 8px 0 4px; }

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.skill-pill {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--bg-elevated);
}

.timeline {
  margin-top: 20px;
  border-left: 1px solid var(--border);
  padding-left: 28px;
}
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline-item .date { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-bottom: 6px; display: block; }
.timeline-item h4 { margin-bottom: 4px; }
.timeline-item p { font-size: 0.92rem; margin: 0; }

/* ---------- Resume ---------- */
.resume-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }

.resume-section { margin-bottom: 56px; }
.resume-section h2 {
  font-size: 1.5rem;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.resume-section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.resume-entry { margin-bottom: 28px; }
.resume-entry:last-child { margin-bottom: 0; }
.resume-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.resume-entry-head h4 { font-size: 1.05rem; }
.resume-entry-head .org { color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem; }
.resume-entry-head .date { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.resume-entry ul { margin-top: 8px; }
.resume-entry ul li {
  font-size: 0.94rem;
  color: var(--muted);
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.resume-entry ul li::before {
  content: '›';
  position: absolute; left: 0; top: 0;
  color: var(--accent);
}

.resume-skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.resume-skills-grid .cat { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); margin-bottom: 10px; display: block; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.contact-info .item {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
}
.contact-info .item:last-child { border-bottom: none; }
.contact-info .label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}
.contact-info a.value, .contact-info .value {
  font-size: 1.15rem;
  font-family: var(--font-display);
}
.contact-info a.value:hover { color: var(--accent); }

.social-row { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.social-row a {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, color .2s ease;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent); }

.form-group { margin-bottom: 22px; }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.form-group input, .form-group textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.98rem;
  transition: border-color .2s ease;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.form-group textarea { resize: vertical; min-height: 140px; }

.form-note { font-size: 0.85rem; margin-top: 14px; }

@media (max-width: 900px) {
  .about-grid, .contact-grid, .resume-skills-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Project detail page ---------- */
.project-hero {
  padding: calc(var(--nav-height) + 56px) 0 56px;
}
.project-hero .meta-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
}
.project-hero .meta-row .m { }
.project-hero .meta-row .m span { display: block; }
.project-hero .meta-row .m .k {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.project-hero .meta-row .m .v { font-family: var(--font-display); font-size: 0.98rem; }

.project-banner {
  aspect-ratio: 16/8;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(150deg, var(--bg-elevated), var(--bg));
  margin-top: 40px;
  display: flex; align-items: center; justify-content: center;
}
.project-banner img { width: 100%; height: 100%; object-fit: cover; }
.project-banner .ph { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.project-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 64px;
  padding: 80px 0;
}
.project-content h2 { margin: 40px 0 18px; }
.project-content h2:first-child { margin-top: 0; }
.project-content p { margin-bottom: 18px; font-size: 1.02rem; }
.project-content ul { margin-bottom: 18px; }
.project-content ul li {
  font-size: 1rem; color: var(--muted);
  padding-left: 20px; position: relative; margin-bottom: 10px;
}
.project-content ul li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }

.project-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 12px;
}
.project-gallery .g-item {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
}
.project-gallery .g-item img { width: 100%; height: 100%; object-fit: cover; }
.project-gallery .g-item .ph { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: center; padding: 10px;}

.project-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  height: fit-content;
}
.project-sidebar .k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
  margin-top: 20px;
}
.project-sidebar .k:first-child { margin-top: 0; }
.project-sidebar .v { font-size: 0.95rem; }
.project-sidebar .tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.project-sidebar .tag-list span {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.project-sidebar .btn { width: 100%; margin-top: 20px; }

.project-nav {
  display: flex;
  justify-content: space-between;
  padding: 40px 0 100px;
  border-top: 1px solid var(--border-soft);
  margin-top: 20px;
  gap: 20px;
  flex-wrap: wrap;
}
.project-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  display: flex; flex-direction: column; gap: 8px;
  transition: color .2s ease;
}
.project-nav a:hover { color: var(--accent); }
.project-nav a .lbl { font-size: 11px; }
.project-nav a .title { font-family: var(--font-display); font-size: 1.05rem; color: var(--text); }
.project-nav a:hover .title { color: var(--accent); }
.project-nav a.next { text-align: right; align-items: flex-end; }

@media (max-width: 900px) {
  .project-body { grid-template-columns: 1fr; }
  .project-sidebar { position: static; }
  .project-gallery { grid-template-columns: 1fr; }
}

/* ---------- CTA band ---------- */
.cta-band {
  border-top: 1px solid var(--border-soft);
  padding: 96px 0;
  text-align: center;
}
.cta-band h2 { margin-bottom: 18px; }
.cta-band p { max-width: 480px; margin: 0 auto 36px; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 48px 0;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer .f-left {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.footer .f-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer .f-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  transition: color .2s ease;
}
.footer .f-links a:hover { color: var(--accent); }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Utility ---------- */
.center-text { text-align: center; }
.mt-lg { margin-top: 48px; }
