:root {
  --bg: #0e0b08;
  --panel: #18110c;
  --paper: #efe4c7;
  --paper-edge: #d3bd8e;
  --gold: #d3ad63;
  --text: #fff6df;
  --muted: rgba(255, 246, 223, 0.72);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  font-family: Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(211, 173, 99, 0.18), transparent 31rem),
    linear-gradient(180deg, #17100b 0%, #050403 100%);
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.01);
  filter: blur(9px);
  transition:
    opacity 480ms ease,
    transform 640ms ease,
    filter 640ms ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  filter: blur(0);
}

.micro {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-hero {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #120d09;
}

.intro-hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.intro-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 3, 2, 0.04) 0%, rgba(4, 3, 2, 0.2) 42%, rgba(4, 3, 2, 0.88) 78%, #050403 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.26), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.26));
}

.intro-hero__copy {
  position: absolute;
  left: max(22px, env(safe-area-inset-left));
  right: max(22px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  max-width: 680px;
  margin: 0 auto;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 16vw, 98px);
  line-height: 0.92;
}

.intro-hero p:not(.micro),
.bio-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.primary-action,
.text-button,
.floating-info {
  border: 1px solid rgba(255, 246, 223, 0.2);
  border-radius: 999px;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  min-height: 60px;
  margin-top: 18px;
  background: var(--gold);
  color: #1a120b;
  font-size: 15px;
  font-weight: 900;
}

.screen--notebook {
  overflow: hidden;
  padding: 0;
}

.topbar,
.notebook-controls {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: min(520px, 100%);
  padding-inline: 10px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.topbar {
  top: max(8px, env(safe-area-inset-top));
}

.topbar strong {
  display: block;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 246, 223, 0.16);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
}

.notebook-stage {
  position: absolute;
  inset: 0;
  padding: max(54px, calc(env(safe-area-inset-top) + 48px)) 0 max(58px, calc(env(safe-area-inset-bottom) + 54px));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.notebook-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
}

.notebook-frame::before {
  display: none;
}

.spiral {
  display: none;
}

.notebook {
  position: relative;
  z-index: 5;
  width: min(100vw, calc((100dvh - 112px) * 0.743));
  height: min(calc(100dvh - 112px), calc(100vw * 1.346));
}

.page {
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.44);
}

.page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--paper);
}

.stf__parent {
  margin: 0 auto;
}

.stf__block {
  box-shadow: 0 12px 28px rgba(25, 14, 7, 0.26);
}

.notebook-controls {
  bottom: max(8px, env(safe-area-inset-bottom));
  width: min(520px, calc(100% - 16px));
  grid-template-columns: minmax(66px, auto) minmax(0, 1fr) minmax(74px, auto);
  padding-bottom: 0;
}

.text-button {
  min-height: 38px;
  padding: 0 13px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.text-button:disabled {
  opacity: 0.38;
}

.page-meter {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.progress {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 246, 223, 0.14);
}

.progress span {
  display: block;
  height: 100%;
  width: 5%;
  background: var(--gold);
}

.floating-info {
  position: absolute;
  right: 12px;
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 12;
  min-height: 34px;
  padding: 0 13px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.screen--info {
  overflow: auto;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
}

.info-panel {
  width: min(760px, 100%);
  min-height: calc(100dvh - 28px);
  margin: 0 auto;
  border: 1px solid rgba(255, 246, 223, 0.12);
  border-radius: 16px;
  background: rgba(20, 14, 10, 0.98);
  box-shadow: var(--shadow);
}

.info-panel__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: rgba(20, 14, 10, 0.98);
}

.info-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
}

.bio-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  padding: 0 16px 16px;
}

.bio-copy h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}

.material-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.material-photos img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 560px) {
  .app {
    min-height: 560px;
  }

  .intro-hero__photo {
    object-position: center top;
  }

  .notebook-frame {
    width: 100%;
  }

  .notebook-frame::before {
    display: none;
  }

  .notebook {
    width: min(100vw, calc((100dvh - 112px) * 0.743));
  }

  .bio-layout {
    grid-template-columns: 1fr;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .intro-hero__copy {
    max-width: 620px;
  }

  h1 {
    font-size: clamp(42px, 8vw, 68px);
  }
}
