/* ============================================================
   Hossein Zandinejad — Portfolio
   Design language: systems built in blocks.
   Rectangular blocks with hard offset shadows (not soft card
   shadows), pulled from the hero photo's palette: night-navy,
   lamp amber, brick red, plant green.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root{
  --ink:        #171B26;
  --ink-soft:   #2A2F3F;
  --paper:      #F5EEDD;
  --paper-dim:  #ECE2C8;
  --paper-line: #DCCFA9;
  --amber:      #E8A23A;
  --amber-dark: #C97F1E;
  --brick:      #C2402B;
  --leaf:       #5C8F5B;
  --slate:      #565B6B;
  --indigo:     #6C5CE7;  /* Neuraft AI Studio accent */
  --indigo-dark:#5B4BD6;

  --shadow-ink:    6px 6px 0 var(--ink);
  --shadow-amber:  6px 6px 0 var(--amber);
  --shadow-brick:  6px 6px 0 var(--brick);
  --shadow-indigo: 6px 6px 0 var(--indigo);

  --max: 1160px;
  --gap: 1.5rem;

  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

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

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a{ color: inherit; }

h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1{ font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 700; }
h2{ font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3{ font-size: 1.25rem; }

p{ margin: 0 0 1em; max-width: 62ch; color: var(--ink-soft); }

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

:focus-visible{
  outline: 3px solid var(--amber-dark);
  outline-offset: 2px;
}

/* ---------- stud accent ---------- */
.stud{
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--amber);
  margin-right: 0.6em;
  flex-shrink: 0;
  transform: translateY(-0.05em);
}
.stud.brick{ background: var(--brick); }
.stud.leaf{ background: var(--leaf); }
.stud.indigo{ background: var(--indigo); }

/* ---------- nav ---------- */
.site-header{
  background: var(--ink);
  color: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}
.brand{
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--paper);
}
.brand-mark{
  width: 2.15rem;
  height: 2.15rem;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.brand-mark::after{
  content: '';
  position: absolute;
  top: -4px; right: -4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brick);
}
.brand-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  white-space: nowrap;
}
.brand-role{
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--paper-line);
  margin-top: 0.1rem;
}

.nav-links{
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a{
  text-decoration: none;
  color: var(--paper-line);
  font-size: 0.98rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-links a:hover{ color: var(--paper); }
.nav-links a.active{
  color: var(--paper);
  border-bottom-color: var(--amber);
}

.nav-toggle{
  display: none;
  background: none;
  border: none;
  color: var(--paper);
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle svg{ width: 26px; height: 26px; }

@media (max-width: 760px){
  .nav-links{
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  .nav-links.open{ max-height: 300px; }
  .nav-links li{ width: 100%; }
  .nav-links a{
    display: block;
    width: 100%;
    padding: 0.9rem 1.75rem;
    border-bottom: 1px solid var(--ink-soft);
    border-left: 3px solid transparent;
  }
  .nav-links a.active{ border-left-color: var(--amber); border-bottom-color: var(--ink-soft); }
  .nav-toggle{ display: block; }
}

/* ---------- buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border: 2px solid var(--ink);
  background: var(--amber);
  color: var(--ink);
  box-shadow: var(--shadow-ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover{ transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active{ transform: translate(6px, 6px); box-shadow: none; }

.btn-outline{
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow-brick);
  border-color: var(--ink);
}
.btn-outline:hover{ box-shadow: 3px 3px 0 var(--brick); }

.btn-outline-light{
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
  box-shadow: 6px 6px 0 var(--amber);
}
.btn-outline-light:hover{ box-shadow: 3px 3px 0 var(--amber); }

.btn-row{ display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; }

/* ---------- block component ---------- */
.block{
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-ink);
  padding: 1.8rem;
}

/* ---------- hero ---------- */
.hero{
  background: var(--ink);
  color: var(--paper);
  padding: 4.5rem 0 5rem;
  overflow: hidden;
}
.hero .container{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}
.hero-eyebrow{
  font-family: var(--font-display);
  color: var(--amber);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
}
.hero h1{ color: var(--paper); }
.hero p.lede{
  color: var(--paper-line);
  font-size: 1.12rem;
  max-width: 46ch;
}
.hero-photo-wrap{
  position: relative;
}
.hero-photo{
  border: 3px solid var(--paper);
  box-shadow: 10px 10px 0 var(--amber);
}
@media (max-width: 900px){
  .hero .container{ grid-template-columns: 1fr; }
  .hero-photo-wrap{ order: -1; max-width: 420px; margin: 0 auto; }
}

/* staggered entrance — one orchestrated moment */
.hero-eyebrow, .hero h1, .hero p.lede, .hero .btn-row, .hero-photo-wrap{
  animation: rise .6s ease both;
}
.hero h1{ animation-delay: .08s; }
.hero p.lede{ animation-delay: .16s; }
.hero .btn-row{ animation-delay: .24s; }
.hero-photo-wrap{ animation-delay: .1s; }
@keyframes rise{
  from{ opacity: 0; transform: translateY(16px); }
  to{ opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce){
  .hero-eyebrow, .hero h1, .hero p.lede, .hero .btn-row, .hero-photo-wrap{
    animation: none;
  }
}

/* ---------- section spacing ---------- */
.section{ padding: 4.5rem 0; }
.section-dim{ background: var(--paper-dim); border-top: 2px solid var(--paper-line); border-bottom: 2px solid var(--paper-line); }
.section-head{ max-width: 60ch; margin-bottom: 2.5rem; }
.section-head .stud{ vertical-align: middle; }

/* ---------- stat row ---------- */
.stat-row{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
.stat-block{
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 1.5rem 1.3rem;
  box-shadow: 6px 6px 0 var(--amber);
}
.stat-block .num{
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--amber);
  display: block;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-block .label{ font-size: 0.92rem; color: var(--paper-line); }
@media (max-width: 900px){
  .stat-row{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .stat-row{ grid-template-columns: 1fr; }
}

/* ---------- three-up feature blocks ---------- */
.feature-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.feature-grid .block h3{ margin-bottom: 0.6rem; }
.feature-grid .block:nth-child(1){ box-shadow: 6px 6px 0 var(--amber); }
.feature-grid .block:nth-child(2){ box-shadow: 6px 6px 0 var(--brick); }
.feature-grid .block:nth-child(3){ box-shadow: 6px 6px 0 var(--leaf); }
@media (max-width: 900px){
  .feature-grid{ grid-template-columns: 1fr; }
}

/* ---------- timeline (experience) ---------- */
/* Geometry note: the badge is 48px, so its vertical center sits 24px from
   the top of each .role box, and the connector line is centered under it
   at (48-3)/2 = 22.5px. Roles carry a fixed 40px bottom margin. Each role's
   connector (::after) runs from ITS OWN badge center down to the NEXT
   role's badge center, so the line only ever exists between two real
   badges — never floating above the first one or past the last. */
.timeline{ --badge: 48px; --line-x: 22.5px; }

.role{
  position: relative;
  padding-left: 4.25rem;
  margin-bottom: 40px;
}
.role:last-child{ margin-bottom: 0; }

.role:not(:last-child)::after{
  content: '';
  position: absolute;
  left: var(--line-x);
  top: 24px;
  bottom: -64px; /* -(40px gap + 24px next badge center) */
  width: 3px;
  background: var(--paper-line);
  z-index: 0;
}

.role-badge{
  position: absolute;
  left: 0; top: 0;
  width: var(--badge); height: var(--badge);
  background: #fff;
  border: 2px solid var(--ink);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.role-badge img{
  width: 100%; height: 100%;
  object-fit: contain;
}
.role-badge.badge-dark{ background: var(--ink); }

.role.current .role-badge{
  border-color: var(--brick);
  box-shadow: 3px 3px 0 var(--brick);
}

.role-head{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.2rem;
}
.role-head h3{ margin: 0; }
.role-dates{
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--slate);
  white-space: nowrap;
}
.role-loc{
  font-size: 0.92rem;
  color: var(--slate);
  margin-bottom: 0.7rem;
}
.role ul{
  margin: 0; padding: 0;
  list-style: none;
}
.role li{
  display: flex;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
  color: var(--ink-soft);
  max-width: 68ch;
}
.role li .stud{ margin-top: 0.55em; }
.role-note{
  font-style: italic;
  color: var(--slate);
  font-size: 0.94rem;
  margin-bottom: 0.8rem;
}

/* ---------- education / cert blocks ---------- */
.edu-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.edu-grid .block h3{ margin-bottom: 0.2rem; }
.edu-grid .meta{ color: var(--slate); font-size: 0.92rem; margin-bottom: 0.9rem; }
.edu-head{
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.edu-logo{
  width: 48px; height: 48px;
  flex-shrink: 0;
  background: #fff;
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
.edu-logo img{ width: 100%; height: 100%; object-fit: contain; }
.edu-head h3{ margin: 0; }
.cert-list{ list-style: none; margin: 0; padding: 0; }
.cert-list li{ display: flex; gap: 0.6rem; margin-bottom: 0.55rem; }
@media (max-width: 760px){ .edu-grid{ grid-template-columns: 1fr; } }

/* ---------- skills page ---------- */
.skill-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.skill-group h3{ margin-bottom: 1rem; }
.tag-row{ display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tag{
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  background: var(--paper-dim);
  border: 1.5px solid var(--ink);
}
.skill-group:nth-child(1){ box-shadow: 6px 6px 0 var(--amber); }
.skill-group:nth-child(2){ box-shadow: 6px 6px 0 var(--brick); }
.skill-group:nth-child(3){ box-shadow: 6px 6px 0 var(--leaf); }
.skill-group:nth-child(4){ box-shadow: 6px 6px 0 var(--amber-dark); }
@media (max-width: 760px){ .skill-grid{ grid-template-columns: 1fr; } }

/* ---------- contact page ---------- */
.contact-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-row{
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1.5px solid var(--paper-line);
  text-decoration: none;
  color: var(--ink);
}
.contact-row:last-child{ border-bottom: none; }
.contact-row .ico{
  width: 2.4rem; height: 2.4rem;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--amber);
  display: flex; align-items: center; justify-content: center;
}
.contact-row .ico svg{ width: 20px; height: 20px; }
.contact-row .txt strong{ display: block; font-family: var(--font-display); font-size: 1rem; }
.contact-row .txt span{ color: var(--slate); font-size: 0.92rem; }
.contact-row.linkable:hover .txt strong{ color: var(--amber-dark); }
@media (max-width: 900px){ .contact-grid{ grid-template-columns: 1fr; } }

/* ---------- AI Studio page ---------- */
.studio-badge{
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--ink-soft);
  border: 1.5px solid var(--indigo);
  padding: 0.3rem 0.85rem 0.3rem 0.3rem;
  margin-bottom: 1.2rem;
}
.studio-badge img{ width: 1.5rem; height: 1.5rem; display: block; }
.studio-badge span{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--paper);
}

.statement{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.4;
  max-width: 48ch;
}
.statement .accent-indigo{ color: var(--indigo); }
.statement .accent-amber{ color: var(--amber); }

.studio-grid .block:nth-child(1){ box-shadow: var(--shadow-amber); }
.studio-grid .block:nth-child(2){ box-shadow: var(--shadow-indigo); }
.studio-grid .block:nth-child(3){ box-shadow: var(--shadow-amber); }
.studio-grid .block:nth-child(4){ box-shadow: var(--shadow-indigo); }
.studio-grid .block h3{
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.studio-grid .block h3 .stud{ width: 0.6em; height: 0.6em; margin: 0; }

.studio-cta{
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-indigo);
  padding: 3rem 2.5rem;
  text-align: center;
}
.studio-cta h2{ color: var(--paper); }
.studio-cta p{ color: var(--paper-line); margin: 0 auto 1.6rem; }
.studio-cta .btn-row{ justify-content: center; margin-top: 0; }

/* ---------- footer ---------- */
.site-footer{
  background: var(--ink);
  color: var(--paper-line);
  padding: 2.6rem 0;
  margin-top: 4rem;
}
.footer-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links{ display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.footer-links a{ color: var(--paper-line); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover{ color: var(--amber); }
.footer-fine{ font-size: 0.82rem; color: #7a7f8f; }
