@import '../../landing/css/base.css';

/* Profile — fixed #ECE6D6 bg; --fg = darker landing colorway (theme.js) */
body.profile-page {
  --fg-muted: var(--fg);
  --rule: var(--fg);
  --profile-pad-top: calc(var(--nav-stack-height) + clamp(2.5rem, 6vh, 4.5rem));
  scroll-padding-top: var(--nav-stack-height);
  --fs-headline: clamp(3.5rem, 13vw, 11.75rem);
  --fs-tagline: 18px;
  --fs-bio-lead: 30px;
  --fs-bio: clamp(1rem, 1.45vw, 1.3125rem);
  --fs-principle: 32px;
  --fs-exp-title: clamp(1rem, 1.38vw, 1.25rem);
  --fs-exp-date: clamp(1rem, 1.38vw, 1.25rem);
  --fs-nav: 15px;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  overflow-y: auto;
}

body.profile-page .nav-link {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-nav);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  opacity: 1;
  color: var(--fg);
  transition: opacity 0.25s ease;
}

body.profile-page a.nav-link:hover {
  opacity: 0.7;
}

body.profile-page #profile,
body.profile-page #profile a:not(.nav-link) {
  color: var(--fg);
  opacity: 1;
}

body.profile-page .nav-left {
  display: none;
}

#profile {
  padding:
    var(--profile-pad-top)
    var(--nav-pad-x)
    5rem
    var(--nav-pad-x);
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  row-gap: clamp(2.5rem, 5vw, 4.5rem);
}

.profile-grid {
  display: contents;
}

/* ── ENTRANCE ── */
[data-reveal].page-reveal-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

[data-reveal].page-reveal-show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: pageReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal].page-reveal-hidden {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  [data-reveal].page-reveal-show {
    animation: none;
  }
}

/* ── HERO ── */
.profile-tagline {
  grid-column: 1 / 4;
  grid-row: 1;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  font-family: 'Eterne Text';
  font-style: italic;
  font-weight: 300;
  font-synthesis: none;
  font-size: var(--fs-tagline);
  line-height: 25px;
  letter-spacing: -0.9px;
  text-align: center;
  align-self: center;
  justify-self: center;
  max-width: 12rem;
}

.profile-headline {
  grid-column: 4 / 10;
  grid-row: 1;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  justify-self: start;
  text-align: left;
  font-family: 'Eterne', serif;
  font-style: normal;
  font-weight: 500;
  font-size: var(--fs-headline);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* ── BIO ── */
.profile-bio {
  grid-column: 4 / 9;
  grid-row: 2;
  justify-self: start;
  text-align: left;
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 1.35em;
}

.profile-bio-lead {
  font-family: 'Eterne', serif;
  font-size: var(--fs-bio-lead);
  line-height: 1.35;
  letter-spacing: -0.3px;
  font-weight: 800;
}

.profile-bio p:not(.profile-bio-lead) {
  font-family: 'SharpEarth', sans-serif;
  font-size: var(--fs-bio);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 500;
}

/* ── PRINCIPLES — five equal columns, full grid width ── */
.profile-principles {
  grid-column: 1 / 10;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 1.5vw, 1.75rem);
  align-items: start;
}

p.profile-principle,
.profile-principle {
  font-family: 'Eterne', serif;
  font-style: normal;
  font-weight: 900;
  font-size: 32px;
  line-height: 1.15;
  text-align: center;
  min-width: 0;
}

/* ── EXPERIENCE + PORTRAIT ── */
.profile-lower {
  grid-column: 1 / 10;
  grid-row: 4;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  column-gap: 0;
  align-items: start;
}

.profile-experience {
  grid-column: 2 / 6;
  grid-row: 1;
  margin-top: 50px;
  margin-right: 100px;
  min-width: 0;
}

.profile-exp-heading {
  font-family: 'Eterne', serif;
  font-style: normal;
  font-weight: 900;
  font-size: var(--fs-exp-title);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.profile-exp-list {
  list-style: none;
  min-width: 0;
}

.profile-exp-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  min-width: 0;
}

.profile-exp-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.profile-exp-role {
  grid-column: 1;
  grid-row: 1;
  font-family: 'Eterne', serif;
  font-style: normal;
  font-weight: 900;
  font-size: var(--fs-exp-title);
  line-height: 1.2;
  white-space: pre-line;
}

.profile-exp-role::first-line {
  font-family: 'SharpEarth', sans-serif;
  font-weight: 500;
}

.profile-exp-date {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-family: 'SharpEarth', sans-serif;
  font-size: var(--fs-exp-date);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.profile-portrait {
  grid-column: 6 / 10;
  grid-row: 1;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  min-width: 0;
  justify-self: stretch;
}

.profile-portrait img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 960px) {
  .profile-tagline {
    grid-column: 1 / 4;
    grid-row: 1;
    max-width: 10rem;
    text-align: center;
    justify-self: center;
    align-self: center;
  }

  .profile-headline {
    grid-column: 4 / 10;
    grid-row: 1;
  }

  .profile-bio {
    grid-column: 4 / 9;
    grid-row: 2;
  }

  /* principles stay on cols 1, 3, 5, 7, 9 */

  .profile-lower {
    grid-template-columns: 1fr;
    row-gap: 2.5rem;
  }

  .profile-experience {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .profile-portrait {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .profile-principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1.5rem;
  }

  .profile-principle:nth-child(5) {
    grid-column: 1 / -1;
  }
}
