:root {
  color-scheme: light;
  --paper: #f4f1eb;
  --paper-solid: #f7f4ee;
  --ink: #18201d;
  --jade: #315c4a;
  --jade-deep: #224a39;
  --muted: #68716b;
  --line: rgba(49, 92, 74, 0.27);
  --display: "Newsreader", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 2px solid var(--jade-deep);
  outline-offset: 4px;
}

.reading-page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background-color: var(--paper);
  background-image: url('/assets/ink-mirror/analysis-transition-desktop-v101.jpg');
  background-position: center top;
  background-size: 100% auto;
  background-repeat: repeat-y;
}

.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 52px 8px;
}

.wordmark {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
}

.product-nav {
  display: flex;
  align-items: center;
  gap: clamp(36px, 4.2vw, 66px);
}

.product-nav--mobile {
  display: none;
}

.nav-item {
  position: relative;
  min-height: 44px;
  appearance: none;
  border: 0;
  padding: 0 2px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  line-height: 44px;
  transition: color 180ms ease;
}

.nav-item::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 2px;
  background: var(--jade);
  content: "";
  opacity: 0;
  transform: scaleX(0.65);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--jade-deep);
}

.nav-item.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.identity-hero {
  width: min(1148px, calc(100% - 100px));
  min-height: 783px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 464px minmax(500px, 1fr);
  align-items: start;
  gap: 97px;
  padding: 11px 0 28px;
}

.portrait-wrap {
  width: 100%;
  height: 733px;
  margin: 0;
  overflow: hidden;
  background: rgba(247, 244, 238, 0.78);
  box-shadow: 0 28px 60px -52px rgba(34, 47, 40, 0.55);
}

.identity-portrait {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 90%;
  filter: saturate(0.82) contrast(0.97) brightness(1.03);
}

.identity-copy {
  max-width: 610px;
  padding: 187px 0 0;
}

.eyebrow,
.meta-label {
  margin: 0;
  color: var(--jade-deep);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.17em;
}

.identity-copy h1 {
  margin: 20px 0 20px;
  font-family: var(--display);
  font-size: clamp(82px, 8.9vw, 128px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.055em;
}

.identity-statement {
  max-width: 590px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 2.25vw, 34px);
  font-weight: 400;
  line-height: 1.34;
  letter-spacing: -0.025em;
}

.identity-support {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.identity-meta {
  display: grid;
  gap: 7px;
  margin-top: 28px;
}

.meta-label {
  font-size: 10px;
}

.meta-value {
  color: #535d56;
  font-size: 15px;
  line-height: 1.4;
}

.identity-proof {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 18px;
  color: #747b76;
  font-size: 12px;
  line-height: 1.45;
}

.identity-proof button,
.share-action,
.new-reading-action {
  position: relative;
  appearance: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0 0 2px;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  transition: color 180ms ease, border-color 180ms ease;
}

.identity-proof button::before,
.share-action::before,
.new-reading-action::before {
  position: absolute;
  inset: -12px -8px;
  content: "";
}

.identity-proof button:hover,
.share-action:hover,
.new-reading-action:hover {
  color: var(--jade-deep);
}

.identity-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.share-action,
.new-reading-action {
  min-height: 44px;
  margin-top: 12px;
  font-size: 14px;
}

.free-reading-intro {
  min-height: 260px;
  border-top: 1px solid rgba(24, 32, 29, 0.18);
  padding: 24px max(10vw, 48px) 80px;
  background-image: url('/assets/ink-mirror/reading-section-transition-desktop-v101.jpg');
  background-position: center top;
  background-size: cover;
}

.free-reading-intro > div {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.free-reading-intro h2 {
  margin: 12px 0 4px;
  font-family: var(--display);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

.free-reading-intro > div > p:last-child {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 48px));
  padding: 13px 17px;
  border: 1px solid rgba(49, 92, 74, 0.2);
  background: rgba(247, 244, 238, 0.96);
  box-shadow: 0 18px 46px -28px rgba(24, 32, 29, 0.7);
  color: var(--jade-deep);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 32, 29, 0.36);
  backdrop-filter: blur(6px);
}

.detail-dialog {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(49, 92, 74, 0.24);
  background: var(--paper-solid);
  box-shadow: 0 30px 90px -42px rgba(24, 32, 29, 0.65);
}

.detail-dialog h2 {
  margin: 14px 0 24px;
  font-family: var(--display);
  font-size: 35px;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.detail-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  font-size: 14px;
}

.detail-list dd {
  color: var(--jade-deep);
  font-weight: 600;
}

.detail-note {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dialog-close {
  min-width: 94px;
  min-height: 44px;
  border: 1px solid var(--jade-deep);
  background: var(--jade-deep);
  color: var(--paper-solid);
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .reading-page {
    background-image: url('/assets/ink-mirror/analysis-transition-mobile-v101.jpg');
    background-size: 100% auto;
  }

  .site-header {
    min-height: 59px;
    padding: max(8px, env(safe-area-inset-top)) 24px 7px;
  }

  .wordmark {
    min-height: 44px;
    font-size: 22px;
  }

  .site-header > .product-nav {
    display: none;
  }

  .identity-hero {
    width: 100%;
    min-height: calc(100svh - 119px);
    display: block;
    padding: 0 0 20px;
  }

  .portrait-wrap {
    width: min(70.25vw, 274px);
    height: min(451px, 115.64vw);
    min-height: 0;
    margin: 0 auto 7px;
    box-shadow: none;
  }

  .identity-portrait {
    object-position: 50% 100%;
  }

  .identity-copy {
    max-width: none;
    padding: 0 45px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .identity-copy h1 {
    margin: 10px 0 8px;
    font-size: 58px;
    line-height: 0.9;
  }

  .identity-statement {
    font-size: 18px;
    line-height: 1.35;
  }

  .identity-support {
    display: none;
  }

  .identity-meta {
    gap: 3px;
    margin-top: 10px;
  }

  .meta-label {
    font-size: 9px;
  }

  .meta-value {
    font-size: 12px;
  }

  .identity-proof {
    margin-top: 7px;
    font-size: 10.5px;
  }

  .identity-proof button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
  }

  .share-action,
  .new-reading-action {
    min-height: 44px;
    margin-top: 1px;
    font-size: 12px;
  }

  .product-nav--mobile {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    height: calc(60px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0 10px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(24, 32, 29, 0.16);
    background: rgba(247, 244, 238, 0.96);
    backdrop-filter: blur(13px);
  }

  .product-nav--mobile .nav-item {
    min-width: 0;
    min-height: 44px;
    padding: 0 4px;
    font-size: 13px;
    line-height: 44px;
  }

  .product-nav--mobile .nav-item::after {
    right: 14%;
    bottom: 17px;
    left: 14%;
  }

  .free-reading-intro {
    min-height: 250px;
    padding: 32px 34px 90px;
    background-image: url('/assets/ink-mirror/reading-section-transition-mobile-v101.jpg');
  }

  .free-reading-intro h2 {
    margin-top: 10px;
    font-size: 42px;
  }

  .free-reading-intro > div > p:last-child {
    font-size: 13px;
  }

  .notice {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .detail-dialog {
    padding: 28px 24px 24px;
  }
}

@media (max-width: 360px) {
  .site-header {
    min-height: 62px;
    padding: 17px 20px 4px;
  }

  .portrait-wrap {
    width: 66vw;
    height: 310px;
    min-height: 0;
    margin-bottom: 14px;
  }

  .identity-copy {
    padding: 0 34px;
  }

  .identity-copy h1 {
    font-size: 56px;
  }

  .identity-statement {
    font-size: 19px;
  }

  .identity-support {
    font-size: 12px;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 920px) {
  body {
    padding-bottom: 0;
  }

  .site-header {
    min-height: 52px;
    padding: 9px 24px 0;
  }

  .site-header > .product-nav {
    display: none;
  }

  .wordmark {
    font-size: 27px;
  }

  .identity-hero {
    min-height: calc(100vh - 52px);
    display: grid;
    grid-template-columns: 38vw 1fr;
    align-items: center;
    gap: 5vw;
    padding: 8px 8vw 26px;
  }

  .portrait-wrap {
    width: 100%;
    height: min(72vh, 330px);
    min-height: 0;
    margin: 0;
  }

  .identity-copy {
    padding: 0;
  }

  .identity-copy h1 {
    margin: 5px 0;
    font-size: 52px;
  }

  .identity-statement {
    font-size: 18px;
  }

  .identity-support {
    display: none;
  }

  .identity-meta {
    margin-top: 8px;
  }

  .identity-proof {
    margin-top: 6px;
  }

  .share-action,
  .new-reading-action {
    min-height: 36px;
  }

  .product-nav--mobile {
    position: fixed;
    top: 0;
    right: 16px;
    bottom: auto;
    left: auto;
    z-index: 40;
    width: auto;
    height: 52px;
    display: flex;
    gap: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .product-nav--mobile .nav-item {
    font-size: 11px;
  }

  .free-reading-intro {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
