:root {
  --study-ink: #111513;
  --study-white: #f8faf8;
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 20rem;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
  background: #e9ece9;
  color: var(--study-ink);
}

button {
  color: inherit;
  font: inherit;
}

/* Preview-only interaction override: retain the original shell and replace its
   rolling/capsule hover with the centered 1px underline used on tnsilver.com. */
.site-header .nav-link:not(.nav-link-strong, .nav-link-portal)::before {
  display: none;
}

.site-header .nav-label {
  transition: color 300ms ease;
}

.site-header .nav-link:hover .nav-label,
.site-header .nav-link:focus-visible .nav-label {
  transform: none;
}

.site-header .nav-link:not(.nav-link-strong, .nav-link-portal) .nav-label::after {
  top: auto;
  bottom: -0.55rem;
  left: 50%;
  width: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
  transition: width 300ms ease;
}

.site-header .nav-link:not(.nav-link-strong, .nav-link-portal):hover,
.site-header .nav-link:not(.nav-link-strong, .nav-link-portal):focus-visible,
.site-header .nav-link:not(.nav-link-strong, .nav-link-portal)[aria-current="page"] {
  color: #3f725f;
}

.site-header .nav-link:not(.nav-link-strong, .nav-link-portal):hover .nav-label::after,
.site-header .nav-link:not(.nav-link-strong, .nav-link-portal):focus-visible .nav-label::after,
.site-header .nav-link:not(.nav-link-strong, .nav-link-portal)[aria-current="page"] .nav-label::after {
  width: 100%;
}

.site-header .nav-link-strong .nav-label::after,
.site-header .nav-link-portal .nav-label::after {
  display: none;
}

/* Preview-only customer portal: a compact editorial access marker rather than
   the generic status-dot pill used by the shared baseline. */
.site-header .portal-link {
  position: relative;
  display: grid;
  width: 9.25rem;
  min-height: 3.15rem;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  align-items: end;
  gap: 0.28rem 0.55rem;
  padding: 0.28rem 0 0.55rem;
  border: 0;
  border-bottom: 1px solid rgb(17 21 19 / 24%);
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 0 1px;
  color: #1d2420;
  box-shadow: none;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1;
  transition: color 220ms ease, background-size 360ms cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header .portal-link::before {
  grid-column: 1 / -1;
  color: #6b746f;
  content: "CLIENT ACCESS";
  font-size: 0.49rem;
  font-weight: 760;
  letter-spacing: 0.18em;
  line-height: 1;
}

.site-header .portal-link::after {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  content: "↗";
  font-size: 0.92rem;
  font-weight: 520;
  line-height: 1;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header .portal-link .portal-status {
  display: none;
}

.site-header .portal-link > span:last-child {
  grid-column: 1;
  grid-row: 2;
}

.site-header .portal-link:hover,
.site-header .portal-link:focus-visible {
  border-color: rgb(17 21 19 / 24%);
  background-size: 100% 1px;
  color: #3f725f;
  transform: none;
}

.site-header .portal-link:hover::after,
.site-header .portal-link:focus-visible::after {
  transform: translate(0.15rem, -0.15rem);
}

.study-stage {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(7rem, 12vw, 11rem) clamp(1.25rem, 7.5vw, 9rem) clamp(7.4rem, 12vw, 9.3rem);
  align-items: end;
  isolation: isolate;
}

.study-stage::before,
.study-stage::after {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  transition: opacity 360ms ease;
}

.study-stage::before {
  background:
    linear-gradient(90deg, rgb(7 10 8 / 70%) 0%, rgb(7 10 8 / 18%) 56%, rgb(7 10 8 / 42%) 100%),
    url("../../assets/cases-actual/about-hero-ai-poster.webp") center 48% / cover no-repeat;
}

.study-stage::after {
  z-index: -1;
  background: linear-gradient(180deg, rgb(5 8 6 / 8%) 0%, rgb(5 8 6 / 16%) 52%, rgb(5 8 6 / 66%) 100%);
}

.stage-content {
  max-width: 58rem;
  color: var(--study-white);
}

.stage-eyebrow {
  margin: 0 0 1.5rem;
  color: rgb(247 249 247 / 74%);
  font-size: clamp(0.63rem, 0.72vw, 0.75rem);
  font-weight: 720;
  letter-spacing: 0.18em;
}

.stage-content h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.4rem, 6.7vw, 7.2rem);
  font-weight: 680;
  letter-spacing: -0.075em;
  line-height: 0.95;
  word-break: keep-all;
}

.stage-description {
  max-width: 48rem;
  margin: 2rem 0 0;
  color: rgb(247 249 247 / 76%);
  font-size: clamp(0.82rem, 1vw, 0.98rem);
  line-height: 1.75;
  word-break: keep-all;
}

.stage-index {
  position: absolute;
  right: clamp(1.25rem, 7.5vw, 9rem);
  bottom: clamp(7.6rem, 12vw, 9.5rem);
  margin: 0;
  color: rgb(247 249 247 / 56%);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.study-controls {
  position: fixed;
  z-index: 110;
  right: clamp(1rem, 3.3vw, 4rem);
  bottom: clamp(1rem, 2.2vw, 2rem);
  left: clamp(1rem, 3.3vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}

.study-controls > div {
  pointer-events: auto;
}

.original-summary {
  display: grid;
  min-width: min(36rem, 42vw);
  gap: 0.25rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.58rem;
  background: rgb(7 10 8 / 80%);
  color: var(--study-white);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.original-summary strong {
  font-size: 0.76rem;
}

.original-summary span {
  color: rgb(247 249 247 / 62%);
  font-size: 0.64rem;
}

.tone-switcher {
  display: flex;
  gap: 0.16rem;
  padding: 0.26rem;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 0.62rem;
  background: rgb(8 12 10 / 88%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.tone-switcher button {
  min-height: 2rem;
  padding: 0 0.68rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: #dbe1dd;
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.tone-switcher button[aria-pressed="true"] {
  background: var(--study-white);
  color: var(--study-ink);
}

body[data-tone="light"] .study-stage::before {
  background:
    linear-gradient(rgb(18 26 22 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(18 26 22 / 5%) 1px, transparent 1px),
    #f2f4f1;
  background-size: 5rem 5rem, 5rem 5rem, auto;
}

body[data-tone="light"] .study-stage::after {
  opacity: 0;
}

body[data-tone="light"] .stage-content,
body[data-tone="light"] .stage-index {
  color: var(--study-ink);
}

body[data-tone="light"] .stage-eyebrow,
body[data-tone="light"] .stage-description {
  color: #5d6761;
}

body[data-tone="light"] .original-summary {
  border-color: rgb(17 21 19 / 14%);
  background: rgb(255 255 255 / 90%);
  color: var(--study-ink);
}

body[data-tone="light"] .original-summary span {
  color: #59615d;
}

body[data-tone="dark"] .study-stage::before {
  background:
    radial-gradient(circle at 72% 30%, rgb(93 133 116 / 19%), transparent 24rem),
    linear-gradient(145deg, #111715, #050806 72%);
}

body[data-tone="dark"] .study-stage::after {
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 24%));
}

body[data-tone="dark"] .site-header .brand,
body[data-tone="dark"] .site-header .portal-link {
  color: var(--study-white);
}

body[data-tone="dark"] .site-header .brand-symbol {
  filter: invert(1);
}

body[data-tone="dark"] .site-header .portal-link {
  border-color: rgb(255 255 255 / 26%);
  background-color: transparent;
  color: var(--study-white);
}

body[data-tone="dark"] .site-header .portal-link::before {
  color: rgb(248 250 248 / 58%);
}

@media (max-width: 48rem) {
  .site-header .portal-link {
    display: none;
  }

  .study-stage {
    padding: 7rem 1.25rem 8.8rem;
  }

  .stage-content h1 {
    max-width: 8.5ch;
    font-size: clamp(3.15rem, 15.3vw, 4.1rem);
  }

  .stage-description {
    margin-top: 1.8rem;
    font-size: 0.78rem;
    line-height: 1.65;
  }

  .stage-index,
  .original-summary {
    display: none;
  }

  .study-controls {
    right: 0.85rem;
    bottom: 0.85rem;
    left: 0.85rem;
  }

  .tone-switcher {
    width: 100%;
  }

  .tone-switcher button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
