/* ShapeCraft in the wiktorkluczny.me look: sky-blue paper, ink outlines, offset shadows, coral and yellow accents. */
:root {
  --ink: #101318; --paper: #bce1fa; --coral: #ff684f; --yellow: #ffd166; --white: #fffdf8;
  --muted: #3d4350; --subtle: #5b6372;
  --line: 3px solid var(--ink); --thin: 2px solid var(--ink);
  --shadow: 7px 7px 0 var(--ink); --control-radius: 8px;
  --font: Arial, Helvetica, sans-serif; --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 13px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--white); }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar { height: 70px; border-bottom: var(--line); display: flex; align-items: center; padding: 0 24px; gap: 22px; background: var(--paper); }
.home-link { font-size: 1.25rem; font-weight: 900; letter-spacing: -.06em; padding-right: 18px; border-right: var(--thin); line-height: 32px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 175px; }
/* Tiny version of the portfolio's coral orb, with two eyes. */
.brand-mark { position: relative; width: 34px; height: 34px; flex: none; background: var(--coral); border: var(--thin); border-radius: 52% 48% 45% 55%; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-7deg); }
.brand-mark span { position: absolute; top: 8px; width: 9px; height: 9px; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); }
.brand-mark span:first-child { left: 6px; }
.brand-mark span:last-child { right: 6px; }
.brand-name { font-weight: 900; font-size: 1.05rem; letter-spacing: -.05em; }
.brand-subtitle { color: var(--muted); font-size: 10px; font-weight: 800; margin-top: 2px; }
.project-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.project-title input { background: var(--white); border: var(--thin); border-radius: var(--control-radius); outline: 0; font-weight: 800; width: 230px; padding: 7px 10px; }
.project-title input:focus { box-shadow: 3px 3px 0 var(--ink); }
.status-dot { width: 10px; height: 10px; background: var(--coral); border: 2px solid var(--ink); display: inline-block; border-radius: 50%; flex: none; }
.status-dot.green { background: #58c98a; margin-right: 8px; vertical-align: -1px; }
.top-actions, .canvas-tools, .drawer-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-divider { width: 2px; height: 24px; background: var(--ink); margin: 0 5px; border-radius: 2px; }

/* ---------- buttons ---------- */
.button { display: inline-flex; align-items: center; gap: 6px; border: var(--line); border-radius: var(--control-radius); padding: 9px 15px; font-weight: 900; box-shadow: 4px 4px 0 var(--ink); transition: transform .18s, box-shadow .18s, background-color .18s; }
.button:hover, .button:focus-visible { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.button.primary { background: var(--coral); }
.button.secondary { background: var(--white); }
.toolbar-button, .icon-button { display: inline-grid; place-items: center; background: var(--white); color: var(--ink); width: 32px; height: 32px; border: var(--thin); border-radius: var(--control-radius); font-size: 16px; font-weight: 900; box-shadow: 2px 2px 0 var(--ink); transition: transform .18s, box-shadow .18s, background-color .18s; }
.toolbar-button:hover, .icon-button:hover:not(:disabled) { background: var(--yellow); transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* ---------- workspace ---------- */
.workspace { display: grid; grid-template-columns: 258px 1fr 290px; min-height: calc(100vh - 70px); flex: 1; }
.sidebar { background: var(--white); }
.left-panel { border-right: var(--line); padding: 22px 17px; }
.right-panel { border-left: var(--line); padding: 22px 18px; overflow-y: auto; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 0 2px 20px; }
.eyebrow { display: inline-flex; border: var(--thin); border-radius: var(--control-radius); background: var(--yellow); padding: 4px 9px; font-size: 10px; font-weight: 900; margin-bottom: 9px; }
.panel-heading h2, .drawer-header h2 { margin: 0; font-size: 1.45rem; line-height: 1; font-weight: 900; letter-spacing: -.06em; }
.search-wrap { height: 40px; border: var(--thin); background: var(--white); border-radius: var(--control-radius); display: flex; align-items: center; padding: 0 10px; gap: 7px; color: var(--ink); font-weight: 900; margin-bottom: 22px; box-shadow: 3px 3px 0 var(--ink); }
.search-wrap input { background: transparent; border: 0; outline: 0; width: 100%; font-size: 12px; font-weight: 700; }
.search-wrap input::placeholder { color: var(--subtle); }
.section-label { color: var(--ink); font-size: 10px; text-transform: uppercase; font-weight: 900; letter-spacing: .1em; margin-bottom: 11px; }
.library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.library-item { background: var(--white); border: var(--thin); border-radius: 12px; padding: 10px 9px 9px; text-align: left; box-shadow: 3px 3px 0 var(--ink); transition: transform .18s, box-shadow .18s, background-color .18s; }
.library-item:hover, .library-item:focus-visible { background: var(--yellow); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.library-icon { height: 24px; color: var(--coral); display: flex; align-items: center; font-size: 19px; font-weight: 900; -webkit-text-stroke: .4px var(--ink); }
.library-label { font-size: 11px; font-weight: 800; margin-top: 5px; }
.tip-card { border: var(--thin); background: var(--yellow); border-radius: 14px; padding: 12px; display: flex; gap: 9px; margin-top: 26px; box-shadow: 4px 4px 0 var(--ink); }
.tip-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--ink); color: var(--white); font-size: 14px; }
.tip-card strong { font-size: 12px; font-weight: 900; }
.tip-card p { margin: 4px 0 0; line-height: 1.45; font-size: 11px; }

/* ---------- canvas ---------- */
.canvas-area { background: var(--paper); min-width: 0; }
.canvas-toolbar { height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px; border-bottom: var(--line); }
.breadcrumbs { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 800; min-width: 0; white-space: nowrap; }
.breadcrumbs strong { color: var(--ink); font-weight: 900; overflow: hidden; text-overflow: ellipsis; }
.tool-button { color: var(--ink); background: var(--white); border: var(--thin); border-radius: var(--control-radius); padding: 6px 10px; font-size: 12px; font-weight: 900; transition: transform .18s, background-color .18s, color .18s, box-shadow .18s; }
.tool-button:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.tool-button.active { background: var(--ink); color: var(--white); }
.zoom-value { font-family: var(--mono); font-size: 11px; font-weight: 700; width: 42px; text-align: center; }
.stage-wrap { height: calc(100vh - 182px); min-height: 500px; padding: 36px 40px 32px; position: relative; overflow: auto; display: flex; justify-content: center; align-items: center; }
.stage-ruler { position: absolute; color: var(--muted); font-family: var(--mono); font-size: 9px; font-weight: 700; }
.ruler-top { left: calc(50% - 380px); top: 15px; width: 760px; display: flex; justify-content: space-between; }
.ruler-left { top: calc(50% - 270px); left: 13px; height: 540px; display: flex; flex-direction: column; justify-content: space-between; }
.stage { width: 760px; height: 540px; position: relative; flex: 0 0 auto; border: var(--line); border-radius: 14px; overflow: hidden; background-color: var(--white); background-image: radial-gradient(#10131833 1.2px, transparent 1.2px); background-size: 20px 20px; box-shadow: var(--shadow); transition: transform .2s; }
.stage.grid-off { background-image: none; }
.canvas-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none; }
.canvas-empty.hidden { display: none; }
/* Empty states reuse the coral orb mascot. */
.empty-orb { position: relative; width: 74px; height: 74px; margin: 0 auto 18px; background: var(--coral); border: 3px solid var(--ink); border-radius: 52% 48% 45% 55%; box-shadow: 5px 6px 0 var(--ink); transform: rotate(-7deg); animation: orb-bob 4s ease-in-out infinite; }
.empty-orb span { position: absolute; top: 18px; width: 18px; height: 18px; border: 3px solid var(--ink); border-radius: 50%; background: var(--white); }
.empty-orb span:first-child { left: 14px; }
.empty-orb span:last-child { right: 14px; }
.empty-orb span::after { content: ""; position: absolute; left: 4px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.empty-orb.small { width: 50px; height: 50px; box-shadow: 4px 4px 0 var(--ink); }
.empty-orb.small span { top: 12px; width: 13px; height: 13px; border-width: 2px; }
.empty-orb.small span:first-child { left: 9px; }
.empty-orb.small span:last-child { right: 9px; }
.empty-orb.small span::after { left: 3px; top: 2px; width: 4px; height: 4px; }
@keyframes orb-bob { 50% { transform: rotate(-3deg) translateY(-6px); } }
.canvas-empty h3 { margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: -.06em; }
.canvas-empty p { margin: 8px 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.canvas-status { height: 50px; border-top: var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px; font-size: 11px; font-weight: 800; }
.design-element { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; user-select: none; cursor: move; }
.design-element.selected { outline: 3px solid var(--coral); outline-offset: 3px; }
.design-element.selected::after { content: ""; position: absolute; inset: -6px; border: 2px dashed var(--ink); pointer-events: none; }
.resize-handle { position: absolute; width: 10px; height: 10px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 2px; z-index: 3; }
.resize-handle.br { right: -5px; bottom: -5px; cursor: nwse-resize; }

/* ---------- inspector and forms ---------- */
.inspector-empty { height: 260px; display: grid; place-content: center; text-align: center; padding: 40px 22px; line-height: 1.5; }
.inspector-empty p { max-width: 180px; margin: 10px auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.inspector-preview { height: 100px; background: var(--paper); border: var(--thin); border-radius: 12px; display: grid; place-items: center; margin-bottom: 20px; position: relative; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.form-section { border-top: var(--thin); padding: 16px 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-grid label, .field-wide { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 800; }
.field-wide { margin-bottom: 11px; }
.field-grid input, .field-wide input, .field-wide select, .field-wide textarea { width: 100%; background: var(--white); border: var(--thin); border-radius: var(--control-radius); padding: 8px; outline: none; font-size: 12px; font-weight: 700; }
.field-grid input:focus, .field-wide input:focus, .field-wide select:focus, .field-wide textarea:focus { box-shadow: 3px 3px 0 var(--coral); }
.field-wide input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--coral); }
.field-wide textarea { resize: vertical; font-family: var(--mono); }
.color-row { display: flex; gap: 12px; margin-bottom: 14px; }
.color-row label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 800; flex: 1; }
.color-control { display: flex; align-items: center; gap: 6px; background: var(--white); border: var(--thin); border-radius: var(--control-radius); padding: 3px 7px 3px 3px; }
.color-control input { width: 24px; height: 24px; border: 0; padding: 0; background: none; }
.color-control span { font-family: var(--mono); font-size: 10px; font-weight: 700; }

/* ---------- code drawer ---------- */
.code-drawer { position: fixed; left: 258px; right: 290px; bottom: 0; max-height: 72vh; transform: translateY(115%); transition: transform .28s ease; z-index: 10; background: var(--coral); border: var(--line); border-bottom: 0; box-shadow: 0 -7px 0 var(--ink); border-radius: 26px 26px 0 0; padding: 20px 24px; }
.code-drawer.open { transform: translateY(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.drawer-header .eyebrow { background: var(--white); }
.code-drawer pre { background: var(--ink); color: var(--white); border: var(--line); border-radius: 14px; padding: 18px; margin: 0; max-height: 55vh; overflow: auto; font: 12px/1.65 var(--mono); white-space: pre-wrap; }

/* ---------- workspace tabs and options ---------- */
.workspace-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 20px; }
.workspace-tab { padding: 8px 6px; border: var(--thin); border-radius: var(--control-radius); background: var(--white); font-size: 12px; font-weight: 900; transition: transform .18s, box-shadow .18s, background-color .18s, color .18s; }
.workspace-tab:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.workspace-tab.active { background: var(--ink); color: var(--white); }
.options-panel .form-section:first-child { border-top: 0; padding-top: 0; }
.option-color-field { margin-top: 14px; }
.toggle-field { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 800; margin-bottom: 16px; }
.toggle-field input { appearance: none; width: 40px; height: 22px; padding: 0; border-radius: 12px; background: var(--white); border: var(--thin); position: relative; cursor: pointer; }
.toggle-field input::after { content: ""; position: absolute; width: 12px; height: 12px; top: 3px; left: 3px; border-radius: 50%; background: var(--ink); transition: .18s ease; }
.toggle-field input:checked { background: var(--coral); }
.toggle-field input:checked::after { left: 21px; }

@media (max-width: 1050px) { .workspace { grid-template-columns: 220px 1fr; } .right-panel { display: none; } .code-drawer { left: 220px; right: 0; } }
@media (max-width: 700px) {
  .left-panel { display: none; } .workspace { display: block; } .code-drawer { left: 0; }
  .topbar { padding: 0 12px; gap: 10px; } .home-link { display: none; } .brand { min-width: 0; } .brand > div:last-child { display: none; }
  .project-title { display: none; } .top-actions { margin-left: auto; } .top-actions .button { padding: 8px 11px; white-space: nowrap; }
  .stage-wrap { justify-content: flex-start; padding-left: 25px; } .ruler-top { left: 25px; }
  .canvas-toolbar { padding: 0 12px; } .tool-button span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
