/* newaww.com — typography-first minimalist system */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #0f1115;
  --muted: #6b7280;
  --line: #e5e5e5;
  --accent: #d6454e;

  --r: 2px;
  --r-lg: 2px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --measure: 62ch;
  --gutter: 20px;
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0d;
    --surface: #0c0c0d;
    --ink: #f4f4f5;
    --muted: #9a9aa2;
    --line: #26262a;
    --accent: #ff6b73;
  }
  body { background: var(--bg); }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3, p { margin: 0 0 .6em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* Section rhythm + centered content */
.hero,
section.results,
section.gallery,
section.how {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(48px, 9vw, 112px) var(--gutter);
}

/* ---------- Accent text (no gradient) ---------- */
span.grad {
  color: var(--accent);
  -webkit-text-fill-color: currentColor;
}
.brand-aww { color: var(--accent); font-weight: 800; }

/* ---------- Buttons (text / hairline pill) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: var(--tap);
  padding: 11px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: .98rem;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.btn:active { opacity: .85; }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 11px 22px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cards (hairline, no shadow) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 30px);
}

/* ---------- Header ---------- */
header.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 12px var(--gutter);
}
header.site-head .brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.03em;
  color: var(--ink);
}
header.site-head nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
header.site-head nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  padding: 10px 8px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
header.site-head nav a:hover { color: var(--ink); text-decoration: none; }
header.site-head #navCta { margin-left: 8px; padding: 9px 18px; }

@media (max-width: 480px) {
  header.site-head nav a:not(#navCta) { display: none; }
}

/* ---------- Hero ---------- */
section.hero {
  text-align: left;
  padding-top: clamp(56px, 11vw, 120px);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.4em;
}
.hero-title {
  font-size: clamp(2.6rem, 10vw, 6rem);
  line-height: .98;
  font-weight: 800;
  letter-spacing: -.045em;
  margin-bottom: .32em;
  max-width: 14ch;
}
.hero-sub {
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.5;
  max-width: var(--measure);
  margin-bottom: 2.4em;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

/* ---------- Upload card ---------- */
.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 4vw, 36px);
  max-width: 560px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.upload-card #uploadBtn { width: 100%; font-size: 1rem; padding: 14px 24px; }
.upload-hint {
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .02em;
  margin: 0;
}
.upload-card #previewImg {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-top: 2px;
}

/* controls */
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  text-align: left;
}
.controls label {
  display: grid;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.controls select,
.controls input {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  appearance: none;
}
.controls select:focus,
.controls input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.controls #analyzeBtn { width: 100%; }

@media (min-width: 720px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .controls #analyzeBtn { grid-column: 1 / -1; }
}

/* ---------- Hidden + spinner ---------- */
[hidden] { display: none !important; }
.hidden { display: none !important; }

.spinner, #spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  color: var(--muted);
}
.spinner-dots {
  font-size: .9rem;
  letter-spacing: .04em;
}
.spinner-dots::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* ---------- Results ---------- */
section.results { scroll-margin-top: 80px; }

/* Before/after slider */
.ba-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 10px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--line);
  touch-action: pan-y;
  user-select: none;
}
.ba-before,
.ba-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ba-after {
  /* app.js sets clip-path inline; default shows left half */
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -.5px;
  background: #fff;
  cursor: ew-resize;
  z-index: 3;
  touch-action: none;
}
.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #fff;
}
/* range control overlaying slider, touch-friendly */
#baRange {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 12px auto 0;
  height: var(--tap);
  background: transparent;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
#baRange:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
#baRange::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
}
#baRange::-moz-range-track {
  height: 1px;
  background: var(--line);
}
#baRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--ink);
  cursor: ew-resize;
}
#baRange::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--ink);
  cursor: ew-resize;
}

/* Result grid */
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 28px 0;
}
.result-grid .card {
  border: 0;
  border-radius: 0;
}
@media (min-width: 720px) {
  .result-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
}
.result-grid .card h3 {
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 1em;
}
#ideasList {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 10px;
  color: var(--ink);
}
#ideasList li { line-height: 1.45; }

#materialsTable {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
#materialsTable th,
#materialsTable td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
#materialsTable th {
  color: var(--muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
#materialsTable td:last-child,
#materialsTable th:last-child { text-align: right; white-space: nowrap; }

.price {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
}
#priceAssumptions { color: var(--muted); font-size: .86rem; margin-bottom: 0; }

#startProjectBtn {
  display: flex;
  margin: 8px auto 0;
  width: 100%;
  max-width: 560px;
  font-size: 1rem;
  padding: 16px 24px;
  text-align: center;
}

/* ---------- Shared section headings ---------- */
section.gallery h2,
section.how h2,
section.results h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin-bottom: .3em;
}
.section-sub {
  color: var(--muted);
  max-width: var(--measure);
  margin-bottom: 2em;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
.gallery-grid figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: 0;
}
.gallery-grid figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.cmp-hint {
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--muted);
  opacity: .7;
}

/* ---------- Reusable before/after comparison (.cmp) ---------- */
.cmp {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r);
  border-bottom: 1px solid var(--line);
  background: var(--line);
  touch-action: pan-y;
  user-select: none;
}
.cmp .cmp-before,
.cmp .cmp-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cmp .cmp-after {
  /* app.js sets clip-path inline; default shows left half */
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}
.cmp-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -.5px;
  background: #fff;
  cursor: ew-resize;
  z-index: 3;
  touch-action: none;
}
.cmp-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #fff;
}
.cmp-range {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--tap);
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  z-index: 4;
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
}
.cmp-range:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 999px;
}
.cmp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--ink);
  cursor: ew-resize;
}
.cmp-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--ink);
  cursor: ew-resize;
}

/* ---------- How it works ---------- */
.how-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  text-align: left;
}
@media (min-width: 720px) {
  .how-steps { grid-template-columns: repeat(3, 1fr); }
}
.how-steps > li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
}
.how-num {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 1.4em;
}
.how-steps h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .3em;
}
.how-steps p { color: var(--muted); margin: 0; }

/* ---------- Lead modal ---------- */
dialog#leadModal,
.modal {
  width: calc(100% - 32px);
  max-width: 460px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  padding: clamp(22px, 5vw, 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
dialog#leadModal { margin: auto; }
dialog#leadModal::backdrop,
.modal::backdrop {
  background: rgba(12, 12, 13, .5);
}
dialog#leadModal h2,
dialog#leadModal h3 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .4em;
}
.modal-explain {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.5;
}
.modal-explain strong { color: var(--ink); font-weight: 600; }

#leadForm {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
#leadForm label {
  display: grid;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
#leadForm input,
#leadForm textarea,
#leadForm select {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
#leadForm textarea { min-height: 88px; resize: vertical; }
#leadForm input:focus,
#leadForm textarea:focus,
#leadForm select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.modal-actions .btn { flex: 1; }

#leadStatus {
  margin-top: 8px;
  font-size: .9rem;
  font-weight: 600;
  min-height: 1.2em;
}
#leadStatus.success,
#leadStatus[data-state="success"] { color: var(--ink); }
#leadStatus.error,
#leadStatus[data-state="error"] { color: var(--accent); }

/* ---------- Footer ---------- */
footer.site-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  text-align: left;
  padding: 40px var(--gutter);
  max-width: var(--maxw);
  margin-inline: auto;
}
footer.site-foot p { margin: .4em 0; }
.foot-note { max-width: var(--measure); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
