/*
  Elena Petkovska — vertical spine, framed portrait, refined detail.
*/

:root {
  --bg: #f4f3f0;
  --text: #181817;
  --text-muted: #4a4a48;
  --border: rgba(24, 24, 23, 0.06);
  --accent: rgba(24, 24, 23, 0.04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --font-spine: "Bodoni Moda", Georgia, serif;
  --text-size: 0.9375rem;
  --text-sm: 0.8125rem;
  --line: 1.7;
  --weight: 400;
  --weight-med: 500;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.3s;
}

[data-theme="dark"] {
  --bg: #0c0c0b;
  --text: #ecebe9;
  --text-muted: #7c7b79;
  --border: rgba(236, 235, 233, 0.06);
  --accent: rgba(236, 235, 233, 0.03);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--text-size);
  font-weight: var(--weight);
  line-height: var(--line);
  color: var(--text);
  background: var(--bg);
}

/* Theme toggle — larger */
.theme-toggle {
  position: fixed;
  top: var(--space-m);
  right: var(--space-m);
  z-index: 10;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--border);
}

.theme-toggle:focus {
  outline: none;
}

.theme-toggle:focus-visible {
  outline: 1px solid var(--text-muted);
  outline-offset: 2px;
}

.theme-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
}

.theme-icon--moon {
  opacity: 0;
}

[data-theme="dark"] .theme-icon--sun {
  opacity: 0;
}

[data-theme="dark"] .theme-icon--moon {
  opacity: 1;
}

[data-theme="dark"] .portrait-frame {
  border-color: rgba(236, 235, 233, 0.04);
}

/* Motion sequencing */
.motion-seq {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(18px);
  animation: motionFadeUp 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.motion-delay-1 {
  animation-delay: 0.08s;
}

.motion-delay-2 {
  animation-delay: 0.16s;
}

.motion-delay-3 {
  animation-delay: 0.24s;
}

.motion-delay-4 {
  animation-delay: 0.32s;
}

.motion-delay-5 {
  animation-delay: 0.4s;
}

.motion-delay-6 {
  animation-delay: 0.48s;
}

.motion-delay-7 {
  animation-delay: 0.56s;
}

.motion-delay-8 {
  animation-delay: 0.64s;
}

.motion-delay-9 {
  animation-delay: 0.72s;
}

.motion-delay-10 {
  animation-delay: 0.8s;
}

.motion-delay-11 {
  animation-delay: 0.88s;
}

.motion-delay-12 {
  animation-delay: 0.96s;
}

.motion-delay-13 {
  animation-delay: 1.04s;
}

@keyframes motionFadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(18px);
  }
  45% {
    opacity: 0.6;
    transform: translateY(4px);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-seq {
    animation: none !important;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Page: spine + hero in row 1 (bottoms align), then main content in row 2 */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-m) var(--space-2xl);
}

/* Spacer reserves left column so content doesn’t shift when spine is fixed */
.spine-spacer {
  grid-column: 1;
  grid-row: 1 / -1;
  width: 5rem;
  min-width: 5rem;
}

/* Row 1: spine fixed on scroll; hero-block bottom-aligned with spacer row */
.spine {
  position: fixed;
  top: var(--space-xl);
  left: calc((100vw - min(48rem, 100vw)) / 2 + var(--space-m));
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  margin-bottom: calc(2.5rem + (var(--space-2xl) * 2 / 3));
  padding-right: var(--space-m);
  border-right: 1px solid var(--border);
  margin-right: var(--space-m);
  height: fit-content;
}

.hero-block {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  margin-bottom: calc(0.25rem + (var(--space-2xl) * 2 / 3));
}

/* Row 2: main content */
.page .main {
  grid-column: 2;
  grid-row: 2;
}

.spine-name {
  font-family: var(--font-spine);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  display: inline-block;
  white-space: nowrap;
  line-height: 1.6;
}

/* Main content */
.main {
  min-width: 0;
}

/* Hero block: portrait + tagline + location */
.hero-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Portrait — inner frame; padding after image (1/3 of original to be 2/3 lower) */
.portrait-frame {
  margin: 0 0 calc(var(--space-2xl) / 3);
  line-height: 0;
  padding: 0.375rem;
  background: var(--accent);
  border: 0.5px solid rgba(24, 24, 23, 0.04);
  width: fit-content;
  border-radius: 50%;
}

.portrait {
  display: block;
  width: 100%;
  max-width: 8rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

/* Intro — small padding after titles block */
.intro {
  margin-top: -0.5rem;
  margin-bottom: var(--space-xs);
}

.intro .roles-wrap {
  margin-top: 0;
  margin-bottom: 0;
}

.name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0 0 var(--space-s);
  line-height: 1.25;
}

.tagline {
  font-size: var(--text-size);
  color: var(--text-muted);
  margin: 0;
  max-width: 40rem;
}

.tagline--under-portrait {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.hero-block .tagline--under-portrait:last-child {
  margin-bottom: calc(var(--space-xs) * 4 / 3);
}

.location {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-xs);
  padding-top: 0;
  padding-bottom: var(--space-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.location--under-tagline {
  margin-top: 0;
  margin-bottom: calc((var(--space-xs) * 4 / 3 + 0.25rem + (var(--space-2xl) * 2 / 3) + var(--space-m)) * 3 / 4);
  padding-top: 0;
  padding-bottom: 0;
  padding-left: calc(var(--space-m) + 1px);
}

/* Statement — with minimal marker */
.statement {
  margin: 0 0 var(--space-l);
}

.statement p {
  font-size: var(--text-size);
  color: var(--text);
  margin: 0 0 var(--space-xs);
  display: flex;
  align-items: baseline;
  gap: var(--space-s);
}

.statement p:last-child {
  margin-bottom: 0;
}

.statement-marker {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Roles — subtle block */
.roles-wrap {
  margin: 0 0 var(--space-xs);
  padding-left: var(--space-m);
  border-left: 1px solid var(--border);
}

.roles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.roles li {
  margin: 0 0 var(--space-xs);
}

.roles li:last-child {
  margin-bottom: 0;
}

.roles li {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.roles a.roles__brand {
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.roles a.roles__brand:hover {
  color: var(--text-muted);
}

.care {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-xl);
}

.footer {
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
}

.signature {
  position: relative;
  margin-bottom: var(--space-xl);
  min-height: 4.5rem;
}

.signature__img {
  display: block;
  height: 4.5rem;
  width: auto;
  max-width: 20rem;
  object-fit: contain;
  object-position: left center;
}

.signature__img--light {
  position: relative;
}

.signature__img--dark {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

[data-theme="dark"] .signature__img--light {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

[data-theme="dark"] .signature__img--dark {
  position: relative;
  opacity: 1;
}

.featured-links {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-xl);
}

.featured-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-s) 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color var(--dur) var(--ease);
}

.featured-link:first-child {
  padding-top: 0;
}

.featured-link:hover {
  color: var(--text);
}

.featured-link__label {
  flex: 1;
  min-width: 0;
}

.featured-link__arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.featured-link__icon {
  display: block;
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.socials {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-m);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--dur) var(--ease);
}

.social-link:hover {
  color: var(--text);
}

.social-link__label {
  flex-shrink: 0;
}

.social-link__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-link__icon {
  display: block;
  width: 12px;
  height: 12px;
  object-fit: contain;
}

/* Mobile — responsive and clean; desktop layout unchanged */
@media (max-width: 640px) {
  .page {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto 1fr;
    padding: 2rem var(--space-m) var(--space-xl);
    min-width: 0;
    align-items: center;
  }

  .theme-toggle {
    position: static;
    grid-column: 2;
    grid-row: 1;
    margin-left: var(--space-s);
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .spine-spacer {
    display: none;
  }

  .spine {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    position: static;
    top: auto;
    left: auto;
    padding-right: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-right: none;
    border-bottom: none;
    height: auto;
    display: flex;
    align-items: center;
  }

  .spine .spine-name {
    line-height: 1.4;
  }

  .hero-block {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: auto;
    margin-top: var(--space-l);
    padding-top: var(--space-m);
    border-top: 1px solid var(--border);
    margin-bottom: 0;
    min-width: 0;
  }

  .page .main {
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: 0;
  }

  .spine-name {
    writing-mode: horizontal-tb;
    transform: none;
    letter-spacing: 0.12em;
  }

  .portrait-frame {
    margin-left: 0;
    margin-right: auto;
  }

  .tagline {
    max-width: 100%;
  }

  .location,
  .location--under-tagline {
    max-width: 100%;
  }

  .featured-link {
    padding: var(--space-s) 0;
    min-height: 2.75rem;
    align-items: center;
  }

  .featured-link__label {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .socials {
    gap: var(--space-s) var(--space-m);
  }

  .social-link {
    padding: var(--space-xs) 0;
    min-height: 2.75rem;
    align-items: center;
  }

  html {
    overflow-x: hidden;
  }
}
