/* ITFLIX design tokens and shared components.
   Layout idea: a switchboard. Square blocks from the wordmark, one signal colour that means "on". */
:root {
  --paper: #f2f3f5;      /* page ground, cool grey biased toward the signal blue */
  --surface: #ffffff;
  --ink: #121212;        /* the wordmark's black */
  --ink-2: #33373f;
  --muted: #636975;
  --line: #d8dbe2;
  --line-2: #e8eaee;
  --on: #1f4dff;         /* signal: a seat that is on, a primary action */
  --on-press: #173bd0;
  --on-soft: #e7ecff;
  --ok: #0a7d4f;  --ok-soft: #e2f3eb;
  --warn: #9a5200; --warn-soft: #fbeedb;
  --crit: #bd3329; --crit-soft: #fbe6e3;
  --panel: #121212;      /* device panels (hero switchboard, footer) */
  --panel-2: #1d1e21;
  --panel-line: #303238;
  --panel-fg: #f2f3f5;
  --panel-muted: #9a9fab;

  /* products: one hue family so a bundle reads as one service. Told apart by lightness: ink, signal, sky. */
  --prod-squad: #1f4dff;  /* ITFLIX 스쿼드 (people) */
  --prod-pm: #121212;     /* Prototie PM (documents) */
  --prod-tycoon: #8fa8ff; /* ProtoTycoon (AI staff) — the bot's eye colour */
  --track: #e8eaee;       /* empty part of meters */

  /* spacing: a 4px grid */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  /* radius: square system; 2px for chips and pills, 4px controls and cards, 8px only for floating panels */
  --r-sm: 2px; --r-lg: 8px;
  /* type scale (px): 12 caption · 14 small · 16 body · 18 lead · 22 title · 28 heading · 40 display */
  --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 28px; --t-3xl: 40px;
  /* elevation: only floating things cast a shadow */
  --shadow-1: 0 1px 2px rgba(18, 18, 18, .08), 0 4px 12px rgba(18, 18, 18, .06);
  --shadow-2: 0 12px 40px rgba(18, 18, 18, .18);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --display: "Archivo", "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --r: 4px;
  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--font); letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.035em; line-height: 1.18; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; }
.num { font-family: var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.eyebrow { font: 700 12px/1 var(--display); font-stretch: 125%; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: #2a2b2f; }
.btn:active { transform: translateY(1px); }
.btn.on { background: var(--on); border-color: var(--on); }
.btn.on:hover { background: var(--on-press); border-color: var(--on-press); }
.btn.line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.line:hover { border-color: var(--ink); background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--on); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* the switch: a square block that slides, like the I in the wordmark */
.sw { position: relative; flex: none; width: 56px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--line-2); transition: background .18s, border-color .18s; }
.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 2px; background: #fff; box-shadow: 0 1px 2px rgba(18, 18, 18, .25); transition: transform .18s cubic-bezier(.3, .7, .3, 1); }
.sw[aria-checked="true"] { background: var(--on); border-color: var(--on); }
.sw[aria-checked="true"]::after { transform: translateX(24px); }
.sw[data-state="requested"] { background: var(--warn); border-color: var(--warn); }
.sw[data-state="requested"]::after, .sw[data-state="ending"]::after { transform: translateX(12px); }
.sw::before { content: ""; position: absolute; inset: -7px -4px; }
.sw[data-state="ending"] { background: var(--muted); border-color: var(--muted); }
.sw[disabled] { opacity: .5; cursor: not-allowed; }
.on-panel .sw { border-color: var(--panel-line); background: #2a2c31; }
.on-panel .sw::after { background: #8b909b; box-shadow: none; }
.on-panel .sw[aria-checked="true"] { background: var(--on); border-color: var(--on); }
.on-panel .sw[aria-checked="true"]::after { background: #fff; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.pill.on { background: var(--on-soft); color: var(--on); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.plain::before { display: none; }

/* forms */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 16px; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--on); outline-offset: -1px; border-color: var(--on); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--on); }
.form-msg { font-size: 14px; font-weight: 600; min-height: 21px; }
.form-msg.err { color: var(--crit); }
.form-msg.ok { color: var(--ok); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); max-width: min(92vw, 520px); padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--crit); }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
thead th { font-size: 12px; font-weight: 700; color: var(--muted); background: #fafbfc; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

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