:root {
  --ink: #12141a;
  --paper: #f6f3ed;
  --paper-alt: #fbfaf7;
  --blue: #2f6bff;
  --muted: #666b75;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(47, 107, 255, 0.08), transparent 28%),
    #07090e;
  color: #ffffff;
  font-family: "Inter", sans-serif;
}

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

img {
  display: block;
  width: 100%;
}

button {
  font: inherit;
}

.cv-nav {
  position: fixed;
  z-index: 50;
  top: 14px;
  left: 50%;
  width: min(94%, 1320px);
  min-height: 66px;
  padding: 9px 12px 9px 18px;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.cv-brand {
  width: 72px;
}

.cv-brand img {
  filter: invert(1);
}

.cv-nav > span {
  text-align: center;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.cv-nav-actions {
  display: flex;
  gap: 8px;
}

.cv-nav-actions a {
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.76rem;
  font-weight: 700;
}

.cv-nav-actions .cv-nav-primary {
  border-color: transparent;
  background: var(--blue);
  color: #ffffff;
}

.cv-stage {
  min-height: 100svh;
  padding: 96px 0 26px;
  display: grid;
  place-items: center;
}

.book-frame {
  position: relative;
  width: min(96vw, 1240px);
  padding: 0 76px 30px;
  display: grid;
  place-items: center;
}

.book {
  position: relative;
  width: min(100%, 1060px);
  height: min(610px, calc(100svh - 150px));
  min-height: 500px;
  margin: 0 auto;
}

.book-spread {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.988);
  transition: opacity 260ms ease, transform 260ms ease;
}

.book-spread.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.book-cover,
.book-back {
  display: flex;
  justify-content: center;
}

.book-spread:not(.book-cover):not(.book-back) {
  overflow: hidden;
  border-radius: 28px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.24),
    0 10px 22px rgba(0, 0, 0, 0.14);
}

.book-spread:not(.book-cover):not(.book-back)::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(18, 20, 26, 0.03), rgba(18, 20, 26, 0.11), rgba(18, 20, 26, 0.03));
  transform: translateX(-50%);
}

.single-page {
  width: 50%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(circle at 58% 18%, rgba(47, 107, 255, 0.13), transparent 29%),
    linear-gradient(180deg, #101b39 0%, #091226 100%);
  box-shadow:
    0 30px 68px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.cover-page {
  padding: clamp(30px, 3.4vw, 44px);
  display: flex;
  flex-direction: column;
}

.cover-kicker {
  margin: 0;
  color: #75a0ff;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.cover-logo {
  width: 142px;
  margin: clamp(28px, 4vh, 42px) auto 34px;
  filter: invert(1);
}

.cover-identity {
  margin-top: auto;
}

.cover-role {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  font-weight: 500;
}

.cover-identity h2 {
  margin: 0 0 20px;
  color: #ffffff;
  font-family: "League Spartan", sans-serif;
  font-size: clamp(2.9rem, 3.8vw, 3.7rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.cover-description {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.45;
}

.cover-description span {
  display: block;
}

.cover-location {
  margin: auto 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.back-page {
  padding: clamp(34px, 4vw, 50px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.back-logo {
  width: clamp(150px, 14vw, 188px);
  margin: 4px auto 42px;
  filter: invert(1);
}

.back-page h2 {
  width: 100%;
  margin: auto 0;
  color: #ffffff;
  font-family: "League Spartan", sans-serif;
  font-size: clamp(1.85rem, 2.3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.back-page h2 span {
  display: block;
  white-space: nowrap;
}

.back-contact {
  width: 100%;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
}

.book-page {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(26px, 2.8vw, 38px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

.book-page:nth-child(2) {
  background: var(--paper-alt);
}

.page-number {
  position: absolute;
  bottom: 19px;
  color: #989ba3;
  font-size: 0.69rem;
}

.book-page:first-child .page-number {
  left: 24px;
}

.book-page:last-child .page-number {
  right: 24px;
}

.page-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.book-page h2 {
  margin: 0;
  color: var(--ink);
  font-family: "League Spartan", sans-serif;
  font-size: clamp(2rem, 2.7vw, 3rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.052em;
}

.book-page h3 {
  margin: 6px 0 0;
  color: var(--ink);
  font-family: "League Spartan", sans-serif;
  font-size: 1.18rem;
  line-height: 1.05;
}

.two-line-title span {
  display: block;
  white-space: nowrap;
}

.page-experience h2,
.page-skills h2,
.page-education h2,
.page-projects h2 {
  font-size: clamp(1.9rem, 2.3vw, 2.55rem);
}

.page-experience-more h2 {
  font-size: clamp(1.78rem, 2.15vw, 2.35rem);
}

.page-body {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.62;
}

.profile-photo {
  width: 96px;
  aspect-ratio: 1;
  margin-bottom: 15px;
  overflow: hidden;
  border: 6px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

.profile-photo img {
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
}

.profile-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-links a {
  padding: 9px 12px;
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.timeline {
  margin-top: 20px;
  display: grid;
  gap: 17px;
}

.timeline article {
  position: relative;
  padding-left: 22px;
}

.timeline article::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 8px;
  height: 8px;
  border: 3px solid var(--blue);
  border-radius: 50%;
  background: var(--paper-alt);
}

.timeline article::after {
  content: "";
  position: absolute;
  top: 15px;
  bottom: -19px;
  left: 5px;
  width: 1px;
  background: rgba(0, 0, 0, 0.14);
}

.timeline article:last-child::after {
  display: none;
}

.timeline span {
  color: var(--blue);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.timeline h3 {
  margin: 4px 0;
  font-family: "Inter", sans-serif;
  font-size: 0.91rem;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.47;
}

.timeline-compact {
  gap: 18px;
}

.skills-list {
  margin-top: 19px;
  display: grid;
}

.skills-list div {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 31px 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.skills-list span {
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 800;
}

.skills-list strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.tools {
  margin-top: auto;
  padding-bottom: 19px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tools span {
  padding: 7px 9px;
  border-radius: 999px;
  background: #e9ebf1;
  color: #343740;
  font-size: 0.56rem;
  font-weight: 800;
}

.education-block {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.education-block article {
  padding: 17px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.education-block span {
  color: var(--blue);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.education-block h3 {
  margin: 8px 0 4px;
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
}

.education-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

blockquote {
  margin: auto 0 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ink);
  font-family: "League Spartan", sans-serif;
  font-size: 1.28rem;
  line-height: 1.08;
}

.mini-project-grid {
  flex: 1;
  min-height: 0;
  margin-top: 18px;
  padding-bottom: 19px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mini-project-grid a {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #111318;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.mini-project-grid img {
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.mini-project-grid a:hover img {
  transform: scale(1.04);
}

.mini-project-grid span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  padding: 7px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.74);
  color: #ffffff;
  font-size: 0.57rem;
  font-weight: 750;
  text-align: center;
}

.book-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.book-controls button {
  position: absolute;
  top: calc(50% - 40px);
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.book-control-prev {
  left: 10px;
}

.book-control-next {
  right: 10px;
}

.book-controls button:hover {
  border-color: rgba(100, 148, 255, 0.55);
  background: var(--blue);
  transform: scale(1.05);
}

.book-controls button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.book-controls div {
  position: absolute;
  left: 50%;
  bottom: 0;
  min-width: 82px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-height: 760px) and (min-width: 901px) {
  .cv-nav {
    top: 10px;
    min-height: 60px;
  }

  .cv-stage {
    padding-top: 80px;
    padding-bottom: 18px;
  }

  .book-frame {
    padding-inline: 72px;
    padding-bottom: 27px;
  }

  .book {
    height: calc(100svh - 124px);
    min-height: 470px;
  }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .book-frame {
    width: 98vw;
    padding-inline: 62px;
  }

  .book-controls button {
    width: 46px;
    height: 46px;
  }

  .book-control-prev {
    left: 8px;
  }

  .book-control-next {
    right: 8px;
  }
}

@media (max-width: 900px) {
  .cv-nav {
    grid-template-columns: 1fr auto;
  }

  .cv-nav > span,
  .cv-nav-actions a:first-child {
    display: none;
  }

  .cv-stage {
    padding: 94px 0 22px;
  }

  .book-frame {
    width: 94vw;
    padding: 0 0 62px;
  }

  .book {
    width: 100%;
    height: min(690px, calc(100svh - 170px));
    min-height: 590px;
  }

  .book-spread {
    grid-template-columns: 1fr;
  }

  .book-spread:not(.book-cover):not(.book-back)::after {
    display: none;
  }

  .single-page {
    width: 100%;
    max-width: 560px;
  }

  .book-page:nth-child(2) {
    display: none;
  }

  .book-spread.show-second .book-page:first-child {
    display: none;
  }

  .book-spread.show-second .book-page:nth-child(2) {
    display: flex;
  }

  .book-controls button {
    top: auto;
    bottom: 0;
    width: 44px;
    height: 44px;
  }

  .book-control-prev {
    left: calc(50% - 94px);
  }

  .book-control-next {
    right: calc(50% - 94px);
  }

  .book-controls div {
    bottom: 7px;
    border: 0;
    background: transparent;
  }
}

@media (max-width: 560px) {
  .cv-nav {
    top: 9px;
    width: 95%;
    min-height: 60px;
  }

  .cv-brand {
    width: 60px;
  }

  .cv-stage {
    padding-top: 82px;
  }

  .book-frame {
    width: 94vw;
  }

  .book {
    height: min(660px, calc(100svh - 150px));
    min-height: 560px;
  }

  .book-page,
  .cover-page,
  .back-page {
    padding: 26px 24px;
  }

  .cover-logo {
    width: 125px;
  }

  .cover-identity h2 {
    font-size: 2.8rem;
  }

  .back-page h2 {
    font-size: 1.75rem;
  }

  .back-contact {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-spread,
  .book-controls button,
  .mini-project-grid img {
    transition: none;
  }
}
