/* Sogilex Build. Same look as sogilex.com: night plum, sunset gradient. Fonts self-hosted (SIL OFL). */
@font-face { font-family: "Unbounded"; font-weight: 500; font-display: swap; src: url("fonts/unbounded-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url("fonts/unbounded-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("fonts/montserrat-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #120A18;
  --panel: rgba(26, 15, 34, .92);
  --line: #33223F;
  --ctl: #4A3357;
  --text: #F7EFF3;
  --mute: #BBA9C2;
  --lime: #FF9A4D;
  --magenta: #F0458F;
  --sunset: linear-gradient(90deg, #F0458F, #FF9A4D);
  --on-lime: #120A18;
  --warn: #f2b84b;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font: 400 16px/1.55 var(--body); overflow-x: hidden;
  background: var(--bg) radial-gradient(ellipse 70% 45% at 70% 60vh, rgba(242, 73, 107, .25), rgba(217, 30, 140, .07) 45%, transparent 70%) no-repeat;
}
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
a { color: var(--magenta); }
a:hover { color: var(--lime); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }
.grain { position: fixed; inset: -50%; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.scene-on body { background: var(--bg); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
header, main, footer { position: relative; z-index: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--mute); margin: 0; }

/* header */
.top { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: rgba(18, 10, 24, .7); border-bottom: 1px solid var(--line); }
.top .row { min-height: 64px; }
.mark { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 12px; }
.mark:hover { color: var(--text); }
.mark .wordmark { font-family: 'Montserrat', var(--body); font-weight: 600; font-size: 17px; letter-spacing: .16em; }
.mark .product { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); border: 1px solid var(--lime); padding: 3px 8px; border-radius: 999px; }
nav { display: flex; gap: 2px; align-items: center; }
nav a, .navbtn { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); text-decoration: none; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 8px; background: none; border: 0; cursor: pointer; }
nav a:hover, .navbtn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

/* hero */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin: 0; display: inline-flex; align-items: center; gap: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(240, 69, 143, .55); } 70% { box-shadow: 0 0 0 12px rgba(240, 69, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 69, 143, 0); } }
.hero { padding: 72px 24px 48px; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -.02em; margin: 16px 0 20px; }
.lime { background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(17px, 1.8vw, 20px); color: var(--mute); max-width: 52ch; margin: 0; }

/* studio */
.studio { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.brief { padding: 22px; position: sticky; top: 84px; }
.panel-h { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.15; margin: 0; }
.panel-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.quota { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--lime); }
.quota.out { color: var(--warn); }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 0; }
.opt { text-transform: none; letter-spacing: 0; }
.hint { font-family: var(--mono); font-size: 11px; color: var(--mute); align-self: flex-end; }
.input { width: 100%; min-height: 44px; padding: 12px; border-radius: 12px; background: #120A18; color: var(--text); border: 1px solid var(--ctl); font: inherit; font-size: 15px; }
textarea.input { resize: vertical; line-height: 1.5; min-height: 140px; }
.input::placeholder { color: #8A7A91; }
.input:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(240, 69, 143, .2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--ctl); color: var(--mute); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; transition: all .15s; }
.chips input:checked + span { background: var(--sunset); border-color: transparent; color: var(--on-lime); }
.chips input:focus-visible + span { outline: 3px solid var(--lime); outline-offset: 2px; }
.accent-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#accent { width: 44px; height: 44px; border: 1px solid var(--ctl); border-radius: 10px; background: #120A18; padding: 4px; cursor: pointer; }
.swatches { display: flex; gap: 6px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #120A18; background: var(--c); box-shadow: 0 0 0 1px var(--ctl); cursor: pointer; position: relative; }
.swatches button::after { content: ""; position: absolute; inset: -6px; } /* 44px tap target */
.check-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--mute); text-transform: none !important; letter-spacing: 0 !important; font-family: var(--body) !important; cursor: pointer; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--lime); }

.btn { background: var(--sunset); color: var(--on-lime); font: 600 16px var(--body); border: 0; text-decoration: none; min-height: 48px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .2s, box-shadow .2s, opacity .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(240, 69, 143, .25); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { min-height: 56px; font-size: 17px; }
.btn.working { background: repeating-linear-gradient(-45deg, #F0458F 0 14px, #FF9A4D 14px 28px); background-size: 40px 40px; animation: stripes 1s linear infinite; opacity: 1; }
@keyframes stripes { to { background-position: 40px 0; } }
.ghost { color: var(--text); background: rgba(255, 255, 255, .03); border: 1px solid var(--ctl); font: 500 15px var(--body); min-height: 48px; padding: 0 18px; border-radius: 999px; cursor: pointer; }
.ghost:hover:not(:disabled) { border-color: var(--mute); }
.ghost:disabled { opacity: .45; cursor: not-allowed; }
.status { margin: 0; font-size: 15px; min-height: 1.5em; color: var(--mute); }
.status.ok { color: var(--lime); }
.status.err { color: var(--warn); }

/* preview */
.preview { overflow: hidden; display: flex; flex-direction: column; }
.chrome { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(18, 10, 24, .7); }
.lights { display: flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #3a3e46; }
.lights i { background: #4A3357; }
.addr { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--mute); background: #120A18; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.size { font-family: var(--mono); font-size: 12px; color: var(--lime); min-width: 6ch; text-align: right; }
.frame-wrap { position: relative; height: min(72vh, 760px); min-height: 420px; background: #fff; }
#frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; background: #120A18; color: var(--mute); text-align: center; padding: 24px; }
.empty p { position: relative; margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.empty-grid { position: absolute; inset: 0; background:
  linear-gradient(rgba(240, 69, 143, .06) 1px, transparent 1px) 0 0 / 100% 36px,
  linear-gradient(90deg, rgba(240, 69, 143, .06) 1px, transparent 1px) 0 0 / 36px 100%; }
.preview.building .empty-grid { animation: scan 2.2s linear infinite; }
@keyframes scan { to { background-position: 0 36px, 36px 0; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }

/* info sections */
.block { padding: 72px 24px 8px; }
.block h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; margin: 0 0 28px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.steps .n { font-family: var(--mono); font-size: 13px; color: var(--lime); }
.steps h3 { font-size: 19px; font-weight: 600; margin: 10px 0 6px; }
.steps p { margin: 0; color: var(--mute); }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 78ch; }
.notes li { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--mute); }
.notes b { color: var(--text); font-weight: 600; }
.notes code { font-family: var(--mono); font-size: 13px; color: var(--lime); }
.foot { border-top: 1px solid var(--line); margin-top: 80px; background: rgba(18, 10, 24, .92); }
.foot .row { min-height: 72px; font-size: 14px; color: var(--mute); }

@media (max-width: 900px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .brief { position: static; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .frame-wrap { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* password dialog */
.pwdialog { max-width: min(440px, calc(100vw - 32px)); width: 100%; padding: 24px; border-radius: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--ctl); }
.pwdialog::backdrop { background: rgba(0, 0, 0, .6); }
.pwdialog form[method="dialog"] { margin: 0; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--ctl); }
.btn-secondary:hover:not(:disabled) { box-shadow: none; border-color: var(--text); }

/* publishing */
.publish { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pub-form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.pub-form label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.pub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pub-row .input { flex: 1 1 180px; width: auto; }
.pub-suffix { font-family: var(--mono); font-size: 14px; color: var(--mute); }
.hint-line { margin: 0; font-size: 13px; color: var(--mute); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--magenta); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.linkish:hover { color: var(--lime); }
.msgdialog { max-width: min(640px, calc(100vw - 32px)); }
.msg-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(18, 10, 24, .6); }
.msg time { display: block; font-family: var(--mono); font-size: 12px; color: var(--mute); margin-bottom: 6px; }
.msg dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.msg dt { color: var(--mute); font-size: 14px; }
.msg dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* logo (brand kit) */
.logo-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 16px; border: 2px dashed var(--ctl); border-radius: 14px; background: rgba(18, 10, 24, .5); color: var(--mute); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.logo-drop strong { color: var(--text); font-weight: 600; font-size: 16px; }
.logo-drop span { font-size: 13px; }
.logo-drop:hover, .logo-drop.over { border-color: var(--lime); background: rgba(255, 154, 77, .08); }
.logo-drop:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.logo-have { display: flex; gap: 14px; align-items: center; }
.logo-thumb { flex: 0 0 auto; width: 120px; height: 72px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; padding: 8px; background: repeating-conic-gradient(#2a1f30 0 25%, #20172a 0 50%) 0 0 / 16px 16px; }
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.logo-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-colors { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.logo-colors i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); display: inline-block; }
.logo-actions { display: inline-flex; gap: 14px; }
.logo-status:empty { display: none; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--magenta); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.linkish:hover { color: var(--lime); }

.fake-label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.swatches .logo-swatch { box-shadow: 0 0 0 1px var(--lime); }

/* Your sites: reopen any finished build */
.versions { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(18, 10, 24, .7); }
.versions label { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.versions select { flex: 1; min-width: 0; min-height: 38px; border-radius: 8px; background: #120A18; color: var(--text); border: 1px solid var(--ctl); font: 14px var(--body); padding: 0 8px; text-overflow: ellipsis; }
.versions select:disabled { opacity: .6; }

/* Phones: four header links (signed in) must fit without sideways scrolling */
@media (max-width: 520px) {
  nav { flex-wrap: wrap; }
  nav a, .navbtn { padding: 0 8px; font-size: 12px; letter-spacing: .04em; }
}

/* Change your site: chat edits */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.editchat { padding: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.edit-intro { margin: 0; font-size: 14px; }
.chatlog { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.chatlog:empty { display: none; }
.bubble { max-width: 88%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.owner { align-self: flex-end; background: rgba(242, 73, 107, .16); border: 1px solid rgba(242, 73, 107, .35); }
.bubble.sogilex { align-self: flex-start; background: #1A1120; border: 1px solid var(--line); }
.bubble.err { border-color: var(--warn); color: var(--text); }
.bubble.working { color: var(--mute); font-style: italic; }
.edit-form { display: flex; flex-direction: column; gap: 8px; }
.edit-form textarea { min-height: 64px; resize: vertical; }
.edit-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.edit-row #undo { margin-right: auto; }
