/* =========================================================
   Academic Personal Site CSS (Berkeley-grade, minimal, no “boxes”)
   - Clean dividers + whitespace (no card/boxed sections)
   - Keeps your existing class names and layout logic
   - Fluid type via clamp(), accessible focus states
   ========================================================= */

/* =========================
   Tokens
   ========================= */
:root{
  /* Scale hook (kept from your original) */
  --ui-scale: 1;

  /* Layout widths (kept compatible with your markup) */
  --left-col: calc(260px * var(--ui-scale));
  --headshot-max: calc(230px * var(--ui-scale));
  --col-gap: clamp(18px, calc(60px * var(--ui-scale)), 64px);
  --text-max: calc(640px * var(--ui-scale));
  --block-width: calc(var(--left-col) + var(--col-gap) + var(--text-max));
  --page-pad: clamp(16px, calc(20px * var(--ui-scale)), 28px);

  /* Keep in sync with .nav padding + font size */
  --header-approx-height: calc(64px * var(--ui-scale));

  /* Color system (quiet, academic) */
  --page-bg: #f6f7f9;
  --header-bg: #ffffff;

  --text: #1f2430;
  --muted: #5b6475;

  --border: #e6e8ee;
  --border-strong: #d7dbe6;

  /* Berkeley-ish accents (subtle) */
  --accent: #003262;   /* Berkeley Blue */
  --accent-2: #FDB515; /* Cal Gold */

  /* Controls */
  --btn-bg: #e6e9f0;
  --btn-bg-hover: #e9ecf3;
  --btn-border: #cfd5e6;
  --btn-border-hover: #cfd5e6;

  /* Radii */
  --r-1: 10px;
  --r-2: 14px;
  --r-pill: 999px;

  /* Typography (fluid) */
  --fs-12: clamp(0.78rem, 0.74rem + 0.18vw, 0.85rem);
  --fs-14: clamp(0.88rem, 0.84rem + 0.22vw, 0.97rem);
  --fs-16: clamp(1.00rem, 0.94rem + 0.30vw, 1.08rem);
  --fs-18: clamp(1.12rem, 1.02rem + 0.55vw, 1.30rem);
  --fs-24: clamp(1.45rem, 1.25rem + 1.00vw, 1.85rem);

  /* Spacing */
  --s-1: clamp(6px, 0.6vw, 10px);
  --s-2: clamp(10px, 1.0vw, 14px);
  --s-3: clamp(16px, 1.6vw, 22px);
  --s-4: clamp(24px, 2.2vw, 34px);

  /* Focus */
  --focus: 0 0 0 3px rgba(253, 181, 21, 0.35);

  /* CV scale (kept from your original intent) */
  --cv-scale: 0.794;
}

/* =========================
   Base
   ========================= */
*{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(0, 50, 98, 0.06), transparent 60%),
    var(--page-bg);

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
               "Apple Color Emoji","Segoe UI Emoji";
  font-size: var(--fs-16);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection{
  background: rgba(253, 181, 21, 0.30);
}

/* =========================
   Shared wrapper
   ========================= */
.site-inner{
  max-width: calc(1080px * var(--ui-scale));
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* =========================
   Header / Nav
   ========================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;

  background: color-mix(in srgb, var(--header-bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.1) blur(10px);
}

.nav{
  max-width: var(--block-width);
  margin: 0 auto;
  padding: calc(14px * var(--ui-scale)) 0;

  display: flex;
  justify-content: center;
}

.nav-links{
  display: flex;
  justify-content: center;
  gap: clamp(80px, 3vw, 66px);
  flex-wrap: wrap;
}

.nav-link{
  padding: calc(7px * var(--ui-scale)) calc(12px * var(--ui-scale));
  font-size: var(--fs-14);
  border-radius: var(--r-pill);
  border: 1px solid transparent;

  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.nav-link:hover{
  background: var(--btn-bg);
  border-color: var(--btn-border);
}

.nav-link.active{
  background: color-mix(in srgb, var(--accent) 10%, var(--btn-bg));
  border-color: color-mix(in srgb, var(--accent) 18%, var(--btn-border));
}

.nav-link:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}

/* =========================
   Sections
   ========================= */
.page-section{
  background: transparent;
  min-height: calc(100vh - var(--header-approx-height));
}

/* =========================
   About
   ========================= */
.about-section{
  min-height: calc(100vh - var(--header-approx-height));
  padding: clamp(40px, 5vw, 70px) 0;
}

.about-container{
  max-width: var(--block-width);
  margin: 0 auto;

  display: flex;
  gap: var(--col-gap);
  align-items: center;
}

.about-left{
  flex: 0 0 var(--left-col);
  text-align: center;
}

.headshot{
  max-width: var(--headshot-max);
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto calc(18px * var(--ui-scale)) auto;

  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.10), 0 2px 2px rgba(16, 24, 40, 0.06);
}

/* Icon buttons (kept, but minimal) */
.button-row{
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 18px);
  flex-wrap: wrap;
}

.icon-button{
  width: calc(34px * var(--ui-scale));
  height: calc(34px * var(--ui-scale));
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-1);
  padding: calc(7px * var(--ui-scale));
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.icon-button img{
  filter: invert(1) brightness(0.22);
  width: calc(18px * var(--ui-scale));
  height: calc(18px * var(--ui-scale));
}

.icon-button:hover{
  background: var(--btn-bg-hover);
  border-color: var(--btn-border-hover);
  transform: translateY(-1px);
}

.icon-button:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}

.icon-button:active{
  transform: translateY(0);
}

.about-right{
  flex: 0 0 var(--text-max);
  max-width: var(--text-max);
}

.name{
  margin: 0 0 4px 0;
  font-size: var(--fs-24);
  font-weight: 740;
  letter-spacing: -0.02em;
}

.subtitle{
  margin-top: -8px;
  margin-bottom: -4px;
  font-size: var(--fs-18);
  color: var(--muted);
}

.about-right p:not(.subtitle){
  margin: 12px 0 0 0;
  font-size: 16px;
  line-height: 1.75;
  text-align: justify;
}

.about-right a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.about-right a:hover,
.about-right a:focus-visible{
  text-decoration-thickness: 2px;
}

.about-right a:focus-visible{
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

/* =========================
   Contact (no boxes)
   ========================= */
.contact-section{
  min-height: calc(100vh - var(--header-approx-height));
  padding: clamp(40px, 5vw, 70px) 0;
}

.contact-container{
  max-width: var(--block-width);
  margin: 0 auto;
}

.contact-header{
  margin: 0 0 var(--s-3) 0;
}

.contact-title{
  margin: 0 0 6px 0;
  font-size: var(--fs-24);
  font-weight: 740;
  letter-spacing: -0.02em;
  color: var(--text);
}

.contact-subtitle{
  margin: 0;
  font-size: var(--fs-14);
  color: var(--muted);
  line-height: 1.6;
  max-width: 70ch;
}

.contact-grid{
  display: flex;
  gap: var(--col-gap);
  align-items: flex-start;
}

.contact-left{
  flex: 0 0 var(--left-col);
}

/* Divider-based info rows */
.contact-row{
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.contact-row:last-child{
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-label{
  font-size: var(--fs-14);
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 6px;
}

.contact-value{
  font-size: var(--fs-16);
  color: var(--text);
}

.contact-value:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-right{
  flex: 0 0 var(--text-max);
  max-width: var(--text-max);
}

/* Form: no outer container, clean fields */
.contact-form{
  display: grid;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
}

.contact-form input,
.contact-form textarea{
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-16);
  color: var(--text);

  background: rgba(255,255,255,0.70);
  border: 1px solid transparent;
  border-bottom: 1px solid var(--btn-border-hover);
  border-radius: 12px;
  padding: 10px 12px;

  outline: none;
  transition: background-color 0.15s ease, border-bottom-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-form textarea{
  resize: vertical;
  min-height: 150px;
}

.contact-form input:focus,
.contact-form textarea:focus{
  background: #fff;
  border-bottom-color: color-mix(in srgb, var(--accent) 55%, var(--btn-border-hover));
  box-shadow: var(--focus);
}

.contact-actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  margin-top: 6px;
  padding-top: var(--s-2);
  border-top: 1px solid var(--border);
}

.contact-note{
  margin: 0;
  font-size: var(--fs-12);
  color: var(--muted);
  line-height: 1.45;
  max-width: 70%;
}

.contact-submit{
  padding: 9px 14px;
  font-family: inherit;
  font-size: var(--fs-14);
  border-radius: 12px;

  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 10%, #fff),
    var(--btn-bg)
  );
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--btn-border));
  color: var(--text);

  cursor: pointer;
  white-space: nowrap;

  transition: transform 0.12s ease, background-color 0.15s ease,
              border-color 0.15s ease, opacity 0.15s ease;
}

.contact-submit:hover,
.contact-submit:focus-visible{
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 14%, #fff),
    var(--btn-bg-hover)
  );
  border-color: color-mix(in srgb, var(--accent) 22%, var(--btn-border-hover));
  transform: translateY(-1px);
}

.contact-submit:active{ transform: translateY(0); }

.contact-submit:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}

.contact-submit[disabled]{
  cursor: not-allowed;
  opacity: 0.6;
}

.contact-error{
  margin: 6px 0 0 0;
  font-size: var(--fs-12);
  color: #b00020;
  min-height: 1em;
}

.contact-thankyou-wrapper{
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.contact-thankyou{
  margin: 0;
  font-size: var(--fs-18);
  color: var(--text);
  text-align: center;
}

/* Screen-reader only */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   CV (no boxes)
   ========================= */
.cv-section{
  min-height: calc(100vh - var(--header-approx-height));
  padding: clamp(40px, 5vw, 70px) 0;
}

.cv-container{
  max-width: var(--block-width);
  margin: 0 auto;
}

.cv-title{
  margin: 0 0 6px 0;
  font-size: var(--fs-24);
  font-weight: 740;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cv-block{
  margin-top: 8px;
}

.cv-heading{
  margin: 0 0 calc(14px * var(--ui-scale) * var(--cv-scale)) 0;
  font-size: calc(26px * var(--ui-scale) * var(--cv-scale));
  font-weight: 800;
  color: var(--text);

  padding-bottom: calc(10px * var(--ui-scale) * var(--cv-scale));
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}

/* Skills two-col */
.cv-two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(34px * var(--ui-scale) * var(--cv-scale));
}

.cv-list{
  margin: 0;
  padding-left: calc(18px * var(--ui-scale) * var(--cv-scale));
}

.cv-list li{
  margin: 0 0 calc(10px * var(--ui-scale) * var(--cv-scale)) 0;
  font-size: calc(16px * var(--ui-scale) * var(--cv-scale));
  line-height: 1.65;
}

/* Entries: divider-based */
.cv-entry{
  margin: calc(18px * var(--ui-scale) * var(--cv-scale)) 0 0 0;
  padding: 0 0 calc(18px * var(--ui-scale) * var(--cv-scale)) 0;
  border-bottom: 1px solid var(--border);
}

.cv-entry:last-child{
  padding-bottom: 0;
  border-bottom: 0;
}

.cv-entry-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(16px * var(--ui-scale) * var(--cv-scale));
}

.cv-org{
  margin: 0;
  font-size: calc(20px * var(--ui-scale) * var(--cv-scale));
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.cv-dates{
  margin: 0;
  white-space: nowrap;
  font-size: calc(14px * var(--ui-scale) * var(--cv-scale));
  line-height: 1.6;
  color: var(--muted);
  font-weight: 450;
}

.cv-role{
  margin: calc(6px * var(--ui-scale) * var(--cv-scale)) 0 0 0;
  font-size: calc(17px * var(--ui-scale) * var(--cv-scale));
  line-height: 1.6;
  color: var(--text);
}

.cv-bullets{
  margin: calc(10px * var(--ui-scale) * var(--cv-scale)) 0 0 0;
  padding-left: calc(28px * var(--ui-scale) * var(--cv-scale));
}

.cv-bullets li{
  margin: 0 0 calc(10px * var(--ui-scale) * var(--cv-scale)) 0;
  font-size: calc(16px * var(--ui-scale) * var(--cv-scale));
  line-height: 1.65;
}

/* =========================
   Projects (single column, subtle polish)
   - If you want “no boxes” here too, say so and I’ll convert.
   ========================= */
.projects-section{
  min-height: calc(100vh - var(--header-approx-height));
  padding: clamp(40px, 5vw, 70px) 0;
}

.projects-container{
  max-width: var(--block-width);
  margin: 0 auto;
}

/* Page header for Projects (matches CV/Contact title rhythm) */
.projects-header{
  margin: 0 0 var(--s-3) 0; /* same vertical rhythm as contact-header */
}

/* Make the first section title sit flush under the page header */
.projects-header + .projects-block{
  margin-top: 0;
}

/* Page title ("Projects") */
.projects-page-title{
  margin: 0 0 6px 0;
  font-size: var(--fs-24);
  font-weight: 740;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Section titles ("Current Projects", etc.) */
.projects-section-title{
  margin: 0 0 6px 0;
  font-size: var(--fs-18); /* <- set smaller than page title */
  font-weight: 760;
  letter-spacing: -0.01em;
  color: var(--text);
}

.projects-subtitle{
  margin: 0 0 var(--s-3) 0;
  font-size: var(--fs-14);
  color: var(--muted);
  line-height: 1.6;
  max-width: 70ch;
}

.projects-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Kept as cards for scannability; convert to dividers if desired */
.project-card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 16px;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04), 0 2px 10px rgba(16, 24, 40, 0.06);
}

.project-card:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 14%, var(--border-strong));
  box-shadow: 0 2px 2px rgba(16, 24, 40, 0.06), 0 12px 28px rgba(16, 24, 40, 0.10);
}

.project-name{
  margin: 0 0 8px 0;
  font-size: var(--fs-14);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.project-desc{
  margin: 0 0 8px 0;
  font-size: var(--fs-12);
  line-height: 1.7;
  text-align: left;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
}

.projects-block{ margin-top: var(--s-4); }
.projects-block > .projects-title{ margin-bottom: var(--s-2); }
.projects-block--spaced{ margin-top: calc(var(--s-4) * 1.35); }

.project-desc a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-desc a:hover,
.project-desc a:focus-visible{
  text-decoration-thickness: 2px;
}

.project-desc a:focus-visible{
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

/* =========================
   Reduced motion
   ========================= */
@media (prefers-reduced-motion: reduce){
  *{
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 820px){
  :root{ --ui-scale: 1; }

  .nav{
    max-width: 100%;
    padding: 12px 0;
    justify-content: flex-start;
  }

  .nav-links{
    justify-content: flex-start;
    gap: 10px;
  }

  .about-section{
    padding: 34px 0;
    min-height: auto;
  }

  .about-container{
    max-width: 100%;
    flex-direction: column;
    gap: 22px;
    align-items: center;
  }

  .about-right{
    width: 100%;
    max-width: 680px;
  }

  .contact-section{
    padding: 34px 0;
    min-height: auto;
  }

  .contact-grid{
    flex-direction: column;
    gap: 18px;
  }

  .contact-left,
  .contact-right{
    flex: 1 1 auto;
    max-width: 680px;
  }

  .contact-actions{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .contact-note{ max-width: 100%; }
  .contact-submit{ align-self: flex-end; }

  .cv-section{
    padding: 34px 0;
    min-height: auto;
  }

  .cv-two-col{
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cv-entry-head{
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .cv-dates{ white-space: normal; }

  .projects-section{
    padding: 34px 0;
    min-height: auto;
  }
}
/* =========================================================
   Enhancement Layer (original theme preserved)
   - subtle motion, stronger interactions
   - projects layout upgraded (first-pass card layout feel)
   ========================================================= */

html{
  scroll-behavior: smooth;
}

.site-header{
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.nav-link{
  position: relative;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.16s ease, color 0.18s ease;
}

.nav-link::after{
  display: none;
}

.nav-link:hover::after,
.nav-link.active::after{
  opacity: 0;
  transform: none;
}

.nav-link.active::after{
  opacity: 0;
}

.headshot{
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.headshot:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12), 0 2px 3px rgba(16, 24, 40, 0.06);
}

.about-right p:not(.subtitle){
  border-radius: 10px;
  transition: none;
}

.about-right p:not(.subtitle):hover{
  background: transparent;
  box-shadow: none;
  transform: none;
}

.contact-right{
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 14px;
  background: rgba(255,255,255,0.52);
  box-shadow: 0 1px 1px rgba(16,24,40,0.02);
}

.contact-row{
  transition: border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.contact-row:hover{
  transform: translateX(2px);
  border-bottom-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.contact-form input,
.contact-form textarea{
  transition: background-color 0.18s ease, border-bottom-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.contact-form input:hover,
.contact-form textarea:hover{
  background: rgba(255,255,255,0.86);
}

.contact-submit{
  transition: transform 0.16s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(16,24,40,0.06);
}

.contact-submit:hover,
.contact-submit:focus-visible{
  box-shadow: 0 8px 20px rgba(16,24,40,0.10);
}

.cv-entry{
  transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.cv-entry:hover{
  border-bottom-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
}

/* CV page: disable hover movement */
.cv-page .cv-entry{
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.cv-page .cv-entry:hover{
  transform: none;
}

.cv-page .nav-link{
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.projects-header .projects-subtitle{
  margin-bottom: 0;
}

.projects-header + .cv-block{
  margin-top: 0;
}

.cv-header .projects-subtitle{
  margin-bottom: 0;
}

.cv-header .projects-subtitle em{
  margin-top: 0;
}

.contact-right{
  padding: 14px 14px 12px;
}

.contact-error{
  display: none;
  margin: 2px 0 0 0;
  min-height: 0;
}

.contact-error:not(:empty){
  display: block;
  margin-top: 6px;
  min-height: 1em;
}

/* Projects page: keep original palette, upgrade layout and movement */
.projects-header{
  margin: 0 0 var(--s-4) 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(0, 50, 98, 0.06), transparent 72%),
    radial-gradient(320px 160px at 0% 100%, rgba(253, 181, 21, 0.08), transparent 72%),
    rgba(255,255,255,0.72);
  box-shadow: 0 1px 1px rgba(16,24,40,0.03), 0 10px 24px rgba(16,24,40,0.05);
}

.projects-header + .projects-block{
  margin-top: 0;
}

.projects-page-title{
  margin-bottom: 8px;
}

.projects-subtitle em{
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
}

.projects-block{
  margin-top: clamp(26px, 3vw, 38px);
}

.projects-section-title{
  display: block;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.projects-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card{
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease;
}

.project-card::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, transparent), color-mix(in srgb, var(--accent-2) 55%, transparent));
  opacity: 0.7;
}

.project-card::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px 120px at 100% 0%, rgba(0,50,98,0.045), transparent 70%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.project-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 14%, var(--border-strong));
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.10), 0 2px 2px rgba(16, 24, 40, 0.05);
}

.project-card:hover::after{
  opacity: 1;
}

.project-name{
  position: relative;
  z-index: 1;
}

.project-desc{
  position: relative;
  z-index: 1;
}

/* subtle page-load motion inspired by portfolio sites; disabled for reduced motion */
@media (prefers-reduced-motion: no-preference){
  .about-left,
  .about-right,
  .contact-header,
  .contact-left,
  .contact-right,
  .cv-title,
  .cv-block,
  .projects-header,
  .projects-block{
    opacity: 0;
    transform: translateY(10px);
    animation: fade-rise 560ms cubic-bezier(.2,.8,.2,1) forwards;
  }

  .about-right{ animation-delay: 90ms; }
  .contact-left{ animation-delay: 70ms; }
  .contact-right{ animation-delay: 130ms; }
  .cv-block:nth-of-type(1){ animation-delay: 60ms; }
  .cv-block:nth-of-type(2){ animation-delay: 100ms; }
  .cv-block:nth-of-type(3){ animation-delay: 140ms; }
  .projects-header{ animation-delay: 40ms; }
  .projects-block:nth-of-type(1){ animation-delay: 80ms; }
  .projects-block:nth-of-type(2){ animation-delay: 120ms; }
  .projects-block:nth-of-type(3){ animation-delay: 160ms; }

  .projects-grid .project-card{
    opacity: 0;
    transform: translateY(8px);
    animation: fade-rise 520ms cubic-bezier(.2,.8,.2,1) forwards;
  }

  .projects-grid .project-card:nth-child(1){ animation-delay: 120ms; }
  .projects-grid .project-card:nth-child(2){ animation-delay: 160ms; }
  .projects-grid .project-card:nth-child(3){ animation-delay: 200ms; }
  .projects-grid .project-card:nth-child(4){ animation-delay: 240ms; }
  .projects-grid .project-card:nth-child(5){ animation-delay: 280ms; }

  .nav-link,
  .icon-button,
  .contact-submit,
  .project-card{
    will-change: transform;
  }
}

@keyframes fade-rise{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 820px){
  .projects-header{
    padding: 14px;
  }

  .projects-section-title{
    margin-bottom: 10px;
  }

  .contact-right{
    padding: 12px 12px 7px;
  }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}
