/* ===========================================================
   Martun Davoyan — CV / Portfolio
   Rebuilt as a static site for Cloudflare Pages.
   Fonts: Poppins (body) + Archivo (headings, substitute for Acumin Pro)
   =========================================================== */

:root {
  --white: #ffffff;
  --black: #000000;
  --ink: #000000;          /* body + heading text (matches original: pure black) */
  --muted: #5a564e;        /* darkAccent — meta text */
  --accent: #d9c3b0;       /* hsl(24,36.84%,81.37%) */
  --light: #ecebe7;        /* hsl(40,8.11%,92.75%) */
  --link: #5b5bd6;         /* inline content link colour */
  --rule: #e6e6e6;

  --body-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading-font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body-font);
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--heading-font);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
}

a { color: inherit; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ===================== Header / Nav ===================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem var(--gutter);
  width: 100%;
}

.brand {
  font-family: var(--heading-font);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: .2px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}

.nav a {
  text-decoration: none;
  font-size: .95rem;
  color: var(--ink);
  white-space: nowrap;
  transition: opacity .15s ease;
}
.nav a:hover { opacity: .55; }
.nav a.active { text-decoration: underline; text-underline-offset: 5px; }

.btn-resume {
  background: var(--black);
  color: var(--white) !important;
  padding: .85rem 1.5rem;
  font-size: .9rem;
  letter-spacing: .3px;
  border-radius: 0;
}
.btn-resume:hover { opacity: .85; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .4rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink);
}

/* ===================== Footer ===================== */
.site-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem var(--gutter) 3rem;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.footer-mail { justify-self: start; }
.footer-phone { justify-self: end; }
.footer-social { display: flex; gap: 1.1rem; justify-self: center; }
.footer-social a { display: inline-flex; }
.footer-social svg { width: 20px; height: 20px; fill: var(--ink); }

/* ===================== Main wrapper ===================== */
main { flex: 1 0 auto; width: 100%; }
.page { padding: clamp(2.5rem, 6vw, 5rem) 0; }

/* ===================== Home / Hero ===================== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: calc(100vh - 230px);
  padding: 2rem 0;
}
.hero-words {
  text-align: right;
  font-family: var(--heading-font);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.12;
  letter-spacing: -.5px;
}
.hero-words span { display: block; }
.hero-photo { justify-self: start; }
.hero-photo img {
  width: min(480px, 44vw);
  height: auto;
  object-fit: cover;
}

/* ===================== Who am I — cards grid ===================== */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 3rem);
  padding-top: 1rem;
}
.card { text-align: center; }
.card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.4rem;
  max-width: 280px;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card h3 {
  font-size: 1.25rem;
  margin-bottom: .6rem;
}
.card p {
  margin: 0 auto;
  max-width: 320px;
  font-size: .92rem;
  line-height: 1.55;
}
.card a.inline, a.inline {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.card a.inline:hover, a.inline:hover { opacity: .7; }

/* ===================== Education ===================== */
.entry {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}
.entry + .entry { border-top: 1px solid var(--rule); }
.entry h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem; }
.entry .lede { margin: 0 0 1.8rem; }
.entry .lede em { font-style: italic; }
.subhead {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: .95rem;
  margin: 1.6rem 0 .8rem;
}
.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li {
  position: relative;
  padding-left: 1.1rem;
  margin: .45rem 0;
  font-size: .95rem;
}
.bullets li::before { content: "·"; position: absolute; left: 0; font-weight: 700; }
.map {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  filter: grayscale(1);
  background: var(--light);
}

/* ===================== Experience ===================== */
.job { padding: clamp(2rem, 4vw, 3rem) 0; }
.job + .job { border-top: 1px solid var(--rule); }
.job-head, .role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.job-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.job-loc, .role-date { font-style: italic; font-size: .9rem; color: var(--ink); white-space: nowrap; }
.role { margin-top: 2.2rem; }
.role-title { font-family: var(--heading-font); font-weight: 700; font-size: 1rem; }
.role .bullets { margin-top: 1rem; }

/* ===================== Skills ===================== */
.skill { padding: clamp(1.4rem, 3vw, 2.2rem) 0; }
.skill h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .9rem; }
.skill p { margin: 0; max-width: 70ch; }
.skill .bullets { max-width: 70ch; }
.two-col { columns: 2; column-gap: 3rem; }
.two-col li { break-inside: avoid; }

/* ===================== Professional Interests ===================== */
.interests { max-width: 900px; }
.interest { padding: clamp(1.3rem, 3vw, 2rem) 0; }
.interest h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .7rem; }
.interest p { margin: 0; max-width: 70ch; }

/* ===================== Galleries (Maker / Mechanic) ===================== */
.gallery-section { max-width: 760px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) 0; }

/* Carousel (Maker) */
.carousel { position: relative; }
.carousel-track { position: relative; }
.slide { display: none; }
.slide.active { display: block; }
.slide img { width: 100%; height: auto; margin: 0 auto; }
.carousel-cap, .photo-cap {
  text-align: center;
  font-size: .9rem;
  color: var(--ink);
  margin-top: 1.1rem;
  line-height: 1.5;
}
.carousel-cap a, .photo-cap a { color: var(--link); text-decoration: underline; }
.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 2rem;
  color: #555;
  padding: .5rem .8rem;
  line-height: 1;
  transition: color .15s ease;
  z-index: 2;
}
.car-btn:hover { color: var(--black); }
.car-prev { left: -3.2rem; }
.car-next { right: -3.2rem; }
.car-dots { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; }
.car-dots button {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0;
  background: #cfcfcf; cursor: pointer;
}
.car-dots button.active { background: var(--black); }

/* Mechanic — stacked captioned photos */
.photo-block { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.photo-block img { width: 100%; height: auto; }

/* ===================== Photographer — grid ===================== */
.photo-grid {
  columns: 3;
  column-gap: 14px;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}
.photo-grid img {
  width: 100%;
  height: auto;
  margin: 0 0 14px;
  break-inside: avoid;
  cursor: zoom-in;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center; z-index: 100;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; width: auto; height: auto; }
.lightbox .lb-close {
  position: absolute; top: 1rem; right: 1.5rem; color: #fff;
  font-size: 2rem; background: none; border: 0; cursor: pointer;
}
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 3rem; background: none; border: 0; cursor: pointer; padding: 1rem;
}
.lb-prev { left: .5rem; } .lb-next { right: .5rem; }

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .nav { gap: 1.2rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .entry { grid-template-columns: 1fr; }
  .map { max-width: 420px; aspect-ratio: 16/10; }
  .photo-grid { columns: 2; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.4rem;
    padding: 5rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,.12);
    z-index: 50;
  }
  .nav.open { transform: translateX(0); }
  .nav a { font-size: 1.1rem; }
  .btn-resume { margin-top: .5rem; }

  .hero { grid-template-columns: 1fr; text-align: center; gap: 2rem; min-height: auto; }
  .hero-words { text-align: center; order: 2; }
  .hero-photo { order: 1; }

  .site-footer { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: .8rem; }
  .footer-mail, .footer-phone { justify-self: center; }

  .car-prev { left: -.5rem; } .car-next { right: -.5rem; }
  .car-btn { background: rgba(255,255,255,.6); border-radius: 50%; }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .photo-grid { columns: 1; }
}

/* Body lock when mobile menu open */
body.menu-open { overflow: hidden; }
