/* ==========================================================================
   Pavlos Zafiropoulos — Portfolio
   Design System: Editorial Naturalism
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  /* Palette */
  --bg:            #F7F6F3;
  --bg-alt:        #EFEEE9;
  --bg-hero:       #F0F0EB;
  --text:          #1C1917;
  --text-secondary:#57534E;
  --text-muted:    #9C9689;
  --accent:        #1B4332;
  --accent-mid:    #2D6A4F;
  --accent-light:  #40916C;
  --accent-pale:   #D1ECD9;
  --card-bg:       #FFFFFF;
  --border:        #E0DED8;
  --border-light:  #EDEBE6;
  --shadow:        rgba(28, 25, 23, 0.06);
  --shadow-hover:  rgba(28, 25, 23, 0.12);
  --overlay:       rgba(28, 25, 23, 0.55);

  /* Typography scale (modular, 1.25 ratio) */
  --f-xs:    0.75rem;
  --f-sm:    0.875rem;
  --f-base:  1rem;
  --f-md:    1.125rem;
  --f-lg:    1.25rem;
  --f-xl:    1.5rem;
  --f-2xl:   1.875rem;
  --f-3xl:   2.25rem;
  --f-4xl:   3rem;
  --f-5xl:   3.75rem;
  --f-6xl:   4.5rem;

  /* Spacing */
  --s-xs:   0.25rem;
  --s-sm:   0.5rem;
  --s-md:   1rem;
  --s-lg:   1.5rem;
  --s-xl:   2rem;
  --s-2xl:  3rem;
  --s-3xl:  4rem;
  --s-4xl:  6rem;
  --s-5xl:  8rem;

  /* Layout */
  --max-width:     1200px;
  --nav-height:    72px;

  /* Motion */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration:      0.6s;
  --duration-fast: 0.3s;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Sora', sans-serif;
  font-size: var(--f-base);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-mid);
}

::selection {
  background: var(--accent-pale);
  color: var(--accent);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Spectral', serif;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: var(--f-5xl); letter-spacing: -0.02em; }
h2 { font-size: var(--f-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--f-xl); }
h4 { font-size: var(--f-lg); }

p {
  margin-bottom: var(--s-md);
  color: var(--text-secondary);
}

.label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
}

/* --- Utility --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s-xl);
}

.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;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(247, 246, 243, 0.85);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(247, 246, 243, 0.95);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s-xl);
}

.nav__logo {
  font-family: 'Spectral', serif;
  font-size: var(--f-lg);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav__logo:hover {
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-xl);
  list-style: none;
}

.nav__links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding: var(--s-xs) 0;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--duration-fast) var(--ease-out);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--accent);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

.nav__links a.nav__contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-bg) !important;
  background: var(--accent);
  padding: 10px 28px;
  border-radius: 4px;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.nav__links a.nav__contact-link:hover {
  background: var(--accent-mid);
  color: var(--card-bg) !important;
  transform: translateY(-1px);
}

.nav__links a.nav__contact-link::after { display: none !important; }

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 1001;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px auto;
  transition: all var(--duration-fast) var(--ease-out);
  border-radius: 1px;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 45%;
  height: 100%;
  background: var(--bg-hero);
  z-index: 0;
}

/* subtle dot pattern for texture */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border) 0.8px, transparent 0.8px);
  background-size: 32px 32px;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3xl);
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--s-3xl) var(--s-xl);
}

.hero__content {
  padding-right: var(--s-2xl);
}

.hero__label {
  display: inline-block;
  margin-bottom: var(--s-lg);
}

.hero__name {
  font-size: var(--f-6xl);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-lg);
  color: var(--text);
}

.hero__name em {
  font-style: italic;
  color: var(--accent);
}

.hero__rule {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border: none;
  margin-bottom: var(--s-lg);
}

.hero__tagline {
  font-size: var(--f-md);
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--s-xl);
  max-width: 480px;
}

.hero__credentials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-bottom: var(--s-2xl);
}

.hero__credential {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: var(--s-xs) var(--s-sm);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--card-bg);
}

.hero__actions {
  display: flex;
  gap: var(--s-md);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--card-bg);
}

.btn--primary:hover {
  background: var(--accent-mid);
  color: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn--secondary:hover {
  background: var(--accent);
  color: var(--card-bg);
  transform: translateY(-2px);
}

.btn__arrow {
  transition: transform var(--duration-fast) var(--ease-out);
  font-size: 1.1em;
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* Hero portrait */
.hero__portrait-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  /* padding so the offset border has room to breathe */
  padding: 16px 0 16px 16px;
}

.hero__portrait-frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
}

/* Offset accent border behind the image */
.hero__portrait-frame::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -12px;
  right: 12px;
  bottom: 12px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  opacity: 0.3;
}

.hero__portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 10px;
  display: block;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 64px var(--shadow-hover),
              0 8px 24px var(--shadow);
}

/* --- Sections --- */
.section {
  padding: var(--s-5xl) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__header {
  margin-bottom: var(--s-3xl);
}

.section__label {
  display: block;
  margin-bottom: var(--s-sm);
}

.section__title {
  margin-bottom: var(--s-md);
}

.section__subtitle {
  font-size: var(--f-md);
  color: var(--text-secondary);
  max-width: 600px;
}

.section__rule {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border: none;
  margin-top: var(--s-lg);
}

/* --- Credential Strip --- */
.credential-strip {
  background: var(--accent);
  padding: var(--s-lg) 0;
  overflow: hidden;
}

.credential-strip__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3xl);
  flex-wrap: wrap;
}

.credential-strip__item {
  font-family: 'Spectral', serif;
  font-size: var(--f-md);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  font-style: italic;
}

.credential-strip__separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

/* --- Portfolio Cards --- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-xl);
}

.portfolio-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-hover);
  border-color: var(--border);
}

.card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration) var(--ease-out);
}

.card:hover .card__image {
  transform: scale(1.03);
}

.card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(28, 25, 23, 0.05) 100%
  );
  pointer-events: none;
}

.card__type-badge {
  position: absolute;
  top: var(--s-md);
  left: var(--s-md);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-bg);
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 3px;
}

.card__body {
  padding: var(--s-lg) var(--s-xl) var(--s-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__client {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: var(--s-sm);
}

.card__title {
  font-family: 'Spectral', serif;
  font-size: var(--f-xl);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: var(--s-sm);
  color: var(--text);
}

.card__description {
  font-size: var(--f-sm);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: var(--s-lg);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--s-md);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.card__tags {
  display: flex;
  gap: var(--s-xs);
  flex-wrap: wrap;
}

.card__tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  white-space: nowrap;
}

.card__date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-top: var(--s-md);
}

.card__link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.card:hover .card__link svg {
  transform: translateX(3px);
}

/* Card link wrapper */
a.card {
  text-decoration: none;
  color: inherit;
}

a.card:hover {
  color: inherit;
}

/* Featured card (larger, horizontal layout) */
.card--featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.card--featured .card__image-wrap {
  aspect-ratio: unset;
  min-height: 320px;
}

.card--featured .card__body {
  padding: var(--s-2xl);
  justify-content: center;
}

.card--featured .card__title {
  font-size: var(--f-2xl);
}

.card--featured .card__description {
  -webkit-line-clamp: 5;
}

/* --- View All Link --- */
.view-all {
  display: flex;
  justify-content: center;
  margin-top: var(--s-3xl);
}

.view-all__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: var(--s-md) var(--s-xl);
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease-out);
}

.view-all__link:hover {
  background: var(--accent);
  color: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--s-4xl);
  align-items: start;
}

.about__image-wrap {
  position: relative;
}

.about__image {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 12px 40px var(--shadow);
}

.about__image-wrap::after {
  content: '';
  position: absolute;
  bottom: -16px;
  right: -16px;
  width: 60%;
  height: 60%;
  border: 2px solid var(--accent-pale);
  border-radius: 6px;
  z-index: -1;
}

.about__text h2 {
  margin-bottom: var(--s-xl);
}

.about__text p {
  font-size: var(--f-md);
  line-height: 1.75;
  margin-bottom: var(--s-lg);
}

.about__text p:first-of-type {
  font-family: 'Spectral', serif;
  font-size: var(--f-xl);
  line-height: 1.6;
  color: var(--text);
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-top: var(--s-xl);
  padding-top: var(--s-xl);
  border-top: 1px solid var(--border);
}

.about__skill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent-pale);
  border-radius: 3px;
  background: rgba(209, 236, 217, 0.3);
}

/* --- Portfolio Page Filters --- */
.filters {
  display: flex;
  gap: var(--s-sm);
  flex-wrap: wrap;
  margin-bottom: var(--s-2xl);
}

.filter-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: var(--s-sm) var(--s-lg);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--card-bg);
  border-color: var(--accent);
}

/* --- CV Timeline --- */
.cv-intro {
  max-width: 700px;
  margin-bottom: var(--s-3xl);
}

.cv-intro p {
  font-size: var(--f-md);
  line-height: 1.75;
}

.timeline {
  position: relative;
  padding-left: var(--s-3xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--s-3xl);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--s-3xl) + 1px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline__date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: var(--s-sm);
}

.timeline__role {
  font-family: 'Spectral', serif;
  font-size: var(--f-xl);
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

.timeline__org {
  font-size: var(--f-sm);
  color: var(--text-muted);
  margin-bottom: var(--s-md);
  font-style: italic;
}

.timeline__description {
  font-size: var(--f-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.timeline__achievements {
  list-style: none;
  margin-top: var(--s-sm);
}

.timeline__achievements li {
  position: relative;
  padding-left: var(--s-lg);
  font-size: var(--f-sm);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--s-xs);
}

.timeline__achievements li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-pale);
  border: 1.5px solid var(--accent-light);
}

/* Education */
.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xl);
  margin-top: var(--s-3xl);
}

.education-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: var(--s-xl);
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.education-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.education-card__degree {
  font-family: 'Spectral', serif;
  font-size: var(--f-lg);
  font-weight: 500;
  margin-bottom: var(--s-xs);
}

.education-card__school {
  font-size: var(--f-sm);
  color: var(--accent-light);
  margin-bottom: var(--s-xs);
}

.education-card__year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  color: var(--text-muted);
}

/* --- Contact Section --- */
.contact-section {
  background: var(--accent);
  padding: var(--s-5xl) 0;
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.contact__inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.contact__label {
  color: rgba(255, 255, 255, 0.5);
}

.contact__title {
  font-size: var(--f-4xl);
  color: var(--card-bg);
  margin-bottom: var(--s-lg);
}

.contact__text {
  font-size: var(--f-md);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: var(--s-2xl);
}

.contact__links {
  display: flex;
  gap: var(--s-lg);
  align-items: center;
  flex-wrap: wrap;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--card-bg);
  padding: 14px 28px;
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease-out);
}

.contact__link--email {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.contact__link--email:hover {
  background: var(--card-bg);
  color: var(--accent);
  border-color: var(--card-bg);
}

.contact__link--linkedin {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.contact__link--linkedin:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--card-bg);
}

/* --- Footer --- */
.footer {
  background: var(--text);
  padding: var(--s-2xl) 0;
  color: rgba(255, 255, 255, 0.4);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  letter-spacing: 0.04em;
}

.footer__links {
  display: flex;
  gap: var(--s-lg);
  list-style: none;
}

.footer__links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
}

.footer__links a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }
.reveal--delay-5 { transition-delay: 0.5s; }

/* Staggered cards */
.card.reveal:nth-child(1) { transition-delay: 0s; }
.card.reveal:nth-child(2) { transition-delay: 0.1s; }
.card.reveal:nth-child(3) { transition-delay: 0.2s; }
.card.reveal:nth-child(4) { transition-delay: 0.3s; }
.card.reveal:nth-child(5) { transition-delay: 0.35s; }
.card.reveal:nth-child(6) { transition-delay: 0.4s; }

/* Hero stagger */
.hero__content .reveal:nth-child(1) { transition-delay: 0.2s; }
.hero__content .reveal:nth-child(2) { transition-delay: 0.35s; }
.hero__content .reveal:nth-child(3) { transition-delay: 0.45s; }
.hero__content .reveal:nth-child(4) { transition-delay: 0.55s; }
.hero__content .reveal:nth-child(5) { transition-delay: 0.65s; }
.hero__content .reveal:nth-child(6) { transition-delay: 0.75s; }
.hero__content .reveal:nth-child(7) { transition-delay: 0.85s; }

.hero__portrait-wrap.reveal { transition-delay: 0.4s; }

/* --- Page Header (non-home pages) --- */
.page-header {
  padding: calc(var(--nav-height) + var(--s-4xl)) 0 var(--s-3xl);
  background: var(--bg);
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.page-header__title {
  font-size: var(--f-4xl);
  margin-bottom: var(--s-md);
}

.page-header__subtitle {
  font-size: var(--f-md);
  color: var(--text-secondary);
  max-width: 600px;
}

/* --- Skills Grid (CV page) --- */
.skills-section {
  margin-top: var(--s-3xl);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-xl);
}

.skill-group__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-md);
}

.skill-group__list {
  list-style: none;
}

.skill-group__list li {
  font-size: var(--f-sm);
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: var(--s-md);
  position: relative;
}

.skill-group__list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--accent-pale);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root {
    --f-5xl: 3rem;
    --f-6xl: 3.5rem;
    --f-4xl: 2.5rem;
  }

  .hero__inner {
    gap: var(--s-2xl);
  }

  .hero__content {
    padding-right: var(--s-md);
  }

  .hero__portrait-frame {
    max-width: 420px;
  }

  .portfolio-grid--three {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --f-5xl: 2.5rem;
    --f-6xl: 2.75rem;
    --f-4xl: 2rem;
    --f-3xl: 1.75rem;
    --s-5xl: 5rem;
  }

  .nav__links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 246, 243, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-2xl);
    z-index: 999;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    font-size: var(--f-md);
  }

  .nav__toggle {
    display: block;
  }

  .hero::before {
    display: none;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: var(--s-2xl) var(--s-xl);
  }

  .hero__content {
    padding-right: 0;
    order: 2;
  }

  .hero__tagline {
    max-width: 100%;
  }

  .hero__credentials {
    justify-content: center;
  }

  .hero__actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero__portrait-wrap {
    order: 1;
  }

  .hero__portrait-frame {
    max-width: 320px;
  }

  .hero__rule {
    margin-left: auto;
    margin-right: auto;
  }

  .portfolio-grid,
  .portfolio-grid--three {
    grid-template-columns: 1fr;
  }

  .card--featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .card--featured .card__image-wrap {
    min-height: 200px;
    aspect-ratio: 16 / 10;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--s-2xl);
  }

  .education-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .credential-strip__inner {
    gap: var(--s-lg);
  }

  .credential-strip__item {
    font-size: var(--f-sm);
  }

  .contact__title {
    font-size: var(--f-3xl);
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--s-md);
    text-align: center;
  }

  .timeline {
    padding-left: var(--s-2xl);
  }
}

@media (max-width: 480px) {
  :root {
    --f-5xl: 2rem;
    --f-6xl: 2.25rem;
    --s-xl: 1.25rem;
  }

  .hero__portrait-frame {
    max-width: 280px;
  }

  .btn {
    padding: 12px 20px;
    font-size: var(--f-xs);
  }

  .contact__links {
    flex-direction: column;
    width: 100%;
  }

  .contact__link {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Portfolio Detail Pages
   ========================================================================== */

.detail {
  padding-top: calc(var(--nav-height) + var(--s-3xl));
}

.detail__hero {
  position: relative;
  margin-bottom: var(--s-3xl);
}

.detail__hero-image-wrap {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-alt);
}

.detail__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail__back {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-xl);
  transition: color var(--duration-fast) var(--ease-out);
}

.detail__back:hover {
  color: var(--accent);
}

.detail__back svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.detail__back:hover svg {
  transform: translateX(-3px);
}

.detail__meta-bar {
  display: flex;
  align-items: center;
  gap: var(--s-lg);
  flex-wrap: wrap;
  margin-bottom: var(--s-lg);
}

.detail__badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-bg);
  background: var(--accent);
  padding: 5px 12px;
  border-radius: 3px;
}

.detail__client {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
}

.detail__date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  color: var(--text-muted);
}

.detail__title {
  font-size: var(--f-4xl);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-xl);
  max-width: 800px;
}

.detail__lede {
  font-family: 'Spectral', serif;
  font-size: var(--f-xl);
  line-height: 1.6;
  color: var(--text);
  margin-bottom: var(--s-2xl);
  max-width: 720px;
  padding-bottom: var(--s-2xl);
  border-bottom: 1px solid var(--border);
}

.detail__content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--s-4xl);
  align-items: start;
}

.detail__body p {
  font-size: var(--f-md);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--s-lg);
}

.detail__body h3 {
  font-family: 'Spectral', serif;
  font-size: var(--f-xl);
  font-weight: 500;
  margin-top: var(--s-2xl);
  margin-bottom: var(--s-md);
  color: var(--text);
}

.detail__body ul {
  list-style: none;
  margin-bottom: var(--s-lg);
  padding-left: 0;
}

.detail__body ul li {
  position: relative;
  padding-left: var(--s-lg);
  font-size: var(--f-md);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--s-xs);
}

.detail__body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-pale);
  border: 1.5px solid var(--accent-light);
}

/* Sidebar */
.detail__sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--s-xl));
}

.detail__info-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: var(--s-xl);
  margin-bottom: var(--s-xl);
}

.detail__info-card h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-md);
  padding-bottom: var(--s-sm);
  border-bottom: 1px solid var(--border-light);
}

.detail__info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-sm) 0;
}

.detail__info-row + .detail__info-row {
  border-top: 1px solid var(--border-light);
}

.detail__info-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail__info-value {
  font-size: var(--f-sm);
  color: var(--text);
  line-height: 1.5;
}

.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
  margin-top: var(--s-sm);
}

.detail__tags .card__tag {
  font-size: 0.65rem;
}

.detail__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--card-bg);
  background: var(--accent);
  padding: 14px 28px;
  border-radius: 4px;
  width: 100%;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail__cta:hover {
  background: var(--accent-mid);
  color: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
}

.detail__cta svg {
  width: 14px;
  height: 14px;
}

.detail__secondary-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--f-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-top: var(--s-md);
  width: 100%;
  justify-content: center;
  padding: 10px 20px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail__secondary-link:hover {
  background: var(--accent);
  color: var(--card-bg);
}

.detail__secondary-link svg {
  width: 14px;
  height: 14px;
}

/* Video embed */
.detail__video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-bottom: var(--s-2xl);
  border-radius: 8px;
  overflow: hidden;
  background: var(--text);
}

.detail__video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Navigation between items */
.detail__nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--s-xl);
  margin-top: var(--s-4xl);
  padding-top: var(--s-3xl);
  border-top: 1px solid var(--border);
}

.detail__nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-xs);
  padding: var(--s-lg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail__nav-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow);
}

.detail__nav-item--next {
  text-align: right;
}

.detail__nav-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail__nav-title {
  font-family: 'Spectral', serif;
  font-size: var(--f-lg);
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

/* Skills demonstrated list */
.detail__skills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
  margin-top: var(--s-sm);
}

.detail__skill-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 3px 10px;
  border: 1px solid var(--accent-pale);
  border-radius: 3px;
  background: rgba(209, 236, 217, 0.2);
}

/* Responsive detail page */
@media (max-width: 1024px) {
  .detail__content {
    gap: var(--s-2xl);
  }
}

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

  .detail__sidebar {
    position: static;
  }

  .detail__title {
    font-size: var(--f-3xl);
  }

  .detail__hero-image-wrap {
    max-height: 320px;
  }

  .detail__nav {
    flex-direction: column;
  }

  .detail__nav-item--next {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .detail__title {
    font-size: var(--f-2xl);
  }

  .detail__lede {
    font-size: var(--f-lg);
  }

  .detail__hero-image-wrap {
    max-height: 240px;
  }
}
