/* Hwaro Studios site styles. Colours and type are set once here. */
:root {
  --green: #0e3a2b;
  --green-deep: #0a2e22;
  --paper: #ece5d8;
  --ink: #151412;
  --orange: #ee4a25;
  --magenta: #d61f8e;
  --text: #efe9dc;
  --muted: rgba(239, 233, 220, 0.6);
  --line: rgba(239, 233, 220, 0.22);
  --panel-w: clamp(330px, 27vw, 430px);
  --bar-h: 54px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--green);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0 0 0.9em; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- layout ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  min-height: 100vh;
}
.left { padding: 0 20px 90px; border-right: 1px solid var(--line); min-width: 0; }
.panel {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  padding: 0 20px 48px;
}

.bar {
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 1.2rem; letter-spacing: -0.01em;
}
.name { font-weight: 700; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
/* The wordmark: the name drawn from plain shapes, no font. Files for use elsewhere are in logo/. */
.wordmark { height: 20px; width: auto; display: block; overflow: visible; }
.name:hover { color: var(--text); }
.lang { color: var(--muted); white-space: nowrap; }
.lang button[aria-pressed="true"] { color: var(--text); }
.lang button:hover { color: var(--orange); }
.jump { display: none; }
.panel .bar { justify-content: flex-end; font-size: 1.05rem; }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  padding: 16px 0 44px;
  font-size: 1.1rem; color: var(--muted);
}
.filters button[aria-pressed="true"] { color: var(--text); }
.filters button:hover { color: var(--orange); }
/* The count sits out of the row so the row can expand without anything jumping, and fades while Beauty is open. */
.filters { position: relative; }
.count { position: absolute; right: 0; top: 19px; font-size: 0.9rem; transition: opacity 0.3s ease; }
.filters:has(.group:hover) .count, .filters:has(.group:focus-within) .count, .filters:has(.group.open) .count { opacity: 0; }

/* Beauty opens its product types to the right, pushing the other markets along. */
.group { display: inline-flex; align-items: baseline; }
.group > button::after { content: "›"; display: inline-block; margin-left: 7px; color: var(--muted); transition: transform 0.4s ease, opacity 0.4s ease; }
.subs {
  display: inline-flex; gap: 20px; white-space: nowrap; overflow: hidden;
  max-width: 0; opacity: 0; margin-left: 0;
  transition: max-width 0.55s cubic-bezier(0.22, 0.7, 0.2, 1), margin-left 0.55s cubic-bezier(0.22, 0.7, 0.2, 1), opacity 0.35s ease;
}
.group:hover .subs, .group:focus-within .subs, .group.open .subs { max-width: 34rem; opacity: 1; margin-left: 18px; }
.group:hover > button::after, .group:focus-within > button::after, .group.open > button::after { transform: translateX(3px); opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .subs, .group > button::after { transition: none; } }

.empty { margin: 0 0 40px; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--muted); max-width: 24ch; line-height: 1.2; }
.empty a { color: var(--text); white-space: nowrap; }
.empty a:hover { color: var(--orange); }

/* ---------- work grid ---------- */
.grid { columns: 4 210px; column-gap: 24px; }
.card { break-inside: avoid; margin: 0 0 38px; display: block; }
.card[hidden] { display: none; }
.card .art {
  position: relative; display: block; width: 100%;
  cursor: default; text-align: left;
}
.card.live .art, .card.open .art { cursor: pointer; }
.card.open a.art:hover { color: inherit; }
.face { display: block; }
.face.b { position: absolute; inset: 0; visibility: hidden; }
.poster { display: block; width: 100%; height: auto; }
/* The swap is instant on purpose: no fade. */
@media (hover: hover) {
  .card .art:hover .face.a, .card .art:focus-visible .face.a { visibility: hidden; }
  .card .art:hover .face.b, .card .art:focus-visible .face.b { visibility: visible; }
}
.card.flip .face.a { visibility: hidden; }
.card.flip .face.b { visibility: visible; }

/* Hovering one card eases the others back a little. Remove these two rules to switch it off. */
.card { transition: opacity 0.28s ease; }
.grid.hovering .card:not(.hot) { opacity: 0.7; }

/* Finished films: the still sits in the poster's window and plays on hover. */
.card.live .win { position: absolute; left: 5.333%; width: 89.333%; object-fit: cover; background: var(--green-deep); z-index: 0; }
.card.live .over { position: relative; z-index: 1; }
.poster text { font-family: var(--font); }

/* The small "Hover to play" mark on the first film. It goes away after the first hover. */
.hint {
  position: absolute; z-index: 2; right: 10%; top: 5.5%;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--paper);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1;
  padding: 7px 9px 6px;
}
.hint::before {
  content: ""; border-left: 7px solid var(--orange);
  border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .hint::before { animation: none; } }
.grid.discovered .hint { display: none; }

.cap { padding: 10px 2px 0; }
.cap h3 { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.cap .sub { margin: 1px 0 8px; font-size: 0.86rem; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
/* Tags: a flat shape and a small tracked label, like the marks on a printed poster. */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.64rem; font-weight: 700; line-height: 1;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
}
.tag.watch { background: var(--orange); color: var(--ink); padding: 5px 7px 4px; }
.tag.soon { color: var(--muted); font-weight: 600; padding: 5px 7px 4px; box-shadow: inset 0 0 0 1px var(--line); }
.tag i, .filters i { display: inline-block; width: 9px; height: 9px; flex: none; }
.filters i { margin-right: 7px; }
.t-serum i { background: var(--orange); border-radius: 50%; }
.t-toner i { background: var(--paper); }
.t-cleanser i { width: 0; height: 0; border-left: 5.5px solid transparent; border-right: 5.5px solid transparent; border-bottom: 10px solid var(--magenta); }
.t-cream i { background: var(--paper); transform: rotate(45deg) scale(0.82); }

/* ---------- right panel ---------- */
.about { padding: 18px 0 6px; font-size: 1.06rem; letter-spacing: -0.005em; }
.about .note { font-size: 0.86rem; color: var(--muted); }
.facts { margin: 14px 0 0; display: grid; grid-template-columns: 5.2em 1fr; gap: 3px 12px; font-size: 0.95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.inquiry { margin-top: 38px; }
.inquiry h2 {
  margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  font-size: 1.35rem; font-weight: 600; letter-spacing: -0.015em;
}
.field { display: block; margin-top: 16px; }
.field span { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 10px 11px;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); }
.send {
  margin-top: 20px; width: 100%;
  background: var(--paper); color: var(--ink);
  font-weight: 700; padding: 13px 16px; border-radius: 2px;
}
.send:hover { background: var(--orange); }
.form-note { margin-top: 10px; font-size: 0.8rem; color: var(--muted); }

.foot { margin-top: 70px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); max-width: 62ch; }

/* ---------- film viewer ---------- */
dialog.viewer {
  border: 0; padding: 0; background: var(--green-deep); color: var(--text);
  width: min(920px, 94vw); max-height: 94vh; border-radius: 3px;
}
dialog.viewer::backdrop { background: rgba(4, 18, 13, 0.82); }
.viewer-in { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.viewer video { display: block; height: min(86vh, 760px); aspect-ratio: 9 / 16; background: #000; }
.viewer .info { padding: 26px 26px 22px; display: flex; flex-direction: column; }
.viewer h2 { margin: 0 0 4px; font-size: 2rem; letter-spacing: -0.02em; line-height: 1.05; }
.viewer .sub { color: var(--muted); margin-bottom: 18px; }
.viewer .note { font-size: 0.82rem; color: var(--muted); margin-top: auto; }
.viewer .close { align-self: flex-end; margin-bottom: 18px; color: var(--muted); font-size: 0.95rem; }
.viewer .close:hover { color: var(--orange); }

/* ---------- private pitch pages ---------- */
.pitch { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100vh; }
.pitch video { display: block; height: 100vh; max-width: 62vw; aspect-ratio: 9 / 16; background: #000; }
.pitch .info { padding: 0 28px 40px; display: flex; flex-direction: column; max-width: 560px; }
.pitch h1 { margin: 34px 0 6px; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.03em; line-height: 1; }
.pitch .sub { font-size: 1.1rem; margin-bottom: 26px; }
.pitch .cuts { color: var(--muted); margin-bottom: 26px; }
.pitch .cuts button[aria-pressed="true"] { color: var(--text); }
.pitch .note { font-size: 0.86rem; color: var(--muted); }
.pitch .contact { margin-top: auto; padding-top: 26px; border-top: 1px solid var(--line); font-size: 1.1rem; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .left { border-right: 0; padding-bottom: 40px; }
  .panel { position: static; height: auto; border-top: 1px solid var(--line); }
  .panel .bar { justify-content: flex-start; }
  .jump { display: inline; color: var(--muted); }
  .grid { columns: 2 150px; column-gap: 16px; }
  .bar { font-size: 1.05rem; }
  .wordmark { height: 15px; }
  .filters { font-size: 1rem; padding-bottom: 28px; }
  /* On a phone the product types drop onto their own line under Beauty. */
  .group { display: contents; }
  .subs { flex-basis: 100%; flex-wrap: wrap; white-space: normal; gap: 6px 16px; max-width: none; max-height: 0; margin-left: 0;
          transition: max-height 0.45s ease, opacity 0.35s ease, margin-top 0.45s ease; }
  .group:hover .subs, .group:focus-within .subs, .group.open .subs { max-width: none; max-height: 6rem; margin-left: 0; margin-top: 6px; }
  .count { display: none; }
  .viewer-in { grid-template-columns: 1fr; }
  .viewer video { width: 100%; height: auto; max-height: 70vh; }
  .pitch { grid-template-columns: 1fr; }
  .pitch video { width: 100%; height: auto; max-width: none; max-height: 78vh; }
  .pitch .info { padding: 0 20px 36px; }
}
