@charset "utf-8";

/* HABI :B — sub-page shared theme. Inherits the fullscreen cover's
   FILM / AFTER DARK system: near-black plum, hot-pink accent, hard
   editorial framing, thin 1px lines, Arial Black display + Pretendard body. */

:root {
  color-scheme: dark;
  --bg: #0d0911;
  --bg-2: #120c16;
  --panel: rgb(255 250 254 / 3.5%);
  --panel-2: rgb(255 250 254 / 6%);
  --panel-3: rgb(255 250 254 / 9%);
  --glass: rgb(15 10 19 / 58%);
  --glass-2: rgb(20 13 25 / 68%);
  --glass-line: rgb(255 250 254 / 16%);
  --text: #fffafe;
  --muted: rgb(255 250 254 / 66%);
  --muted-strong: rgb(255 250 254 / 84%);
  --line: rgb(255 250 254 / 14%);
  --line-strong: rgb(255 250 254 / 26%);
  --accent: #ff40ad;
  --accent-deep: #de169a;
  --accent-soft: rgb(255 64 173 / 15%);
  --nav-bg: rgb(11 8 14 / 82%);
  --shadow: 0 24px 60px rgb(0 0 0 / 42%);
  --radius: 4px;
  --wrap: 940px;
  --body-font: "Pretendard Variable", Pretendard, "Noto Sans KR",
    "Apple SD Gothic Neo", Arial, sans-serif;
  --display-font: "Arial Black", Impact, "Pretendard Variable", sans-serif;
}

body.light {
  color-scheme: light;
  --bg: #f1eaee;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: rgb(20 12 22 / 3%);
  --panel-3: rgb(20 12 22 / 6%);
  --glass: #ffffff;
  --glass-2: #ffffff;
  --glass-line: rgb(23 18 27 / 12%);
  --text: #17121b;
  --muted: rgb(23 18 27 / 58%);
  --muted-strong: rgb(23 18 27 / 80%);
  --line: rgb(23 18 27 / 12%);
  --line-strong: rgb(23 18 27 / 22%);
  --accent: #d3168f;
  --accent-deep: #b30f79;
  --accent-soft: rgb(211 22 143 / 10%);
  --nav-bg: rgb(255 255 255 / 84%);
  --shadow: 0 20px 44px rgb(120 40 92 / 12%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(
      130% 92% at 80% -8%,
      rgb(255 64 173 / 18%),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgb(9 6 11 / 82%) 0,
      rgb(9 6 11 / 36%) 27%,
      rgb(9 6 11 / 40%) 64%,
      rgb(9 6 11 / 82%) 100%
    ),
    url("assets/habi-bg-night.webp");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center, center, center 28%;
  background-size: cover, cover, cover;
  background-attachment: fixed, fixed, fixed;
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: color 0.35s ease;
}

/* Light mode swaps to the bright day photo under a light wash. */
body.light {
  background-image:
    radial-gradient(
      130% 92% at 80% -8%,
      rgb(255 64 173 / 12%),
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgb(255 250 254 / 76%) 0,
      rgb(255 250 254 / 42%) 27%,
      rgb(255 250 254 / 46%) 64%,
      rgb(255 250 254 / 80%) 100%
    ),
    url("assets/habi-bg-day.webp");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center, center, center 28%;
  background-size: cover, cover, cover;
  background-attachment: fixed, fixed, fixed;
}

/* FOUC guard: content fades in once ready, with a hard fallback. */
.wrap {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.ready .wrap {
  opacity: 1;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
p,
dl,
dd,
figure,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

/* Particle layer (shared with cover fx.js) */
#fx {
  position: fixed;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.fxfb {
  position: absolute;
  bottom: -20px;
  left: var(--x, 50%);
  color: var(--accent);
  font-size: 9px;
  opacity: 0;
  animation: fxfb-rise var(--duration, 18s) var(--delay, 0s) linear infinite;
}

@keyframes fxfb-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0);
  }
  22%,
  62% {
    opacity: 0.16;
  }
  100% {
    opacity: 0;
    transform: translate3d(1.2vw, -104vh, 0) rotate(70deg);
  }
}

/* ============ NAV — FILM / AFTER DARK (no box, fades into page) ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 17px clamp(16px, 4vw, 40px) 24px;
  background: linear-gradient(
    180deg,
    rgb(9 6 11 / 86%) 0%,
    rgb(9 6 11 / 30%) 56%,
    transparent 100%
  );
}

body.light .nav {
  background: linear-gradient(
    180deg,
    rgb(241 234 238 / 92%) 0%,
    rgb(241 234 238 / 42%) 56%,
    transparent 100%
  );
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--display-font);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* REC dot */
.nav-logo::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  content: "";
  animation: rec-blink 2.4s ease-in-out infinite;
}

.nav-logo em {
  align-self: baseline;
  font-family: var(--body-font);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.24em;
  color: var(--accent);
}

@keyframes rec-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.28;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 28px);
}

.nav-menu a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.nav-menu a::after {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transition: width 0.24s ease;
}

.nav-menu a:hover {
  color: var(--text);
}

.nav-menu a.on {
  color: var(--text);
}

.nav-menu a.on::after {
  width: 100%;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 17px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.ask-btn::after {
  font-size: 13px;
  content: "↗";
}

.ask-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* mobile nav */
.nav-burger {
  display: none;
}

@media (max-width: 720px) {
  .nav {
    gap: 14px;
    padding: 13px clamp(16px, 4vw, 40px) 18px;
  }
  .nav-menu {
    position: absolute;
    z-index: 29;
    top: 100%;
    right: 0;
    bottom: auto;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    border-bottom: 1px solid transparent;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: max-height 0.28s ease, visibility 0s linear 0.28s;
  }
  .nav-menu.open {
    max-height: 360px;
    visibility: visible;
    border-bottom-color: var(--line-strong);
    transition: max-height 0.28s ease;
  }
  .nav-menu a {
    padding: 15px clamp(18px, 4vw, 40px);
    border-top: 1px solid var(--line);
    font-size: 14px;
  }
  .nav-menu a::after {
    display: none;
  }
  .nav-menu a.on {
    color: var(--accent);
  }
  .nav-burger {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    background: transparent;
    color: var(--text);
  }
  .nav-burger span,
  .nav-burger span::before,
  .nav-burger span::after {
    position: relative;
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    content: "";
  }
  .nav-burger span::before {
    position: absolute;
    top: -5px;
  }
  .nav-burger span::after {
    position: absolute;
    top: 5px;
  }
}

/* ============ PAGE SHELL ============ */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 46px) clamp(18px, 4vw, 40px) 0;
}

/* film-strip divider (sprocket holes) */
.filmstrip {
  height: 12px;
  margin: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0 2px,
    transparent 2px 16px
  );
  opacity: 0.6;
}

/* reel header (page hero) */
.reel {
  position: relative;
  padding: 10px 0 22px;
  border-bottom: 1px solid var(--line-strong);
  overflow: hidden;
}

.reel-no {
  display: none;
  position: absolute;
  top: -34px;
  right: -6px;
  font-family: var(--display-font);
  font-size: clamp(120px, 22vw, 240px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  pointer-events: none;
  user-select: none;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.24em;
}

.kicker::before {
  width: 26px;
  height: 2px;
  background: currentColor;
  content: "";
}

.reel h1 {
  margin-top: 12px;
  font-family: var(--display-font);
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.reel .reel-sub {
  margin-top: 14px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

/* generic panel */
.panel {
  position: relative;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

body.light .panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.panel-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-h h2 {
  font-family: var(--display-font);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 950;
  letter-spacing: -0.02em;
}

.panel-h .tag {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stack {
  display: grid;
  gap: 16px;
}

@media (max-width: 680px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* label / value rows */
.deflist {
  display: grid;
  gap: 0;
}

.deflist > div {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 10px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.deflist > div:first-child {
  border-top: 0;
}

/* two-column variant (DOSSIER) */
.deflist.grid2 {
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(22px, 3.5vw, 46px);
}

.deflist.grid2 > div {
  grid-template-columns: 112px 1fr;
}

.deflist.grid2 > div:nth-child(2) {
  border-top: 0;
}

@media (max-width: 640px) {
  .deflist.grid2 {
    grid-template-columns: 1fr;
  }
  .deflist.grid2 > div:nth-child(2) {
    border-top: 1px solid var(--line);
  }
}

.deflist dt {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.18em;
  align-self: center;
}

.deflist dd {
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
  align-self: center;
}

@media (max-width: 480px) {
  .deflist > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.chip.accent {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* like / dislike */
.pn {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 560px) {
  .pn {
    grid-template-columns: 1fr;
  }
}

.pn h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.pn h3 i {
  width: 8px;
  height: 8px;
  font-style: normal;
}

.pn .like i {
  background: var(--accent);
}

.pn .dislike i {
  border: 2px solid var(--line-strong);
}

/* footer */
footer {
  margin-top: 46px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

footer .fmark {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display-font);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* marquee band */
.marquee {
  margin-top: 30px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}

.marquee span {
  display: inline-block;
  font-family: var(--display-font);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  animation: marquee 26s linear infinite;
}

.marquee b {
  padding: 0 18px;
  color: var(--accent);
  -webkit-text-stroke: 0;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ============ MODAL ============ */
.mask {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgb(6 4 8 / 72%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mask.open {
  display: grid;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.modal .kicker {
  margin-bottom: 6px;
}

.modal h3 {
  margin-bottom: 16px;
  font-family: var(--display-font);
  font-size: 22px;
  font-weight: 950;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.input {
  min-height: 108px;
  resize: vertical;
}

.btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.btn:hover {
  background: var(--accent-deep);
}

.hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* toast */
#toast {
  position: fixed;
  z-index: 60;
  bottom: 26px;
  left: 50%;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* empty state */
.empty {
  padding: 44px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.empty b {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 20px;
  letter-spacing: 0;
}

/* segmented toggle */
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
}

.seg button {
  padding: 7px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, color 0.2s ease;
}

.seg button.on {
  background: var(--accent);
  color: #fff;
}

/* search */
.search {
  position: relative;
  max-width: 320px;
}

.search input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
}

.search::before {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--muted);
  font-size: 13px;
  content: "⌕";
  transform: translateY(-50%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hero text sits directly on the photo backdrop; soften for legibility
   over the brighter areas of the image. Light mode has no photo, so none. */
.reel h1,
.reel .reel-sub,
.reel .kicker,
.p-name,
.p-read,
.p-quote,
.p-mini {
  text-shadow: 0 1px 14px rgb(6 4 8 / 45%);
}

body.light :is(.reel h1, .reel .reel-sub, .reel .kicker, .p-name, .p-read, .p-quote, .p-mini) {
  text-shadow: none;
}

/* ============ v4.6 — phone shows PC layout + SOOP-app embed safety ============ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* PC-view button: only inside the SOOP-app iframe */
.open-full {
  display: none;
}
body.embed .open-full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-decoration: none;
}

/* Inside an iframe, position:fixed anchors to the whole (huge) iframe box,
   not the visible screen. Re-base those to the document. */
body.embed .nav {
  position: absolute;
  right: 0;
  left: 0;
}
body.embed #fx {
  position: absolute;
}
body.embed #toast {
  position: absolute;
}
body.embed .mask {
  position: absolute;
}
body.embed .mask.open {
  align-items: flex-start;
}
body.embed .modal {
  max-height: none;
}
