/* CustomizeYouProfile configurator: GitHub-flavored, light and dark. */

:root, [data-theme="light"] {
  --bg: #ffffff; --bg-page: #f6f8fa; --bg-subtle: #f6f8fa; --bg-inset: #eff2f5;
  --fg: #1f2328; --muted: #59636e; --border: #d1d9e0; --border-muted: #d1d9e0b3;
  --accent: #0969da; --accent-bg: #ddf4ff; --success: #1a7f37; --success-btn: #1f883d; --success-btn-hover: #1c8139;
  --warn: #9a6700; --danger: #d1242f; --shadow: 0 1px 0 #1f23280a, 0 8px 24px #1f232812;
  --readme-bg: #ffffff; --tile-on: #ddf4ff; --tile-on-border: #54aeff;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #151b23; --bg-page: #0d1117; --bg-subtle: #151b23; --bg-inset: #010409;
  --fg: #f0f6fc; --muted: #9198a1; --border: #3d444d; --border-muted: #3d444db3;
  --accent: #4493f8; --accent-bg: #121d2f; --success: #3fb950; --success-btn: #238636; --success-btn-hover: #29903b;
  --warn: #d29922; --danger: #f85149; --shadow: 0 0 0 1px #3d444d, 0 8px 24px #01040966;
  --readme-bg: #0d1117; --tile-on: #121d2f; --tile-on-border: #1f6feb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg-page); }
body {
  margin: 0; color: var(--fg); background: var(--bg-page);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
code { background: var(--bg-inset); border-radius: 6px; padding: .15em .4em; }
.booting { padding: 48px; text-align: center; color: var(--muted); }

/* header & hero */
.top {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: var(--bg); border-bottom: 1px solid var(--border-muted); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--success-btn);
  background-image: linear-gradient(to top, #fff 0 0), linear-gradient(to top, #fff 0 0), linear-gradient(to top, #fff 0 0);
  background-size: 4px 8px, 4px 13px, 4px 17px; background-position: 5px 13px, 11px 8px, 17px 4px; background-repeat: no-repeat;
}
.top nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.top nav a { color: var(--fg); font-weight: 500; }
.chip {
  font: inherit; font-weight: 600; font-size: 12px; color: var(--fg); background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.chip:hover { border-color: var(--muted); }
.hero { max-width: 1280px; margin: 0 auto; padding: 40px 24px 8px; }
.hero h1 { font-size: 32px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.5px; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 720px; }

/* layout */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; gap: 24px;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr); align-items: start;
}
.layout > * { min-width: 0; }                 /* long code lines scroll instead of widening the column */
.controls { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.card { min-width: 0; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 16px; }
.card h3 { margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 700; flex: none;
}
.spacer { flex: 1; }
.opt { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.hint { display: block; color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.muted { color: var(--muted); }
.good { color: var(--success); } .warn { color: var(--warn); } .bad { color: var(--danger); }

/* form controls */
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; min-height: 32px; width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus, button:focus-visible, .tile:has(input:focus-visible), .segmented label:has(input:focus-visible) {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.field { display: block; margin: 12px 0 0; }
.label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.cd { margin-bottom: 8px; }
.row.cd input[type="date"] { flex: 0 0 150px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; }
.check input { width: auto; min-height: 0; }

.login { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg-subtle); }
.login:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.login .prefix { padding: 6px 0 6px 10px; color: var(--muted); white-space: nowrap; }
.login input { border: 0; background: transparent; padding-left: 2px; outline: none; }
.login .btn { border-radius: 0; border: 0; border-left: 1px solid var(--border); }
.status { display: flex; align-items: center; gap: 10px; margin-top: 12px; min-height: 36px; font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; font-size: 14px;
  color: var(--fg); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 14px; min-height: 32px; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--bg-inset); }
.btn.primary { background: var(--success-btn); border-color: #1f232826; color: #fff; }
.btn.primary:hover { background: var(--success-btn-hover); }
.btn.small { font-size: 12px; min-height: 26px; padding: 2px 10px; }
.link { font: inherit; font-size: 12px; font-weight: 500; color: var(--accent); background: none; border: 0; padding: 2px 6px; cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon { font: inherit; font-size: 18px; line-height: 1; width: 32px; height: 32px; flex: none; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.icon:hover { color: var(--danger); border-color: var(--border); }

/* effect tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-body {
  display: block; height: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); transition: border-color .12s, background .12s;
}
.tile-body::before {
  content: ""; position: absolute; left: 11px; top: 12px; width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg-subtle);
}
.tile input:checked + .tile-body { background: var(--tile-on); border-color: var(--tile-on-border); }
.tile input:checked + .tile-body::before {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--accent);
}
.tile-body b { display: block; font-size: 13px; }
.tile-body small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.tile:hover .tile-body { border-color: var(--muted); }

/* segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; background: var(--bg-inset); border-radius: 8px; }
.segmented label { display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 10px; border-radius: 6px; text-align: center; }
.segmented b { display: block; font-size: 13px; font-weight: 600; }
.segmented small { display: block; font-size: 11px; color: var(--muted); }
.segmented input:checked + span { background: var(--bg); box-shadow: 0 1px 2px #1f23281f, 0 0 0 1px var(--border); }
.segmented.compact span { padding: 4px 10px; }
.segmented.mini { grid-auto-columns: auto; }
.segmented.mini span { padding: 2px 10px; }

/* output */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 14px; }
.tabs button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 6px 10px 8px; margin-bottom: -1px; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: #fd8c73; font-weight: 600; }
.code { position: relative; }
.code pre {
  margin: 0; padding: 12px 14px; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px;
  overflow: auto; max-height: 360px; white-space: pre; line-height: 1.55;
}
.code .copy { position: absolute; top: 8px; right: 8px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.steps p { margin: 0 0 8px; }
.steps .btn + .btn { margin-left: 6px; }

/* preview */
.preview { position: sticky; top: 72px; }
.preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.preview-bar h2 { margin: 0; font-size: 16px; }
.preview-bar select { width: auto; min-height: 28px; padding: 2px 8px; font-size: 13px; }
.frame {
  border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: grid; gap: 18px;
  background: var(--readme-bg); max-height: calc(100vh - 170px); overflow: auto; box-shadow: var(--shadow);
}
.frame[data-theme="light"] { background: #ffffff; border-color: #d1d9e0; }
.frame[data-theme="dark"] { background: #0d1117; border-color: #3d444d; }
.frame figure { margin: 0; }
.frame img { display: block; width: 100%; height: auto; }
.frame figcaption { font-size: 11px; color: #8b949e; margin-top: 6px; text-align: center; letter-spacing: .3px; }
.frame .empty { margin: 40px 0; text-align: center; color: #8b949e; }
.problems { margin-bottom: 12px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: 13px; }
.note { color: var(--muted); font-size: 12px; margin: 10px 2px 0; }

footer { max-width: 1280px; margin: 0 auto; padding: 8px 24px 40px; color: var(--muted); font-size: 12px; }

/* small screens: controls first, preview after the effect list */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .preview { position: static; order: 0; }
  .frame { max-height: none; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 26px; }
  .tiles, .grid2 { grid-template-columns: 1fr; }
  .layout, .hero, .top { padding-left: 16px; padding-right: 16px; }
  .top nav a:first-child { display: none; }
  .login .prefix { display: none; }
  .row.cd input[type="date"] { flex-basis: 130px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
