/* ============================================
   MICHAEL RAFFANELLO — PORTFOLIO
   Typography: Instrument Serif (display) + DM Sans (body)
   Palette: Off-white, warm sand, near-black, electric blue
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300;1,9..40,400&display=swap');

/* ---- TOKENS ---- */
:root {
  --black:      #0F0F0E;
  --white:      #FAFAF8;
  --sand:       #EAE4DA;
  --sand-dark:  #D4CBBC;
  --blue:       #2D4EFF;
  --blue-dark:  #1A36E0;
  --muted:      #6E6B63;
  --card-bg:    #FFFFFF;

  --nav-h: 64px;
  --max-w: 1080px;
  --section-pad: clamp(3.5rem, 7vw, 6rem);

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius:    6px;
  --radius-lg: 14px;
  --shadow:    0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.07), 0 12px 32px rgba(0,0,0,0.09);
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --t:         0.2s;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
p { max-width: 64ch; }

/* ---- CORE TYPE ---- */
h1, h2, h3, h4 {
  font-family: var(--font-body);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 2.5vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 0.9rem; font-weight: 600; }

/* Homepage Welcome heading — bold sans, no serif */
.hero-heading {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--black);
}

/* Blog post titles — serif but sized conservatively */
.post-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: 0;
  max-width: 22ch;
}

/* ---- LAYOUT ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

/* ---- NAV ---- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,248,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sand);
  height: var(--nav-h);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav-logo .blue-sq {
  width: 9px; height: 9px;
  background: var(--blue);
  flex-shrink: 0;
  border-radius: 1px;
}
.nav-logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--black);
}
.nav-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--sand-dark);
}
.nav-links {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: center;
}
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--t) var(--ease);
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--blue);
  transition: width var(--t) var(--ease);
}
.nav-links a:hover { color: var(--black); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--black); }
.nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--black);
  border-radius: 2px;
}
.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--white);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
}
.nav-mobile a.active { color: var(--blue); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 100px;
  transition: all var(--t) var(--ease);
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(45,78,255,0.28);
}
.btn-outline {
  background: transparent;
  color: var(--black);
  border-color: rgba(15,15,14,0.3);
}
.btn-outline:hover {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
  transform: translateY(-1px);
}

/* ---- PAGE HERO ---- */
.page-hero {
  background: var(--sand);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}
.page-hero .page-hero-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.page-hero .page-hero-title .blue-sq {
  width: 14px; height: 14px;
  background: var(--blue);
  flex-shrink: 0;
  border-radius: 2px;
}
.page-hero p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 52ch;
}
.page-hero .btn { margin-top: 1.5rem; }

/* ---- LABELS ---- */
.label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

/* ---- FOOTER ---- */
footer {
  background: var(--black);
  color: var(--white);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.footer-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}
.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-end;
}
.footer-contacts a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--t);
}
.footer-contacts a:hover { color: #fff; }
.footer-contacts .linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.footer-contacts .linkedin-link svg {
  width: 14px; height: 14px;
  fill: rgba(255,255,255,0.5);
}
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
}

/* ---- ANIMATIONS — tightly scoped ---- */
.fade-up-item {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 0.55s var(--ease) forwards;
}
.fade-up-item:nth-child(1) { animation-delay: 0.05s; }
.fade-up-item:nth-child(2) { animation-delay: 0.12s; }
.fade-up-item:nth-child(3) { animation-delay: 0.19s; }
.fade-up-item:nth-child(4) { animation-delay: 0.26s; }
.fade-up-item:nth-child(5) { animation-delay: 0.33s; }
@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ============================================
   HOME PAGE
   ============================================ */
.hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.hero-card {
  background: var(--sand);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}
.hero-photo {
  width: 128px; height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.8);
  box-shadow: var(--shadow);
}
.hero-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-card-rule {
  width: 28px; height: 2px;
  background: var(--blue);
  margin: 0 auto;
}
.hero-card-title {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.hero-card-linkedin a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--blue);
  font-weight: 500;
  transition: opacity var(--t);
}
.hero-card-linkedin a:hover { opacity: 0.7; }
.hero-card-linkedin svg { width: 14px; height: 14px; fill: currentColor; }

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.hero-tagline {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}
.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.hero-bio {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 58ch;
}
.testimonials {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hero-testimonial {
  padding: 1rem 1.25rem;
  border-left: 2.5px solid var(--blue);
  background: var(--sand);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.hero-testimonial blockquote {
  font-size: 0.9rem;
  color: var(--black);
  line-height: 1.65;
  font-style: italic;
  max-width: 100%;
}
.hero-testimonial cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.77rem;
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

/* ============================================
   RESUME PAGE
   ============================================ */
.resume-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0 var(--section-pad);
}
.resume-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-section {
  background: var(--sand);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}
.sidebar-section > h3 {
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.85rem;
}
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.skill-tag {
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.27rem 0.65rem;
  background: var(--white);
  border: 1px solid var(--sand-dark);
  border-radius: 100px;
  color: var(--black);
  line-height: 1.5;
}
.sidebar-cta {
  background: var(--blue);
  color: #fff;
}
.sidebar-cta > h3 { color: rgba(255,255,255,0.55); }
.sidebar-cta p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
  max-width: 100%;
  line-height: 1.55;
}
.sidebar-cta .btn {
  background: #fff;
  color: var(--blue);
  border-color: #fff;
  font-size: 0.78rem;
  padding: 0.55rem 1.1rem;
}
.sidebar-cta .btn:hover { background: rgba(255,255,255,0.9); transform: translateY(-1px); }

.resume-section { margin-bottom: 3rem; }
.resume-section:last-child { margin-bottom: 0; }
.resume-section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.75rem;
}

.timeline { display: flex; flex-direction: column; }
.timeline-item {
  position: relative;
  padding: 0 0 2rem 2.25rem;
  border-left: 1.5px solid var(--sand-dark);
}
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -4.5px; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--white), 0 0 0 4.5px var(--blue);
}
.timeline-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
}
.timeline-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.timeline-logo {
  width: 52px; height: 52px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--sand);
  background: var(--white);
  padding: 4px;
  flex-shrink: 0;
}
.timeline-company {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
}
.timeline-role {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-top: 0.1rem;
}
.timeline-date {
  font-size: 0.77rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.timeline-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
}
.timeline-card ul li {
  font-size: 0.87rem;
  color: var(--black);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.6;
  list-style: none;
}
.timeline-card ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-size: 0.7rem;
  top: 0.22em;
}

.edu-block { display: flex; flex-direction: column; gap: 1rem; }
.edu-item {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
}
.edu-logo {
  height: 26px; width: auto;
  object-fit: contain;
  object-position: left;
  margin-bottom: 0.7rem;
  opacity: 0.8;
}
.edu-school {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 0.2rem;
}
.edu-degree {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.edu-year { font-size: 0.77rem; color: var(--muted); margin-top: 0.2rem; }
.edu-desc {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.65rem;
  line-height: 1.65;
  max-width: 100%;
}

/* ============================================
   PROJECTS PAGE
   ============================================ */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.project-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 248px;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-body {
  padding: 1.6rem 1.85rem;
  border-right: 1px solid var(--sand);
}
.project-industry {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--sand);
  padding: 0.18rem 0.6rem;
  border-radius: 100px;
  margin-bottom: 0.6rem;
}
.project-title {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.9rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.project-section-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}
.project-section-label:first-of-type { margin-top: 0; }
.project-body ul {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  list-style: none;
  padding: 0;
}
.project-body ul li {
  font-size: 0.845rem;
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
  color: var(--black);
  list-style: none;
}
.project-body ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--muted);
}
.project-results ul li::before {
  content: '✓';
  color: #16a34a;
  font-size: 0.7rem;
  top: 0.15em;
}
.project-image {
  overflow: hidden;
  background: var(--sand);
  display: flex;
  align-items: flex-start;
  cursor: zoom-in;
}
.project-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top;
  transition: transform 0.45s var(--ease);
  display: block;
}
.project-card:hover .project-image img { transform: scale(1.02); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(90vw, 900px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--t);
}
.lightbox-close:hover { opacity: 1; }

/* ============================================
   BLOG PAGE
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.blog-card-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sand);
}
.blog-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body {
  padding: 1.3rem 1.45rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.blog-meta .dot { opacity: 0.35; }
.blog-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--black);
  letter-spacing: -0.02em;
}
.blog-card-excerpt {
  font-size: 0.845rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  max-width: 100%;
}
.blog-read-more {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  transition: gap var(--t) var(--ease);
}
.blog-card:hover .blog-read-more { gap: 0.5rem; }

/* ============================================
   BLOG POST PAGE
   ============================================ */
.post-header {
  padding: clamp(2.5rem, 5vw, 4rem) 0 1.75rem;
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.5rem;
  transition: color var(--t);
}
.post-back:hover { color: var(--blue); }
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.post-meta .dot { opacity: 0.35; }
.post-hero-img {
  width: 100%;
  aspect-ratio: 21 / 8;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0 2.25rem;
}
.post-content {
  max-width: 680px;
  padding-bottom: var(--section-pad);
}
.post-content p {
  margin-bottom: 1.1rem;
  font-size: 1rem;
  line-height: 1.8;
  color: #2a2a28;
  max-width: 100%;
}
.post-content h2 { margin: 2rem 0 0.7rem; font-size: 1.2rem; }
.post-content h3 { margin: 1.65rem 0 0.55rem; font-size: 1rem; }
.post-content ul,
.post-content ol {
  padding-left: 1.25rem;
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { font-size: 1rem; line-height: 1.75; max-width: 64ch; }
.post-content em { font-style: italic; }
.post-content strong { font-weight: 600; }
.post-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-wrap { padding: var(--section-pad) 0; }
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.contact-info h2 { margin-bottom: 0.75rem; }
.contact-info > p {
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 2rem;
  max-width: 42ch;
}
.contact-details { display: flex; flex-direction: column; gap: 0.85rem; }
.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
}
.contact-detail .icon {
  width: 36px; height: 36px;
  background: var(--sand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-detail .icon svg { width: 15px; height: 15px; }
.contact-detail a { transition: color var(--t); }
.contact-detail a:hover { color: var(--blue); }

.contact-form-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.06);
}
.contact-form-card h3 { font-size: 1.05rem; margin-bottom: 1.4rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.form-group label {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--black);
}
.form-group input,
.form-group textarea {
  padding: 0.65rem 0.95rem;
  border: 1.5px solid var(--sand-dark);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--black);
  background: var(--white);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  width: 100%;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(110,107,99,0.45); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45,78,255,0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-submit {
  width: 100%;
  justify-content: center;
  padding: 0.85rem;
  font-size: 0.84rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-bottom: 3.5rem;
  }
  .hero-card {
    flex-direction: row;
    text-align: left;
    gap: 1.5rem;
    padding: 1.4rem 1.6rem;
    max-width: 500px;
  }
  .hero-photo { width: 86px; height: 86px; flex-shrink: 0; }
  .hero-card-rule { margin: 0; }

  .resume-layout {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
  }
  .resume-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .project-card { grid-template-columns: 1fr; }
  .project-body { border-right: none; border-bottom: 1px solid var(--sand); }
  .project-image { min-height: unset; }

  .contact-layout { grid-template-columns: 1fr; }
}

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

  .hero-card {
    flex-direction: column;
    text-align: center;
    max-width: 100%;
  }
  .contact-wrap {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
} 
  .hero-card-rule { margin: 0 auto; }

  .resume-sidebar { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-contacts { align-items: flex-start; }
  .post-hero-img { aspect-ratio: 16 / 9; }
  .post-title { max-width: 100%; }
}
