/* ExactSize — design tokens + components */

:root {
  --paper:   #f6f7fb;
  --card:    #ffffff;
  --card-2:  #f2f4f9;
  --ink:     #16181f;
  --ink-2:   #5a6272;
  --ink-3:   #8b93a5;
  --line:    #e3e7f0;
  --line-2:  #cfd6e4;

  /* brand — warm orange through to gold */
  --brand:      #d9480f;
  --brand-2:    #e8850a;
  --brand-ink:  #ffffff;
  --brand-soft: #ffeede;
  --grad: linear-gradient(115deg, #c2410c 0%, #ea580c 48%, #f59e0b 100%);

  /* Category hues. None of these may be orange — the brand owns that, and a
     category tint next to an orange button would read as part of the brand. */
  --emerald: #0d9e6e;  --emerald-soft: #dcfaef;
  --indigo:  #3b5bdb;  --indigo-soft:  #e6ebff;
  --rose:    #e11d63;  --rose-soft:    #ffe4ee;
  --slate:   #566372;  --slate-soft:   #e9edf2;
  --teal:    #0d7d8f;  --teal-soft:    #d9f4f7;

  --ok:      #0d9e6e;  --ok-soft:      #dcfaef;
  --warn:    #b45309;  --warn-soft:    #fdf0d5;
  --over:    #dc2626;  --over-soft:    #ffe6e4;

  --shadow:    0 1px 2px rgba(22,24,31,.05), 0 8px 24px rgba(22,24,31,.06);
  --shadow-lg: 0 2px 8px rgba(22,24,31,.07), 0 24px 56px rgba(217,72,15,.14);

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --sans: "Plus Jakarta Sans", "IBM Plex Sans Devanagari", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --display: "Outfit", "IBM Plex Sans Devanagari", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #0b0d14;
    --card:    #141824;
    --card-2:  #1c2130;
    --ink:     #eceff7;
    --ink-2:   #9aa3b8;
    --ink-3:   #6d768d;
    --line:    #242b3c;
    --line-2:  #333c52;

    --brand:      #ff922b;
    --brand-2:    #ffc457;
    --brand-ink:  #24120a;
    --brand-soft: #34200f;
    --grad: linear-gradient(115deg, #e8590c 0%, #ff922b 48%, #ffc457 100%);

    --emerald: #34d8a0;  --emerald-soft: #0c2c22;
    --indigo:  #8da2fb;  --indigo-soft:  #1a2142;
    --rose:    #fb7199;  --rose-soft:    #35131f;
    --slate:   #9aa7b6;  --slate-soft:   #222a34;
    --teal:    #2dd4bf;  --teal-soft:    #0b2b2c;

    --ok:      #34d8a0;  --ok-soft:      #0c2c22;
    --warn:    #f0b429;  --warn-soft:    #2e2411;
    --over:    #fb7185;  --over-soft:    #36141a;

    --shadow:    0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
    --shadow-lg: 0 2px 8px rgba(0,0,0,.5), 0 24px 56px rgba(0,0,0,.55);
  }
}

:root[data-theme="dark"] {
  --paper:   #0b0d14;
  --card:    #141824;
  --card-2:  #1c2130;
  --ink:     #eceff7;
  --ink-2:   #9aa3b8;
  --ink-3:   #6d768d;
  --line:    #242b3c;
  --line-2:  #333c52;

  --brand:      #ff922b;
  --brand-2:    #ffc457;
  --brand-ink:  #24120a;
  --brand-soft: #34200f;
  --grad: linear-gradient(115deg, #e8590c 0%, #ff922b 48%, #ffc457 100%);

  --emerald: #34d8a0;  --emerald-soft: #0c2c22;
  --indigo:  #8da2fb;  --indigo-soft:  #1a2142;
  --rose:    #fb7199;  --rose-soft:    #35131f;
  --slate:   #9aa7b6;  --slate-soft:   #222a34;
  --teal:    #2dd4bf;  --teal-soft:    #0b2b2c;

  --ok:      #34d8a0;  --ok-soft:      #0c2c22;
  --warn:    #f0b429;  --warn-soft:    #2e2411;
  --over:    #fb7185;  --over-soft:    #36141a;

  --shadow:    0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.5), 0 24px 56px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img, canvas { max-width: 100%; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--brand); }

:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* category theming — set --c / --c-soft on any subtree */
.c-emerald { --c: var(--emerald); --c-soft: var(--emerald-soft); }
.c-indigo  { --c: var(--indigo);  --c-soft: var(--indigo-soft); }
.c-rose    { --c: var(--rose);    --c-soft: var(--rose-soft); }
.c-slate   { --c: var(--slate);   --c-soft: var(--slate-soft); }
.c-teal    { --c: var(--teal);     --c-soft: var(--teal-soft); }

/* ---------- shell ---------- */

.wrap { max-width: 1140px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; padding-block: 8px; }
.topbar .spacer { flex: 1; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 20px;
  letter-spacing: -.03em; color: var(--ink); text-decoration: none;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(217,72,15,.35);
}
.brand em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.langtoggle {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: 100px;
  overflow: hidden; background: var(--card);
}
.langtoggle button {
  font: inherit; font-family: var(--display); font-weight: 600; font-size: 12.5px;
  padding: 6px 13px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.langtoggle button[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--display); font-weight: 600; font-size: 14.5px;
  border-radius: 100px; border: 1.5px solid transparent;
  padding: 10px 18px; cursor: pointer; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .14s ease, background .14s ease, transform .08s ease, border-color .14s;
  background: var(--card); color: var(--ink); border-color: var(--line-2);
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(217,72,15,.3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--c, var(--brand)); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--card-2); color: var(--ink); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.lg { padding: 13px 24px; font-size: 15.5px; }
.btn.block { width: 100%; }

/* ---------- cards & fields ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }

.eyebrow {
  font-family: var(--display); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-family: var(--display); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }

input[type="text"], input[type="number"], select, textarea {
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  background: var(--card-2); border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus { border-color: var(--brand); }
input[type="number"] { font-family: var(--mono); }
input[type="range"] { accent-color: var(--c, var(--brand)); width: 100%; }
textarea { resize: vertical; line-height: 1.55; }
select { cursor: pointer; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; min-width: 0; }

/* ---------- badges / notices ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--display); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px;
  background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand));
}
.badge.ok   { background: var(--ok-soft);   color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.over { background: var(--over-soft); color: var(--over); }
.badge.free { background: var(--emerald-soft); color: var(--emerald); }

.notice { border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; border: 1.5px solid var(--line); background: var(--card-2); color: var(--ink-2); }
.notice.ok   { background: var(--ok-soft);   border-color: var(--ok);   color: var(--ok); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.notice.over { background: var(--over-soft); border-color: var(--over); color: var(--over); }

.bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .22s ease; }

.spin {
  width: 15px; height: 15px; border-radius: 50%; flex: none; display: inline-block;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ---------- hero ---------- */

.hero { padding-block: 40px 8px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -40px -10% auto; height: 340px; z-index: -1;
  background: radial-gradient(60% 70% at 18% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
              radial-gradient(50% 60% at 82% 10%, color-mix(in srgb, var(--brand-2) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.06; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-top: 14px; color: var(--ink-2); max-width: 62ch; font-size: 16.5px; }

.trust { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- AI box ---------- */

.aibox { margin-top: 26px; padding: 20px; border-radius: var(--r-xl); position: relative; overflow: hidden; }
.aibox::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.aibox .head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.aibox textarea { min-height: 108px; }
.aibox .actions { display: flex; gap: 12px; margin-top: 14px; align-items: center; flex-wrap: wrap; }

.samples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.samples button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--card-2); border: 1.5px solid var(--line); color: var(--ink-2);
  border-radius: 100px; padding: 6px 13px; font-family: var(--display);
}
.samples button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- plan cards ---------- */

.specs { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 720px) { .specs { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }

.spec {
  border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  padding: 16px; display: flex; flex-direction: column; gap: 11px;
  border-top: 4px solid var(--c, var(--brand));
}
.spec .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spec .name { font-family: var(--display); font-weight: 700; font-size: 15.5px; }
.spec .detail { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.spec .assumed { font-size: 12px; color: var(--warn); }
.spec .go { margin-top: auto; }

/* ---------- size meter ---------- */

.meter { display: flex; flex-direction: column; gap: 7px; }
.meter .track { position: relative; height: 30px; border-radius: var(--r-sm); background: var(--card-2); border: 1.5px solid var(--line); overflow: hidden; }
.meter .band { position: absolute; top: 0; bottom: 0; background: var(--ok-soft); border-left: 2px solid var(--ok); border-right: 2px solid var(--ok); }
.meter .mark { position: absolute; top: -2px; bottom: -2px; width: 4px; border-radius: 3px; background: var(--brand); }
.meter .mark.bad { background: var(--over); }
.meter .scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.meter .result { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.meter .result .big { font-family: var(--mono); font-size: 24px; font-weight: 600; }

/* ---------- dropzone / files ---------- */

.drop {
  border: 2.5px dashed var(--line-2); border-radius: var(--r-xl);
  background: var(--card-2); padding: 30px 18px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--c, var(--brand)); background: var(--c-soft, var(--brand-soft)); }
.drop .big { font-family: var(--display); font-weight: 700; font-size: 15.5px; }
.drop .sub { font-size: 13px; color: var(--ink-2); margin-top: 5px; }

.filelist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.filerow { display: flex; align-items: center; gap: 10px; font-size: 13.5px; background: var(--card-2); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; }
.filerow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filerow .sz { font-family: var(--mono); font-size: 12px; color: var(--ink-2); flex: none; }
.filerow .x { cursor: pointer; border: 0; background: transparent; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0 3px; }
.filerow .x:hover { color: var(--over); }

/* ---------- workspace ---------- */

.work { display: grid; gap: 24px; padding-block: 10px 36px; }
@media (min-width: 920px) { .work.two { grid-template-columns: minmax(0,1fr) 360px; align-items: start; } }

.stagewrap { display: flex; flex-direction: column; gap: 14px; }
.stage {
  background: repeating-conic-gradient(var(--card-2) 0% 25%, var(--card) 0% 50%) 50%/20px 20px;
  border: 1.5px solid var(--line); border-radius: var(--r-lg);
  display: grid; place-items: center; padding: 18px; min-height: 230px;
}
.stage canvas { display: block; max-width: 100%; touch-action: none; cursor: grab; box-shadow: var(--shadow-lg); border-radius: 3px; }
.stage canvas:active { cursor: grabbing; }
.stage .empty { color: var(--ink-3); font-size: 13.5px; text-align: center; }

.stagebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stagebar input[type="range"] { flex: 1 1 140px; min-width: 110px; }

.panel { display: flex; flex-direction: column; gap: 18px; }
.panel .grp { display: flex; flex-direction: column; gap: 11px; }
.panel .grp > h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 700; }

.actualsize { overflow: auto; padding: 12px; background: var(--card-2); border: 1.5px solid var(--line); border-radius: var(--r-sm); }
.actualsize canvas { box-shadow: var(--shadow); }

.textout {
  font-family: var(--mono); font-size: 12px; background: var(--card-2);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px;
  max-height: 180px; overflow: auto; word-break: break-all; white-space: pre-wrap;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.stat { background: var(--card-2); border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px; }
.stat .v { font-family: var(--mono); font-size: 22px; font-weight: 600; line-height: 1.1; }
.stat .k { font-size: 11.5px; color: var(--ink-3); font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* ---------- tool grid ---------- */

.section { padding-block: 34px; }
.section > h2 { font-size: 24px; }
.section > .sub { color: var(--ink-2); margin-top: 6px; font-size: 15px; }

.catbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 16px; }
.catbar button {
  font-family: var(--display); font-weight: 700; font-size: 13px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink-2);
  border-radius: 100px; padding: 7px 16px;
}
.catbar button[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }

.tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); }
.tool {
  text-align: left; font: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 7px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 17px; transition: border-color .15s, transform .1s, box-shadow .15s;
  position: relative; overflow: hidden;
}
.tool::after { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c, var(--brand)); opacity: 0; transition: opacity .15s; }
.tool:hover { border-color: var(--c, var(--brand)); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool:hover::after { opacity: 1; }
.tool .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--c-soft); display: grid; place-items: center; font-size: 20px; }
.tool .nm { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tool .ds { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.tool .free { font-size: 9.5px; padding: 2px 7px; }
.tool.star { background: linear-gradient(160deg, var(--c-soft), var(--card) 55%); border-color: var(--c); }

/* ---------- tool page ---------- */

.crumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); padding-top: 18px; flex-wrap: wrap; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--brand); }

.toolhead { padding-block: 14px 6px; }
.toolhead .ic { width: 52px; height: 52px; border-radius: 15px; background: var(--c-soft); display: grid; place-items: center; font-size: 26px; margin-bottom: 12px; }
.toolhead h1 { font-size: clamp(26px, 4.6vw, 36px); }
.toolhead .lede { color: var(--ink-2); margin-top: 10px; max-width: 62ch; font-size: 16px; }

.related { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.related a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 11px 13px;
  font-family: var(--display); font-weight: 600; font-size: 13.5px; color: var(--ink);
}
.related a:hover { border-color: var(--brand); }

/* ---------- content ---------- */

.prose { max-width: 68ch; }
.prose h2 { font-size: 22px; margin-top: 26px; }
.prose h3 { font-size: 17px; margin-top: 22px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15px; margin-top: 10px; }
.prose ol, .prose ul { padding-left: 22px; margin: 0; }

details.faq { border-bottom: 1.5px solid var(--line); padding: 15px 0; }
details.faq > summary {
  cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 15.5px;
  list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; color: var(--brand); font-size: 22px; flex: none; line-height: 1; }
details.faq[open] > summary::after { content: "\2212"; }
details.faq p { margin-top: 10px; color: var(--ink-2); font-size: 14.5px; }

.tablewrap { overflow-x: auto; margin-top: 16px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 520px; }
table.grid th, table.grid td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); }
table.grid th { font-family: var(--display); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
table.grid td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- ads ---------- */

.adslot {
  margin: 26px 0; min-height: 96px; display: grid; place-items: center;
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  color: var(--ink-3); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-family: var(--display); font-weight: 700;
}

footer.site { border-top: 1.5px solid var(--line); margin-top: 34px; padding-block: 28px 40px; color: var(--ink-3); font-size: 13.5px; }
footer.site a { color: var(--ink-2); }
footer.site .cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; }
footer.site h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 9px; }
footer.site ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
footer.site ul a { text-decoration: none; }
footer.site ul a:hover { color: var(--brand); }
