/* Indian Digitizer embroidery converter.
   Denim, a wooden hoop, and a warm walnut-brown accent. */

@font-face {
  font-family: "Karla";
  src: url("vendor/fonts/karla-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("vendor/fonts/josefin-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --denim: #22385a;
  --denim-deep: #182a45;
  --denim-tint: #eef2f7;
  --accent: #8c6046;        /* buttons, links, selected states (5.4:1 with white) */
  --accent-dark: #6f4b36;   /* hover */
  --accent-wash: #f6efea;   /* selected tile background */
  --accent-light: #d2ad96;  /* the accent on denim (5.7:1) */
  --ink: #1b2431;
  --muted: #4a5566;
  --line: #d3dae4;
  --paper: #ffffff;
  --linen: #f2ede4;
  --wood: #c99560;
  --wood-dark: #8f6034;
  --ok: #1d7a46;
  --error: #b42318;

  --font-display: "Josefin Sans", "Century Gothic", "Futura", sans-serif;
  --font-body: "Karla", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --step-0: 1.1875rem;  /* 19px body: generous for older eyes */
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.005em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.hero :focus-visible, .price-card :focus-visible, .site-footer :focus-visible { outline-color: var(--accent-light); }
.hoop__fabric :focus-visible { outline-color: var(--accent); }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; }
.skip-link:focus { top: 12px; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 52px; padding: 0.55em 1.3em;
  border: 2px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: #fff;
  font: 700 var(--step-0)/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
.btn--big { min-height: 60px; font-size: 1.3125rem; padding: 0.6em 1.6em; }
.btn--small { min-height: 44px; padding: 0.35em 1.1em; font-size: 1.0625rem; }
.btn--outline { background: transparent; color: var(--accent); }
.btn--outline:hover { background: var(--accent-wash); color: var(--accent-dark); }
.btn--ghost-light { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: #fff; min-height: 48px; }
.btn--ghost-light:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: progress; }

/* Header ----------------------------------------------------------------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand img { width: 190px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.0625rem; }
.site-nav a:not(.btn):hover { color: var(--accent); text-decoration: underline; }

/* Hero: denim twill ------------------------------------------------------- */
.hero {
  color: #fff;
  background-color: var(--denim);
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 4px),
    radial-gradient(120% 90% at 85% 40%, #2b4670 0%, var(--denim) 55%, var(--denim-deep) 100%);
  padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 6vw, 88px);
  /* A running-stitch seam along the bottom edge, like a jeans hem. */
  border-bottom: 10px solid var(--denim-deep);
  position: relative;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--accent-light) 0 14px, transparent 14px 24px);
  opacity: 0.9;
}
.hero__inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); column-gap: clamp(32px, 5vw, 72px);
  grid-template-areas: "text tool" "promises tool"; align-items: end;
}
.hero__text { grid-area: text; }
.promises { grid-area: promises; align-self: start; }
.hero__tool { grid-area: tool; align-self: center; }
.hero h1 { font-size: var(--step-4); margin-bottom: 0.4em; max-width: 13ch; }
.lede { font-size: 1.3125rem; line-height: 1.55; max-width: 36ch; color: #e6ecf5; }
.promises { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 14px; max-width: 40ch; }
.promises li { display: flex; gap: 14px; align-items: flex-start; color: #dbe3ef; }
.promises strong { color: #fff; }
.promises svg {
  flex: none; width: 30px; height: 30px; padding: 5px; margin-top: 1px;
  border-radius: 50%; background: rgba(210, 173, 150, 0.16);
  fill: none; stroke: var(--accent-light); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

.hero__tool { display: flex; flex-direction: column; align-items: center; }

/* Step headings ----------------------------------------------------------- */
.step-head { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 0; }
.step-num {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font: 700 1.375rem/1 var(--font-display); padding-top: 4px; /* Josefin sits high */
}
.step-title { font: 700 var(--step-2)/1.2 var(--font-display); margin: 0; padding-top: 4px; }
.step-head--light .step-title { color: #fff; }
.step-head--light .step-num { background: var(--accent-light); color: var(--denim-deep); }
.step-help { color: var(--muted); margin: -6px 0 20px; max-width: 62ch; }

/* The hoop ---------------------------------------------------------------- */
.hoop { position: relative; width: min(460px, 100%); padding-top: 14px; }
.hoop__clamp {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 74px; height: 34px; border-radius: 8px;
  background: linear-gradient(180deg, #a8754a, var(--wood-dark));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.hoop__clamp::before {
  content: ""; position: absolute; left: 50%; top: -12px; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3f5f8, #9aa3ae 60%, #6b7480);
}
.hoop__ring {
  width: 100%; aspect-ratio: 1; border-radius: 50%; padding: 16px;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 5px),
    linear-gradient(145deg, #dcae7a, var(--wood) 45%, var(--wood-dark));
  box-shadow: 0 18px 40px rgba(6, 14, 28, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.hoop__fabric {
  position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background-color: var(--linen);
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 100, 70, 0.06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 100, 70, 0.05) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.12), inset 0 6px 18px rgba(0, 0, 0, 0.18);
  display: grid; place-items: center; text-align: center; color: var(--ink);
  transition: background-color 0.2s;
}
.hoop__stitches { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hoop__stitches circle {
  fill: none; stroke: var(--accent); stroke-width: 0.9; stroke-dasharray: 3.2 2.2; stroke-linecap: round;
  transition: stroke 0.2s;
}
.hoop.is-dragging .hoop__fabric { background-color: #efe2d8; }
.hoop.is-dragging .hoop__stitches circle { animation: seam 1s linear infinite; }
.hoop.has-design .hoop__stitches { display: none; }
@keyframes seam { to { stroke-dashoffset: -10.8; } }

.hoop__empty { padding: 0 14%; }
.hoop__hint { font: 700 1.5rem/1.2 var(--font-display); margin: 0 0 4px; padding-top: 4px; text-wrap: balance; }
.hoop__or { margin: 0 0 10px; color: var(--muted); }
.hoop__small { margin: 14px 0 0; font-size: 1rem; color: var(--muted); }
.hoop__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hoop-caption { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; text-align: center; }
.hoop-caption__jump { color: #fff; font-weight: 700; font-size: 1.125rem; }
.hoop-caption__name { margin: 0; font-weight: 700; color: #fff; overflow-wrap: anywhere; }

.engine-status { margin: 14px 0 0; min-height: 1.6em; font-size: 1rem; color: #c9d4e4; text-align: center; }
.engine-status.is-error { color: #fff; background: var(--error); padding: 10px 16px; border-radius: 8px; }

/* Bench: format choice + results ------------------------------------------ */
.bench { padding: clamp(40px, 6vw, 72px) 0; }
.bench__inner { display: grid; gap: clamp(40px, 5vw, 64px); }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
legend.step-head { float: left; width: 100%; }
legend.step-head + * { clear: both; }

.formats__group { font: 700 1.125rem/1.3 var(--font-body); color: var(--muted); margin: 26px 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  min-height: 92px; padding: 14px 16px 14px 18px;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper);
  cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.tile:hover { border-color: #9fb0c6; }
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile__ext { font: 700 1.625rem/1.1 var(--font-display); padding-top: 3px; color: var(--denim); }
.tile__who { font-size: 1.0625rem; line-height: 1.35; color: var(--muted); }
.tile:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.tile:has(input:checked) .tile__ext { color: var(--accent); }
.tile:has(input:checked)::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/16px no-repeat;
}
.tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }

.results__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.results__count { margin: 0; font-weight: 700; }
.results__empty {
  margin: 0; padding: 28px 24px; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); text-align: center;
}

.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.file {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 22px; align-items: center;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.file.is-selected { border-color: var(--denim); box-shadow: inset 4px 0 0 var(--denim); }
.file__thumb {
  padding: 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; overflow: hidden;
  width: 112px; height: 112px; background: var(--linen);
}
.file__thumb canvas { width: 112px; height: 112px; }
.file__name { margin: 0 0 2px; font-weight: 700; font-size: 1.25rem; overflow-wrap: anywhere; }
.file__status { margin: 0 0 6px; color: var(--muted); }
.file__status.is-ok { color: var(--ok); font-weight: 600; }
.file__status.is-error { color: var(--error); font-weight: 600; }
.file__stats { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 0 0 8px; }
.file__stats div { display: flex; gap: 8px; }
.file__stats dt { color: var(--muted); }
.file__stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.file__threads { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; }
.file__threads li { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.25); }
.file__note { margin: 0; font-size: 1rem; color: var(--muted); max-width: 62ch; }
.file__actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.file__download { white-space: nowrap; }
.file__remove {
  background: none; border: 0; padding: 8px; min-height: 44px; cursor: pointer;
  font: 600 1.0625rem var(--font-body); color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}
.file__remove:hover { color: var(--error); }
.file.is-busy .file__download { visibility: hidden; }
.file.is-error .file__thumb {
  cursor: default;
  background: var(--linen) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b42318' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") center/40% no-repeat;
}
.file.is-error .file__thumb canvas { display: none; }

/* Content sections --------------------------------------------------------- */
.content { padding: clamp(48px, 7vw, 88px) 0; }
.content__intro { max-width: 66ch; color: var(--muted); margin-bottom: 28px; }
.machines { background: var(--denim-tint); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.machine-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.machine-table th, .machine-table td { text-align: left; vertical-align: top; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.machine-table thead th { background: var(--denim); color: #fff; font-weight: 700; }
.machine-table tbody th { font-weight: 700; width: 30%; }
.machine-table td:nth-child(2) { font-weight: 700; color: var(--accent); white-space: nowrap; }
.machine-table tbody tr:last-child > * { border-bottom: 0; }

details > summary { cursor: pointer; }
.all-formats { margin-top: 20px; max-width: 80ch; }
.all-formats summary { font-weight: 700; color: var(--denim); padding: 8px 0; }
.all-formats p { color: var(--muted); }

.digitize__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: clamp(32px, 6vw, 80px); align-items: start; }
.digitize__text { max-width: 64ch; }
.digitize__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.price-card {
  padding: 28px; border-radius: 14px; background: var(--denim); color: #fff;
  /* Satin-stitch border: the same running stitch as the hoop, sewn on denim. */
  outline: 2px dashed rgba(210, 173, 150, 0.85); outline-offset: -10px;
}
.price-card h3 { font-size: var(--step-2); margin-bottom: 4px; padding-top: 4px; }
.price-card__sub { color: #c9d4e4; font-size: 1.0625rem; }
.price-list { margin: 18px 0; }
.price-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.price-list dt { color: #dbe3ef; }
.price-list dd { margin: 0; font: 700 1.375rem/1.2 var(--font-display); padding-top: 3px; }
.price-card__time { margin: 0; color: #dbe3ef; }
.price-card__time strong { color: #fff; }

.about { background: var(--denim-tint); }
.about__cols { columns: 3 280px; column-gap: 40px; }
.about__cols p { break-inside: avoid; }

.faq__inner { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 0; font-weight: 700; font-size: 1.25rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--line); font-size: 1.5rem; line-height: 1; color: var(--accent);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 22px; max-width: 70ch; color: #303b4b; }

/* Re-digitizing offer under the downloads */
.upsell {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  margin-top: 18px; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-wash);
  border-left: 4px solid var(--accent);
}
.upsell p { margin: 0; max-width: 60ch; }

/* Popular conversions: a quiet three-column list, rules between rows */
.conv-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 40px; }
.conv { padding: 22px 0 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.conv h3 { font-size: var(--step-2); margin: 0 0 6px; padding-top: 4px; color: var(--denim); }
.conv p { color: var(--muted); flex: 1; }
.conv__go { font-weight: 700; align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; }

/* Closing call to action */
.final-cta { background: var(--denim); color: #fff; padding: clamp(44px, 6vw, 72px) 0; }
.final-cta__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.final-cta h2 { font-size: var(--step-3); margin-bottom: 0.4em; }
.final-cta p { margin: 0; max-width: 60ch; color: #dbe3ef; }
.final-cta__actions { display: flex; flex-direction: column; gap: 12px; }
.final-cta .btn--big { background: var(--accent-light); border-color: var(--accent-light); color: var(--denim-deep); }
.final-cta .btn--big:hover { background: #e2c4b1; border-color: #e2c4b1; }
@media (max-width: 860px) { .final-cta__inner { grid-template-columns: 1fr; } .final-cta__actions { flex-direction: row; flex-wrap: wrap; } }

/* Footer ------------------------------------------------------------------- */
.site-footer { background: var(--denim-deep); color: #c9d4e4; padding: 48px 0 28px; font-size: 1.0625rem; }
.site-footer a { color: #fff; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.site-footer__logo { width: 180px; height: auto; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 8px 40px; }
.site-footer__credits { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.9375rem; color: #a9b6c9; }
.site-footer__credits p { margin: 0; max-width: 100ch; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero__inner, .digitize__inner { grid-template-columns: 1fr; }
  .hero__inner { grid-template-areas: "text" "tool" "promises"; row-gap: 12px; }
  .promises { margin-top: 36px; }
  .hero__text { text-align: left; }
  .hero h1 { max-width: none; }
  .price-card { max-width: 480px; }
}
@media (max-width: 720px) {
  .site-nav a:not(.btn) { display: none; }
  .brand img { width: 150px; }
  .file { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 14px 16px; }
  .file__stats { flex-direction: column; }
  .file__actions { grid-column: 1 / -1; }
  .file__thumb, .file__thumb canvas { width: 84px; height: 84px; }
  .hoop__hint { font-size: 1.3125rem; }
  .hoop__empty { padding: 0 10%; }
  .hoop__small { font-size: 0.9375rem; }
}
@media (max-width: 400px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 84px; padding: 12px; }
  .tile__who { font-size: 0.9375rem; }
  .hoop__ring { padding: 12px; }
  .hoop__or, .hoop__small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
