@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --hal-frame: #f2f3f5;
  --hal-surface: #ffffff;
  --hal-surface-quiet: #fafafc;
  --hal-ink: #171729;
  --hal-ink-muted: #5a5c72;
  --hal-ink-faint: #8a8ca1;
  --hal-border: #e8e8ee;
  --hal-border-strong: #d8d8e2;
  --hal-peach: #ffd5bd;
  --hal-rose: #f8b0cc;
  --hal-violet: #c193f5;
  --hal-sky: #9fdffb;
  --hal-magenta: #c5197c;
  --hal-magenta-hover: #a8155f;
  --hal-magenta-ring: rgba(197, 25, 124, .28);
  --hal-display: "Instrument Serif", Georgia, serif;
  --hal-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --hal-shadow-1: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 1px 2px rgba(23, 23, 41, .04), 0 8px 18px -8px rgba(23, 23, 41, .08);
  --hal-shadow-2: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 2px 4px rgba(23, 23, 41, .05), 0 18px 32px -16px rgba(23, 23, 41, .12);
  --hal-shadow-stage: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(23, 23, 41, .03), 0 40px 60px -30px rgba(23, 23, 41, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--hal-frame);
  color: var(--hal-ink);
  font-family: var(--hal-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--hal-magenta); color: #fff; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.hal-frame { min-height: 100vh; padding: 16px; background: var(--hal-frame); }
.hal-stage {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 28px;
  background: var(--hal-surface);
  box-shadow: var(--hal-shadow-stage);
}
.hal-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(55% 60% at 18% 95%, var(--hal-peach) 0%, rgba(255, 213, 189, 0) 70%),
    radial-gradient(48% 55% at 38% 88%, var(--hal-rose) 0%, rgba(248, 176, 204, 0) 72%),
    radial-gradient(55% 60% at 55% 82%, var(--hal-violet) 0%, rgba(193, 147, 245, 0) 70%),
    radial-gradient(60% 65% at 82% 78%, var(--hal-sky) 0%, rgba(159, 223, 251, 0) 72%);
}
.hal-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, #fff 0%, rgba(255, 255, 255, .94) 15%, rgba(255, 255, 255, .6) 36%, rgba(255, 255, 255, .16) 60%, rgba(255, 255, 255, 0) 78%);
}
.hal-stage > * { position: relative; z-index: 1; }

.hal-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 28px 40px;
}
.hal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--hal-ink);
  font-family: var(--hal-display);
  font-size: 27px;
  letter-spacing: -.02em;
  line-height: 1;
  text-decoration: none;
}
.hal-brand__mark, .hal-footer__mark { color: var(--hal-ink); font-family: Georgia, serif; font-size: 18px; }
.hal-nav__links { display: flex; align-items: center; justify-content: center; gap: 34px; }
.hal-nav__links a { color: var(--hal-ink); font-size: 13px; font-weight: 500; text-decoration: none; transition: color 160ms ease; }
.hal-nav__links a:hover { color: var(--hal-magenta); }
.hal-access {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hal-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--hal-shadow-1);
  color: var(--hal-ink-muted);
  font-size: 13px;
  font-weight: 500;
}
.hal-access__dot { width: 7px; height: 7px; border-radius: 50%; background: #2ea36b; box-shadow: 0 0 0 3px rgba(46, 163, 107, .14); }

.hal-hero { display: flex; flex-direction: column; align-items: center; padding: 58px 24px 96px; text-align: center; }
.hal-kicker, .hal-panel-kicker { margin: 0 0 9px; color: var(--hal-magenta); font-size: 13px; font-weight: 500; letter-spacing: .02em; }
.hal-display {
  max-width: 900px;
  margin: 0;
  color: var(--hal-ink);
  font-family: var(--hal-display);
  font-size: clamp(58px, 8vw, 104px);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: .95;
  text-wrap: balance;
}
.hal-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3em;
  padding: .08em .2em .12em;
  border: 1px solid var(--hal-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 2px 4px rgba(108, 60, 140, .08), 0 14px 28px -10px rgba(108, 60, 140, .18);
  vertical-align: middle;
  font-size: .72em;
  line-height: .9;
}
.hal-lede { max-width: 570px; margin: 24px 0 40px; color: var(--hal-ink-muted); font-size: 18px; line-height: 1.6; }

.hal-studio {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, .96fr);
  width: min(100%, 1000px);
  overflow: hidden;
  border: 1px solid var(--hal-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--hal-shadow-2);
  text-align: left;
}
.hal-editor, .hal-preview { padding: 32px; }
.hal-editor { border-right: 1px solid var(--hal-border); }
.hal-preview { background: rgba(250, 250, 252, .68); }
.hal-panel-heading, .hal-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hal-panel-heading { margin-bottom: 28px; }
.hal-panel-heading h2, .hal-result h2 { margin: 0; font-size: 25px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.hal-panel-kicker { margin-bottom: 7px; }
.hal-panel-note, .hal-status { color: var(--hal-ink-muted); font-size: 12px; white-space: nowrap; }
.hal-status { padding: 6px 10px; border-radius: 999px; background: var(--hal-surface); border: 1px solid var(--hal-border); }
.hal-field { display: flex; flex-direction: column; gap: 8px; margin: 0; color: var(--hal-ink); font-size: 13px; font-weight: 500; }
.hal-field small { color: var(--hal-ink-muted); font-weight: 400; }
.hal-field--destination { margin-bottom: 32px; }
.hal-input, .hal-select {
  width: 100%;
  height: 52px;
  border: 1px solid var(--hal-border);
  border-radius: 999px;
  outline: 0;
  background: var(--hal-surface);
  color: var(--hal-ink);
  box-shadow: var(--hal-shadow-1);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.hal-input { padding: 0 18px; }
.hal-select { padding: 0 14px; appearance: auto; }
.hal-input::placeholder { color: var(--hal-ink-muted); }
.hal-input:focus-visible, .hal-select:focus-visible, .hal-color:focus-visible, .hal-color-mode:focus-visible, .hal-file:focus-visible { border-color: var(--hal-magenta); box-shadow: var(--hal-shadow-1), 0 0 0 4px var(--hal-magenta-ring); outline: 0; }
.hal-section-heading { align-items: center; margin-bottom: 17px; }
.hal-section-heading h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.hal-ghost-button { border: 0; padding: 4px 0; background: transparent; color: var(--hal-ink-muted); font-size: 13px; }
.hal-ghost-button:hover { color: var(--hal-magenta); }
.hal-control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin-bottom: 20px; }
.hal-color-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.hal-color { width: 100%; height: 42px; padding: 4px; border: 1px solid var(--hal-border); border-radius: 999px; background: var(--hal-surface); cursor: pointer; }
.hal-color-mode { height: 42px; min-width: 98px; padding: 0 10px; border: 1px solid var(--hal-border); border-radius: 999px; background: var(--hal-surface); color: var(--hal-ink); font-size: 12px; }
.hal-color:disabled { cursor: not-allowed; opacity: .42; }
.hal-field--logo { margin-bottom: 18px; }
.hal-file { width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--hal-border); border-radius: 999px; background: var(--hal-surface); color: var(--hal-ink-muted); font-size: 12px; }
.hal-file-note { margin-top: -2px; color: var(--hal-ink-muted); font-size: 12px; font-weight: 400; }
.hal-message { min-height: 24px; margin-bottom: 7px; color: var(--hal-ink-muted); font-size: 13px; line-height: 1.4; }
.hal-message.error { color: #b4254c; }
.hal-message.success { color: #087443; }
.hal-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; padding: 0 20px; border: 1px solid transparent; font-size: 14px; font-weight: 500; line-height: 1; transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.hal-button:focus-visible { outline: 0; box-shadow: var(--hal-shadow-1), 0 0 0 4px var(--hal-magenta-ring); }
.hal-button--primary { width: 100%; color: #fff; background: var(--hal-magenta); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(80, 10, 50, .18), 0 12px 20px -10px rgba(197, 25, 124, .6); }
.hal-button--primary:hover { background: var(--hal-magenta-hover); transform: translateY(-1px); }
.hal-button--secondary { color: var(--hal-ink); border-color: var(--hal-border); background: var(--hal-surface); box-shadow: var(--hal-shadow-1); }
.hal-button--secondary:hover:not(:disabled) { border-color: var(--hal-border-strong); box-shadow: var(--hal-shadow-2); }
.hal-button:disabled { cursor: not-allowed; opacity: .48; }

.hal-qr-frame { display: grid; place-items: center; min-height: 360px; margin-bottom: 18px; border-radius: 18px; background-color: rgba(255, 255, 255, .82); background-image: linear-gradient(45deg, rgba(23, 23, 41, .045) 25%, transparent 25%), linear-gradient(-45deg, rgba(23, 23, 41, .045) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(23, 23, 41, .045) 75%), linear-gradient(-45deg, transparent 75%, rgba(23, 23, 41, .045) 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
#qr-canvas { display: none; width: min(100%, 330px); height: auto; border-radius: 14px; }
#empty-preview { max-width: 190px; margin: 0; color: var(--hal-ink-muted); font-size: 13px; line-height: 1.5; text-align: center; }
.hal-downloads { display: grid; gap: 10px; }

.hal-result { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; width: min(100%, 1000px); margin-top: 20px; padding: 25px 28px; border: 1px solid var(--hal-border); border-radius: 20px; background: var(--hal-surface); box-shadow: var(--hal-shadow-1); text-align: left; }
#result[hidden] { display: none; }
.hal-result > div > p:last-child { max-width: 380px; margin: 10px 0 0; color: var(--hal-ink-muted); font-size: 13px; line-height: 1.55; }
.hal-link-list { display: grid; gap: 10px; }
.hal-link-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--hal-border); border-radius: 14px; font-size: 12px; }
.hal-link-row > span { color: var(--hal-ink-muted); font-weight: 500; }
.hal-link-row a { overflow: hidden; color: var(--hal-ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hal-copy { border: 0; border-radius: 999px; padding: 7px 10px; color: var(--hal-ink); background: var(--hal-surface-quiet); font-size: 12px; font-weight: 500; }
.hal-copy:hover { color: var(--hal-magenta); }
.hal-note { display: flex; align-items: flex-start; gap: 10px; width: min(100%, 320px); margin: 30px 40px 0 auto; color: var(--hal-ink-muted); font-size: 13px; line-height: 1.5; }
.hal-note p { margin: 0; }
.hal-note__mark { color: var(--hal-ink); font-family: Georgia, serif; font-size: 16px; line-height: 1.3; }
.hal-footer { display: flex; justify-content: space-between; gap: 24px; width: min(100%, 1000px); margin: 82px auto 0; padding: 24px 0 34px; border-top: 1px solid rgba(23, 23, 41, .08); color: var(--hal-ink-muted); font-size: 12px; }
.hal-footer > span:first-child { color: var(--hal-ink); font-family: var(--hal-display); font-size: 20px; }

@media (max-width: 860px) {
  .hal-frame { padding: 10px; }
  .hal-stage { min-height: calc(100vh - 20px); border-radius: 24px; }
  .hal-nav { grid-template-columns: auto 1fr auto; gap: 12px; padding: 22px 22px; }
  .hal-nav__links { display: none; }
  .hal-hero { padding: 46px 16px 72px; }
  .hal-display { font-size: clamp(54px, 14vw, 82px); }
  .hal-lede { margin-bottom: 30px; font-size: 16px; }
  .hal-studio { grid-template-columns: 1fr; }
  .hal-editor { border-right: 0; border-bottom: 1px solid var(--hal-border); }
  .hal-result { grid-template-columns: 1fr; }
  .hal-note { margin-right: 22px; }
  .hal-footer { margin-top: 60px; padding-inline: 6px; }
}

@media (max-width: 520px) {
  .hal-access { padding: 0 10px; font-size: 11px; }
  .hal-brand { font-size: 24px; }
  .hal-editor, .hal-preview { padding: 22px; }
  .hal-control-grid { gap: 14px 10px; }
  .hal-qr-frame { min-height: 280px; }
  .hal-link-row { grid-template-columns: 1fr auto; }
  .hal-link-row a { grid-column: 1 / -1; grid-row: 2; }
  .hal-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}
