/* =========================================================
   Reza Talaneh | Portfolio
   ========================================================= */

:root {
  --navy-900: #07142a;
  --navy-800: #0b1b33;
  --navy-700: #12294a;
  --navy-600: #1b3a63;
  --cyan: #1ea7e1;
  --cyan-bright: #3cc4f5;
  --ink: #0f1f3d;
  --text: #3a4a63;
  --muted: #6b7a92;
  --line: #e1e7f0;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(11, 27, 51, .06);
  --shadow-md: 0 12px 32px rgba(11, 27, 51, .10);
  --shadow-lg: 0 24px 60px rgba(7, 20, 42, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

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

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -.02em; }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--cyan); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--cyan); color: #fff; box-shadow: 0 8px 22px rgba(30, 167, 225, .35); }
.btn-primary:hover { background: var(--cyan-bright); }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-outline { border-color: var(--navy-700); color: var(--navy-700); }
.btn-outline:hover { background: var(--navy-700); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(7, 20, 42, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--cyan); color: #fff; font-size: 14px; letter-spacing: .02em;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: rgba(255, 255, 255, .78); font-size: 15px; font-weight: 500;
  padding: 8px 16px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav a:hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.nav-cta { background: var(--cyan); color: #fff; margin-left: 8px; }
.nav a.nav-cta:hover { background: var(--cyan-bright); }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: #fff; margin: 6px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 500px at 85% 20%, rgba(30, 167, 225, .22), transparent 60%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700));
  padding: 90px 0 110px;
}
.hero-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan); font-weight: 500; margin-bottom: 14px;
}
.eyebrow.light { color: var(--cyan-bright); }
.hero .eyebrow { color: var(--cyan-bright); }

.hero h1 { color: #fff; font-size: clamp(44px, 6vw, 76px); font-weight: 800; letter-spacing: -.035em; }
.hero-role { margin-top: 14px; font-size: clamp(18px, 2vw, 22px); font-weight: 600; color: #cfe3f7; }
.hero-role span { color: var(--cyan); margin: 0 6px; }
.hero-lead { margin-top: 22px; max-width: 54ch; color: #aebfd6; font-size: 17px; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero-stats { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 36px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12); }
.hero-stats strong { display: block; font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero-stats span { font-size: 13px; color: #92a6c1; }

.hero-visual { position: relative; }
.hero-card {
  position: relative; background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .2);
}
.hero-card img { width: 100%; aspect-ratio: 733 / 509; object-fit: cover; }
.hero-card figcaption {
  position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px;
  background: rgba(7, 20, 42, .85); color: #fff; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(6px);
}
.hero-card figcaption .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-bright); box-shadow: 0 0 0 4px rgba(60, 196, 245, .25); }
.hero-card-small { position: absolute; width: 44%; right: -14px; bottom: -44px; border-radius: 16px; border: 4px solid var(--navy-800); }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-soft); }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
.section-head.center { text-align: center; margin-bottom: 52px; }
.section-sub { margin: 14px auto 0; max-width: 60ch; color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: start; }
.about-body p { font-size: 17px; }
.about-body p + p { margin-top: 16px; }
.pillars { margin-top: 34px; display: grid; gap: 14px; }
.pillars li {
  display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s;
}
.pillars li:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pillar-icon {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--navy-800); color: var(--cyan-bright); font-family: var(--mono); font-size: 14px; font-weight: 500;
}
.pillars h3 { font-size: 17px; margin-bottom: 2px; }
.pillars p { font-size: 15px; color: var(--muted); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  border-top: 4px solid var(--cyan); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.skill-card h3 { font-size: 18px; margin-bottom: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px;
  background: #eaf5fc; color: #0b5d86; border: 1px solid #cfe8f6;
}
.chips.small li { font-size: 12.5px; padding: 5px 11px; }

/* Overview grid */
.overview-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.overview-card { grid-column: span 2; }
.overview-card:nth-child(4), .overview-card:nth-child(5) { grid-column: span 3; }
.overview-card:nth-child(4) img, .overview-card:nth-child(5) img { aspect-ratio: 16 / 9; }
.overview-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.overview-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--cyan); }
.overview-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f1f4f8; transition: transform .5s ease; }
.overview-card:hover img { transform: scale(1.04); }
.overview-card { overflow: hidden; }
.overview-card > div { padding: 20px 22px 24px; position: relative; background: #fff; }
.overview-card .num { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); font-weight: 500; }
.overview-card h3 { margin-top: 6px; font-size: 18px; }

/* ---------- Projects ---------- */
.project { padding: 96px 0; border-top: 1px solid var(--line); }
.project.alt { background: var(--bg-soft); }

.project-head { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 48px; }
.project-num {
  flex: none; font-size: clamp(56px, 8vw, 96px); font-weight: 800; line-height: .9; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 2px var(--cyan); font-family: var(--font);
}
.project-head h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; }
.project-intro { margin-top: 12px; max-width: 70ch; font-size: 17px; color: var(--text); }

.project-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 40px; align-items: start; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.gallery figure {
  grid-column: span 6; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s;
}
.gallery figure.wide { grid-column: span 3; }
.gallery figure.full { grid-column: span 6; }
.gallery figure:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; background: #f1f4f8;
}
.gallery figure.full img { aspect-ratio: 16 / 9; }
.gallery figure.drawing img { object-fit: contain; background: #fff; padding: 6px; }
.gallery figcaption { padding: 12px 16px 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--line); }
.gallery figcaption b { color: var(--ink); font-weight: 600; }

/* Info column */
.project-info { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 18px; }
.project.alt .info-block { background: #fff; }
.info-block {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
}
.project.alt .info-block { background: #fff; }
.info-block h3 {
  font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--cyan); font-weight: 500; margin-bottom: 14px;
}
.info-block p { font-size: 15px; }

.checklist { display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.55; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--cyan) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.specs { display: grid; gap: 0; }
.specs > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.specs > div:last-child { border-bottom: 0; padding-bottom: 0; }
.specs > div:first-child { padding-top: 0; }
.specs dt { color: var(--muted); flex: none; }
.specs dd { color: var(--ink); font-weight: 600; text-align: right; }

.project-info .btn { justify-self: start; }

/* ---------- Contact ---------- */
.contact {
  position: relative; color: #fff; text-align: center; padding: 110px 0;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(30, 167, 225, .25), transparent 65%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700));
}
.contact h2 { color: #fff; font-size: clamp(32px, 4.4vw, 52px); font-weight: 800; }
.contact-sub { margin: 16px auto 0; max-width: 56ch; color: #aebfd6; font-size: 17px; }
.contact-cards { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
.contact-card {
  display: block; padding: 24px 26px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  transition: background .2s, transform .2s, border-color .2s;
}
a.contact-card:hover { background: rgba(255, 255, 255, .12); transform: translateY(-4px); border-color: var(--cyan); }
.contact-label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan-bright); margin-bottom: 8px; }
.contact-value { display: block; font-size: 18px; font-weight: 600; color: #fff; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #8ea2bf; font-size: 14px; padding: 24px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.site-footer a:hover { color: #fff; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 10, 22, .93); padding: 24px;
}
.lightbox[hidden] { display: none; }
.lb-figure { max-width: min(1200px, 90vw); max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-figure img { max-width: 100%; max-height: 78vh; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); }
.lb-figure figcaption { color: #cfdbec; font-size: 15px; text-align: center; max-width: 80ch; }
.lb-close, .lb-nav {
  position: absolute; background: rgba(255, 255, 255, .1); color: #fff; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; transition: background .2s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-layout { grid-template-columns: 1fr; }
  .project-info { position: static; grid-template-columns: 1fr 1fr; }
  .project-info .info-block:first-child { grid-column: 1 / -1; }
  .project-info .btn { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hero { padding: 64px 0 90px; }
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero-card-small { right: 8px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-card, .overview-card:nth-child(4), .overview-card:nth-child(5) { grid-column: auto; }
  .overview-card:nth-child(4) img, .overview-card:nth-child(5) img { aspect-ratio: 4 / 3; }
  .overview-card:nth-child(5) { grid-column: 1 / -1; }
  .contact-cards { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 4px; padding: 16px 24px 24px; background: var(--navy-900); border-bottom: 1px solid rgba(255, 255, 255, .08);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 16px; }
  .nav a.nav-cta { margin: 8px 0 0; text-align: center; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .section, .project { padding: 68px 0; }
  .skills-grid, .overview-grid { grid-template-columns: 1fr; }
  .project-head { flex-direction: column; gap: 12px; margin-bottom: 32px; }
  .project-info { grid-template-columns: 1fr; }
  .gallery figure.wide { grid-column: span 6; }
  .hero-stats { gap: 24px; }
  .hero-card-small { display: none; }
  .specs > div { flex-direction: column; gap: 2px; }
  .specs dd { text-align: left; }
  .lb-prev, .lb-next { width: 40px; height: 40px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .lightbox, .nav-toggle { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .project, .section { padding: 24px 0; break-inside: avoid; }
}
