/* pixel.nitaimaarek.com: Material 3 (tokens in tokens.css, Roboto bundled). */

@font-face { font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/roboto-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/roboto-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/roboto-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/roboto-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root { --font: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--md-surface);
  color: var(--md-on-surface);
  font: 400 16px/24px var(--font);
  letter-spacing: .03125em;
}
a { color: var(--md-primary); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { fill: currentColor; }
:focus-visible { outline: 2px solid var(--md-secondary); outline-offset: 2px; }

/* top app bar (small) */
.topbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; height: 64px;
  padding: 0 8px 0 16px; background: var(--md-surface); transition: background-color 200ms linear; }
.topbar.scrolled { background: var(--md-surface-container); }
.topbar .mark { width: 24px; height: 24px; color: var(--md-primary); }
.topbar .title { font: 400 22px/28px var(--font); letter-spacing: 0; }
.spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--md-on-surface-variant); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover { background: color-mix(in srgb, var(--md-on-surface-variant) 8%, transparent); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 8px 16px 48px; }
.intro h1 { font: 400 36px/44px var(--font); letter-spacing: 0; margin: 16px 0 8px; }
.intro p { margin: 0 0 24px; color: var(--md-on-surface-variant); }

/* prompt: outlined text field + filled button */
.ask { display: flex; gap: 12px; align-items: flex-start; max-width: 760px; }
.fieldwrap { flex: 1; min-width: 0; }
.field { position: relative; }
.field input {
  width: 100%; height: 56px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--md-outline);
  background: transparent; color: var(--md-on-surface); font: 400 16px/24px var(--font); letter-spacing: .03125em; outline: none;
}
.field input:hover { border-color: var(--md-on-surface); }
.field input:focus { border: 2px solid var(--md-primary); padding: 0 15px; }
.field label {
  position: absolute; left: 12px; top: 16px; padding: 0 4px; color: var(--md-on-surface-variant); pointer-events: none;
  background: var(--md-surface); transition: top 150ms, font-size 150ms, color 150ms; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: -8px; font-size: 12px; line-height: 16px; }
.field input:focus + label { color: var(--md-primary); }
.field.small input { height: 48px; }
.field.small label { top: 12px; }
.settings .field label { background: var(--md-surface-container-highest); }
.supporting { margin: 4px 16px 0; font-size: 12px; line-height: 16px; letter-spacing: .025em; color: var(--md-on-surface-variant); }

.filled-btn {
  height: 56px; padding: 0 24px 0 16px; border-radius: 16px; display: inline-flex; align-items: center; gap: 8px; flex: none;
  background: var(--md-primary); color: var(--md-on-primary); font: 500 14px/20px var(--font); letter-spacing: .00714em;
}
.filled-btn svg { width: 20px; height: 20px; }
.filled-btn:hover { box-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 / .15); }
.filled-btn:disabled { background: color-mix(in srgb, var(--md-on-surface) 12%, transparent); color: color-mix(in srgb, var(--md-on-surface) 38%, transparent); box-shadow: none; }
.text-btn { height: 40px; padding: 0 12px; border-radius: 20px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--md-primary); font: 500 14px/20px var(--font); letter-spacing: .00714em; }
.text-btn svg { width: 18px; height: 18px; }
.text-btn:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }

/* segmented buttons */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; }
.seg { display: inline-flex; height: 40px; border: 1px solid var(--md-outline); border-radius: 20px; overflow: hidden; }
.seg label { display: flex; align-items: center; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--md-outline); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 16px; min-width: 48px; justify-content: center;
  font: 500 14px/20px var(--font); letter-spacing: .00714em; color: var(--md-on-surface); }
.seg input:checked + span { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.seg input:checked + span::before { content: ""; width: 14px; height: 10px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M5 10 0 5l1.4-1.4L5 7.2 12.6-.4 14 1z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M5 10 0 5l1.4-1.4L5 7.2 12.6-.4 14 1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.seg input:focus-visible + span { outline: 2px solid var(--md-secondary); outline-offset: -3px; }

/* settings card */
.settings { margin-top: 16px; max-width: 760px; padding: 16px 16px 20px; border-radius: 12px; background: var(--md-surface-container-highest); }
.slider-row { display: grid; grid-template-columns: 150px 1fr 3ch; align-items: center; gap: 12px; margin-top: 8px; }
.slider-row label { color: var(--md-on-surface); font-size: 14px; }
.slider-row input { width: 100%; accent-color: var(--md-primary); }
.slider-row output { text-align: right; color: var(--md-on-surface-variant); font-variant-numeric: tabular-nums; font-size: 14px; }
.settings .supporting { margin: 0 0 4px 162px; }
.settings .field { margin-top: 16px; max-width: 320px; }

/* suggestion chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; max-width: 760px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--md-outline-variant);
  color: var(--md-on-surface-variant); font: 500 14px/20px var(--font); letter-spacing: .00714em; white-space: nowrap; }
.chip:hover { background: color-mix(in srgb, var(--md-on-surface-variant) 8%, transparent); }

/* linear progress indicator */
.progress { height: 4px; margin-top: 24px; border-radius: 2px; background: var(--md-secondary-container); overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 2px; background: var(--md-primary); transition: width 120ms linear; }

/* results: filled cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.card { border-radius: 12px; background: var(--md-surface-container-highest); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card canvas {
  width: 100%; aspect-ratio: 1; border-radius: 8px; image-rendering: pixelated; image-rendering: crisp-edges;
  background-color: var(--md-surface-container-lowest);
  background-image:
    linear-gradient(45deg, var(--md-surface-container) 25%, transparent 25%), linear-gradient(-45deg, var(--md-surface-container) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--md-surface-container) 75%), linear-gradient(-45deg, transparent 75%, var(--md-surface-container) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.card.drawing canvas { opacity: .85; }
.card .row { display: flex; align-items: center; gap: 4px; }
.card .meta { flex: 1; min-width: 0; font-size: 12px; line-height: 16px; letter-spacing: .025em; color: var(--md-on-surface-variant); }
.card .icon-btn[disabled] { opacity: .38; cursor: default; }

.status { margin: 16px 0 0; font-size: 14px; color: var(--md-on-surface-variant); min-height: 20px; font-variant-numeric: tabular-nums; }
footer { margin-top: 48px; max-width: 760px; font-size: 14px; line-height: 20px; color: var(--md-on-surface-variant); }
footer p { margin: 0 0 8px; }

/* snackbar */
.snackbar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px));
  padding: 14px 16px; border-radius: 4px; background: var(--md-inverse-surface); color: var(--md-inverse-on-surface);
  font-size: 14px; line-height: 20px; box-shadow: 0 2px 6px 2px rgb(0 0 0 / .15), 0 1px 2px rgb(0 0 0 / .3); z-index: 5; }

@media (max-width: 600px) {
  .intro h1 { font-size: 28px; line-height: 36px; }
  .ask { flex-direction: column; align-items: stretch; }
  .filled-btn { justify-content: center; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 8px; }
  .slider-row { grid-template-columns: 1fr 3ch; }
  .slider-row label { grid-column: 1 / -1; }
  .settings .supporting { margin-left: 0; }
}
