@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --paper: #fff;
  --ink: #151514;
  --muted: #66645f;
  --quiet: #85827c;
  --surface-soft: #f4f3f0;
  --surface-hover: #ebe9e5;
  --radius-surface: 38px;
  --radius-control: 20px;
  --radius-choice: 15px;
}

* { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; scroll-behavior: smooth; background: var(--paper); }
body { min-width: 0; min-height: 100svh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(21, 21, 20, .56); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.site-header { width: 100%; padding-inline: clamp(14px, 1.15vw, 20px); margin: 0; }
main { flex: 1 0 auto; width: min(940px, calc(100% - 48px)); margin-inline: auto; }
.home-page { min-height: calc(100svh - 58px); display: flex; flex-direction: column; justify-content: center; }

.site-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 680; letter-spacing: -.035em; }
.brand img { display: block; width: 27px; height: 27px; object-fit: contain; }
.site-header nav, .site-footer nav { display: flex; align-items: center; gap: 23px; color: var(--muted); font-size: 14px; font-weight: 520; }
.site-header nav a, .site-footer nav a { transition: color 140ms ease; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--ink); }

.workbench { width: 100%; margin: 0 auto; }
.artwork-column { width: 100%; max-width: 850px; margin-inline: auto; }
.artwork-topline { min-height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 7px; }
.file-detail { min-width: 0; color: var(--muted); font-size: 13px; font-weight: 520; }
.file-detail span { max-width: min(50vw, 460px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 560; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.text-button:hover, .text-button[aria-pressed="true"] { background: var(--surface-soft); color: var(--ink); }

.artwork-stage {
  position: relative;
  min-height: 340px;
  max-height: 510px;
  overflow: visible;
  isolation: isolate;
  border: 1px solid #f0efec;
  border-radius: var(--radius-surface);
  background: #faf9f7;
}
.artwork-stage.has-image {
  width: min(100%, calc(clamp(340px, 52vw, 510px) * max(0.67, var(--artwork-ratio, 1.67))));
  min-height: 0;
  max-height: 510px;
  aspect-ratio: max(0.67, var(--artwork-ratio, 1.67));
  margin-inline: auto;
  transition: width 360ms cubic-bezier(.2,.7,.2,1), border-radius 360ms ease;
}

.canvas-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: inherit;
  background: #fff;
}

@supports (corner-shape: squircle) { .artwork-stage, .canvas-wrap, .release img { corner-shape: squircle; } }
.canvas-wrap[data-background="transparent"] {
  background-color: #fff;
  background-image: linear-gradient(45deg, #e9e8e5 25%, transparent 25%), linear-gradient(-45deg, #e9e8e5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e8e5 75%), linear-gradient(-45deg, transparent 75%, #e9e8e5 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

#grain-preview { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 560ms cubic-bezier(.2, .7, .2, 1), filter 650ms cubic-bezier(.2, .7, .2, 1); filter: blur(7px); }
.artwork-stage.has-image #grain-preview { opacity: 1; filter: blur(0); }
.artwork-stage.is-dragging .canvas-wrap { box-shadow: inset 0 0 0 2px var(--ink); }

.welcome-state { position: relative; z-index: 1; min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 19px; padding: 24px; text-align: center; transition: opacity 340ms ease, transform 440ms cubic-bezier(.2,.7,.2,1), filter 450ms ease; }
.typing-prompt { display: inline-block; min-height: 1.25em; border-inline-end: 1.5px solid var(--ink); white-space: nowrap; font-size: clamp(24px, 3vw, 33px); line-height: 1.25; letter-spacing: -.055em; font-weight: 530; animation: caret-blink .82s step-end infinite; }
@keyframes caret-blink { 50% { border-color: transparent; } }
.welcome-actions { display: flex; align-items: center; justify-content: center; gap: 18px; }
.welcome-formats { color: var(--quiet); font-size: 12px; letter-spacing: .01em; }
.sample-button { min-height: 42px; padding: 0 4px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 560; cursor: pointer; text-decoration: underline; text-decoration-color: #c8c6c1; text-underline-offset: 4px; }
.sample-button:hover { color: var(--ink); text-decoration-color: currentColor; }

.upload-button, .tool-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-control);
  font-size: 15px;
  line-height: 1.1;
  font-weight: 610;
  letter-spacing: -.018em;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

@supports (corner-shape: squircle) {
  .upload-button, .tool-button, .icon-button, .artwork-toolbar,
  .settings-popover, .popover-close, .processing-indicator,
  .segmented-control, .segmented-control button, .custom-color input,
  .not-found a, .site-footer, .footer-mark { corner-shape: squircle; }
}
.upload-button { padding: 0 18px; }
.primary-button { background: #171716; color: #fff; box-shadow: 0 3px 0 #050505, 0 6px 13px rgba(0, 0, 0, .12); transform: translateY(-1px); }
.primary-button:hover:not(:disabled) { background: #292927; box-shadow: 0 4px 0 #050505, 0 8px 18px rgba(0, 0, 0, .14); transform: translateY(-2px); }
.primary-button:active:not(:disabled) { box-shadow: 0 1px 0 #050505, 0 2px 5px rgba(0, 0, 0, .12); transform: translateY(2px); }
.secondary-button { background: #f5f4f1; color: var(--ink); box-shadow: 0 2px 0 #dedcd7; transform: translateY(-1px); }
.secondary-button:hover:not(:disabled) { background: #eceae6; box-shadow: 0 3px 0 #d5d2cc; transform: translateY(-2px); }
.secondary-button:active:not(:disabled) { box-shadow: 0 1px 0 #d5d2cc; transform: translateY(1px); }
.upload-button svg, .tool-button svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.tool-button svg circle { fill: none; }

.artwork-stage.has-image .welcome-state { position: absolute; inset: 0; min-height: 0; opacity: 0; pointer-events: none; transform: scale(.985); filter: blur(5px); }
.artwork-stage.is-opening .welcome-state { opacity: .2; filter: blur(3px); }
.processing-indicator { position: absolute; z-index: 3; top: 50%; left: 50%; display: inline-flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid rgba(21, 21, 20, .08); border-radius: 16px; background: rgba(255, 255, 255, .83); box-shadow: 0 12px 30px rgba(15, 15, 12, .08); color: var(--ink); font-size: 14px; font-weight: 560; opacity: 0; pointer-events: none; transform: translate(-50%, -42%); backdrop-filter: blur(14px); transition: opacity 180ms ease, transform 220ms ease; }
.artwork-stage.is-processing .processing-indicator { opacity: 1; transform: translate(-50%, -50%); }
.processing-spinner { width: 15px; height: 15px; border: 1.5px solid #c7c5c0; border-top-color: var(--ink); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.artwork-toolbar { position: absolute; z-index: 5; right: 0; bottom: 14px; left: 0; display: flex; align-items: center; justify-content: space-between; width: max-content; max-width: calc(100% - 24px); margin-inline: auto; padding: 7px; border: 1px solid rgba(21, 21, 20, .09); border-radius: 28px; background: rgba(255, 255, 255, .86); box-shadow: 0 14px 35px rgba(24, 23, 20, .12), 0 2px 6px rgba(24, 23, 20, .06); opacity: 0; pointer-events: none; transform: translateY(12px); backdrop-filter: blur(20px) saturate(1.15); transition: opacity 260ms ease, transform 360ms cubic-bezier(.2,.7,.2,1); }
.artwork-stage.has-image .artwork-toolbar { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tool-group, .export-actions { display: flex; align-items: center; gap: 4px; }
.tool-button { min-height: 40px; padding: 0 13px; border-radius: 18px; font-size: 14px; }
.icon-button { width: 40px; padding: 0; border-radius: 16px; background: transparent; box-shadow: none; transform: none; }
.icon-button:hover, .icon-button[aria-pressed="true"] { background: rgba(22, 22, 20, .07); }
.selected-tool { padding-inline: 12px 15px; background: rgba(22, 22, 20, .07); box-shadow: none; transform: none; }
.selected-tool:hover { background: rgba(22, 22, 20, .11); }
.export-actions { margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(21, 21, 20, .1); }
.tool-button:disabled { opacity: .46; cursor: wait; }

.settings-popover { position: absolute; z-index: 6; top: 12px; right: 12px; width: min(352px, calc(100% - 24px)); padding: 18px; border: 1px solid rgba(255, 255, 255, .95); border-radius: 30px; background: rgba(255, 255, 255, .86); box-shadow: 0 18px 55px rgba(20, 19, 16, .16), 0 2px 8px rgba(20, 19, 16, .06); backdrop-filter: blur(26px) saturate(1.16); animation: popover-in 180ms cubic-bezier(.2,.75,.2,1) both; }
@keyframes popover-in { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.popover-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.popover-heading h2 { margin: 0; font-size: 15px; font-weight: 620; letter-spacing: -.025em; }
.popover-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 14px; background: transparent; color: var(--muted); cursor: pointer; }
.popover-close:hover { background: var(--surface-soft); color: var(--ink); }
.popover-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.range-control + .range-control { margin-top: 13px; }
.control-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 14px; font-weight: 570; letter-spacing: -.015em; }
.control-label output { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 500; }
.range-control input[type="range"] { width: 100%; height: 24px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.range-control input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, #171716 0 var(--range-progress, 50%), #e5e4e1 var(--range-progress, 50%) 100%); }
.range-control input[type="range"]::-webkit-slider-thumb { width: 19px; height: 19px; margin-top: -7px; appearance: none; border: 0; border-radius: 10px; background: #171716; box-shadow: 0 0 0 4px #fff; }
.range-control input[type="range"]::-moz-range-track { height: 5px; border: 0; border-radius: 3px; background: linear-gradient(to right, #171716 0 var(--range-progress, 50%), #e5e4e1 var(--range-progress, 50%) 100%); }
.range-control input[type="range"]::-moz-range-thumb { width: 19px; height: 19px; border: 0; border-radius: 10px; background: #171716; box-shadow: 0 0 0 4px #fff; }
.range-hints { display: flex; justify-content: space-between; margin-top: -1px; color: var(--quiet); font-size: 11px; }
.choice-group { min-width: 0; margin: 14px 0 0; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 7px; padding: 0; color: var(--ink); font-size: 13px; font-weight: 580; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; border-radius: 18px; background: var(--surface-soft); }
.background-choice .segmented-control { grid-template-columns: 1fr 1fr 1fr; }
.segmented-control button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 540; cursor: pointer; transition: background-color 120ms ease, color 120ms ease; }
.segmented-control button:hover { color: var(--ink); background: rgba(255, 255, 255, .66); }
.segmented-control button.is-selected { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.custom-color { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 13px; }
.custom-color input { width: 40px; height: 32px; padding: 2px; border: 0; border-radius: 10px; background: var(--surface-soft); cursor: pointer; }

.artwork-bottomline { max-width: 850px; min-height: 34px; display: none; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto; padding: 6px 2px 0; color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.artwork-stage.has-image + .artwork-bottomline, .artwork-stage.has-error + .artwork-bottomline { display: flex; }
#status[data-state="error"] { color: #8e2828; }
.privacy-note { color: var(--quiet); }

.site-footer {
  min-height: clamp(230px, 32vh, 360px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  margin-top: auto;
  padding: 28px clamp(16px, 4vw, 60px) 16px;
  border-radius: 58px 58px 0 0;
  background: #faf7f1;
}
.footer-topline { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 18px; transition: transform 180ms cubic-bezier(.2,.7,.2,1); }
.footer-mark:hover { transform: translateY(-2px); }
.footer-mark img { display: block; width: 40px; height: 40px; }
.site-footer nav { gap: clamp(14px, 2vw, 28px); font-size: 14px; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-wordmark { width: 100%; overflow: hidden; color: var(--ink); font-size: clamp(58px, 20vw, 300px); font-weight: 620; line-height: .72; letter-spacing: -.095em; white-space: nowrap; }

.document-page { max-width: 760px; padding: 58px 0 82px; }
.document-page h1 { margin: 0 0 16px; font-size: clamp(38px, 6vw, 58px); letter-spacing: -.07em; line-height: 1; }
.document-page > p { max-width: 580px; color: var(--muted); line-height: 1.7; }
.help-item { padding: 24px 0 12px; }
.help-item h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.help-item p { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.legal-page > p, .legal-page li { color: var(--muted); line-height: 1.75; }
.legal-page h2 { margin: 31px 0 8px; font-size: 19px; letter-spacing: -.03em; }
.updates-page { max-width: 900px; }
#updates-list { display: grid; gap: 50px; margin-top: 38px; }
.release { padding: 0; }
.release time { color: var(--muted); font-size: 12px; }
.release h2 { margin: 10px 0 8px; font-size: 23px; letter-spacing: -.045em; }
.release p { max-width: 680px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.release img { display: block; width: 100%; height: auto; max-height: 620px; margin-top: 20px; object-fit: contain; object-position: left center; border-radius: var(--radius-surface); background: #fff; }
.not-found { max-width: 700px; margin: 90px auto; padding: 0 24px; }
.not-found h1 { margin: 0; font-size: clamp(42px, 8vw, 56px); letter-spacing: -.07em; }
.not-found p { color: var(--muted); line-height: 1.6; }
.not-found a { min-height: 46px; display: inline-flex; align-items: center; margin-top: 20px; padding: 0 17px; border-radius: var(--radius-control); background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; }

@media (max-width: 700px) {
  .site-header { width: 100%; min-height: 54px; padding-inline: 14px; }
  main { width: calc(100% - 32px); }
  .home-page { min-height: calc(100svh - 54px); }
  .site-footer { min-height: 230px; padding: 22px 14px 14px; border-radius: 38px 38px 0 0; }
  .brand { font-size: 15px; }
  .brand img { width: 25px; height: 25px; }
  .site-header nav, .site-footer nav { gap: 16px; font-size: 13px; }
  .artwork-topline { min-height: 26px; padding-bottom: 6px; }
  .artwork-stage { min-height: 360px; max-height: none; border-radius: 32px; }
  .artwork-stage.has-image {
    width: min(100%, calc(clamp(320px, 92vw, 440px) * max(0.75, var(--artwork-ratio, 1.67))));
    min-height: 0;
    max-height: 510px;
    aspect-ratio: max(0.75, var(--artwork-ratio, 1.67));
  }
  .welcome-state { min-height: 360px; gap: 18px; padding: 20px 14px; }
  .typing-prompt { font-size: clamp(23px, 7.2vw, 30px); }
  .upload-button { min-height: 44px; padding-inline: 14px; font-size: 14px; }
  .welcome-actions { gap: 15px; }
  .artwork-toolbar { bottom: 11px; max-width: calc(100% - 16px); padding: 6px; border-radius: 24px; }
  .tool-group, .export-actions { gap: 2px; }
  .tool-button { min-height: 38px; padding-inline: 10px; gap: 6px; font-size: 13px; }
  .icon-button { width: 37px; padding: 0; }
  .selected-tool { padding-inline: 10px; }
  .export-actions { margin-left: 5px; padding-left: 5px; }
  .tool-button svg { width: 16px; height: 16px; }
  .settings-popover { top: 10px; right: 8px; width: min(352px, calc(100% - 16px)); max-height: calc(100svh - 120px); overflow-y: auto; padding: 16px; border-radius: 26px; }
  .artwork-bottomline { min-height: 31px; font-size: 11px; }
  .footer-mark { width: 42px; height: 42px; border-radius: 16px; }
  .footer-mark img { width: 36px; height: 36px; }
  .site-footer nav { gap: 13px; font-size: 12px; }
  .footer-wordmark { font-size: clamp(58px, 20vw, 144px); letter-spacing: -.09em; }
  .document-page { padding-top: 38px; }
  .updates-page { padding-bottom: 52px; }
}

@media (max-width: 380px) {
  .site-header { width: 100%; padding-inline: 10px; }
  main { width: calc(100% - 24px); }
  .artwork-stage, .welcome-state { min-height: 340px; }
  .tool-button { padding-inline: 8px; font-size: 12px; }
  .icon-button { width: 34px; padding: 0; }
  .selected-tool { padding-inline: 8px; }
  .export-actions { margin-left: 3px; padding-left: 3px; }
  .site-footer { padding-inline: 10px; border-radius: 32px 32px 0 0; }
  .site-footer nav { gap: 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .typing-prompt { border-color: transparent; }
}
