:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #666b70;
  --paper: #f8f8f5;
  --surface: #ffffff;
  --soft: #eef1ed;
  --line: #d9ded8;
  --charcoal: #20211f;
  --accent: #b3261e;
  --accent-dark: #861b16;
  --cyan: #0f6f7c;
  --green: #4f6f3a;
  --amber: #c88f2d;
  --shadow: 0 20px 50px rgba(21, 21, 21, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.solid-link,
.ghost-link {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}

button {
  border: 1px solid #26211b;
  background: #211d18;
  color: #fff;
  cursor: pointer;
}

button:hover:not(:disabled),
.solid-link:hover {
  background: #000;
}

.secondary-button {
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  background: var(--soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.solid-link {
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  color: #fff;
}

.ghost-link {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.large {
  min-height: 48px;
  padding-inline: 20px;
}

h1,
h2,
h3,
p,
dl,
ol,
ul {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5.7rem);
  letter-spacing: 0;
  line-height: 0.94;
  margin-bottom: 20px;
  max-width: 980px;
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.55rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

p {
  line-height: 1.6;
}

.site-header {
  align-items: center;
  background: rgba(248, 248, 245, 0.9);
  border-bottom: 1px solid rgba(217, 222, 216, 0.88);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(188px, auto) 1fr auto;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 42px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-mark {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  background:
    linear-gradient(90deg, #111 0 18%, transparent 18% 28%, #111 28% 46%, transparent 46% 56%, #111 56% 74%, transparent 74% 84%, #111 84%),
    var(--accent);
  border: 2px solid #151515;
  border-radius: 4px;
  display: inline-block;
  height: 34px;
  width: 24px;
}

.brand-mark strong,
.brand-mark small {
  display: block;
  line-height: 1.05;
}

.brand-mark small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 3px;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.site-nav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 10px 12px;
}

.site-nav a:hover,
.site-nav a.active {
  background: #fff;
  color: var(--ink);
}

.account-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cart-link {
  gap: 8px;
}

.cart-count {
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-grid;
  font-size: 0.75rem;
  line-height: 1;
  min-height: 22px;
  min-width: 22px;
  padding: 5px 7px;
  place-items: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  background:
    linear-gradient(90deg, rgba(21, 21, 21, 0.9), rgba(21, 21, 21, 0.62) 47%, rgba(21, 21, 21, 0.12)),
    url("./assets/templates/35mm-film-frame/35mmtemplate.png");
  background-color: #181818;
  background-position: center, right 10% top 48%;
  background-repeat: no-repeat;
  background-size: cover, min(58vw, 840px) auto;
  color: #fff;
  display: grid;
  gap: 28px;
  min-height: min(760px, calc(100vh - 72px));
  padding: clamp(46px, 9vw, 112px) clamp(18px, 6vw, 76px) clamp(34px, 6vw, 72px);
}

.hero-copy {
  align-self: end;
  max-width: 900px;
}

.hero .eyebrow,
.compact-hero .eyebrow {
  color: #ffccc8;
}

.hero-lede {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.28rem);
  max-width: 680px;
}

.hero-facts {
  align-self: end;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1080px;
}

.hero-facts div {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  min-width: 0;
  padding: 16px;
}

.hero-facts span,
.eyebrow,
.price-label,
.upload-meta,
.order-summary span,
.control-group label span,
.lookup-form label span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-facts span {
  display: block;
  margin-bottom: 5px;
}

.hero-facts strong {
  display: block;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 8px;
}

.content-band {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 6vw, 76px);
}

.product-band {
  background: var(--surface);
}

.use-cases-band {
  background:
    linear-gradient(90deg, rgba(15, 111, 124, 0.08), transparent 38%),
    var(--paper);
}

.section-heading {
  margin-bottom: 22px;
  max-width: 760px;
}

.flow-grid,
.use-case-grid,
.saved-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-card,
.use-case-card,
.saved-card,
.cart-card,
.empty-state,
.checkout-summary,
.checkout-route,
.cart-summary,
.lookup-form,
.status-panel,
.film-sample {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.06);
}

.flow-card {
  min-height: 190px;
  padding: 18px;
}

.use-case-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.use-case-card {
  display: grid;
  min-height: 178px;
  padding: 18px;
}

.use-case-card h3 {
  align-self: start;
  font-size: 1.05rem;
}

.flow-card span {
  color: var(--cyan);
  display: block;
  font-weight: 900;
  margin-bottom: 36px;
}

.flow-card p,
.use-case-card p,
.compact-hero p,
.status-panel span,
.film-sample p,
.saved-card p,
.checkout-route p,
.form-note {
  color: var(--muted);
}

.page-hero {
  padding: clamp(42px, 7vw, 86px) clamp(18px, 6vw, 76px);
}

.compact-hero {
  align-items: end;
  background:
    linear-gradient(90deg, rgba(21, 21, 21, 0.9), rgba(32, 33, 31, 0.72)),
    url("./assets/templates/35mm-film-frame/35mmtemplate.png");
  background-position: center, right 12% center;
  background-repeat: no-repeat;
  background-size: cover, 560px auto;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 340px;
}

.compact-hero h1 {
  font-size: clamp(2rem, 4.4vw, 4.4rem);
}

.compact-hero p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 740px;
}

.two-column {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
}

.spec-list {
  display: grid;
  gap: 12px;
  margin-bottom: 0;
}

.spec-list div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(0, 1fr);
  padding-top: 12px;
}

.spec-list dt {
  font-weight: 900;
}

.spec-list dd {
  color: var(--muted);
  margin: 0;
}

.film-sample {
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.film-sample img {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: block;
  height: auto;
  width: 100%;
}

.generator-header {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 26px clamp(18px, 4vw, 42px) 16px;
}

.generator-header h1 {
  font-size: clamp(1.7rem, 3vw, 3.1rem);
  margin-bottom: 0;
}

.price-block {
  align-items: flex-end;
  border-left: 4px solid var(--accent);
  display: grid;
  justify-items: end;
  min-width: 142px;
  padding-left: 18px;
}

.price-block strong {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  margin: 0 auto;
  max-width: 1480px;
  padding: 0 clamp(14px, 4vw, 42px) 42px;
}

.controls,
.preview-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 16px;
}

.upload-zone {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(179, 38, 30, 0.11), transparent 44%),
    #fff;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  min-height: 116px;
  padding: 18px;
}

.upload-zone.dragging {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 2px rgba(15, 111, 124, 0.22);
}

.upload-zone input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.upload-title {
  font-size: 1.04rem;
  font-weight: 900;
}

.control-group {
  display: grid;
  gap: 15px;
}

.control-header,
.button-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.control-header {
  justify-content: space-between;
}

.control-header h2 {
  font-size: 0.96rem;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  border-radius: 999px;
  display: grid;
  font-size: 1.3rem;
  height: 36px;
  min-height: 36px;
  padding: 0;
  place-items: center;
  width: 36px;
}

.danger {
  background: #fff;
  color: var(--accent);
}

.danger:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.control-group label,
.lookup-form label {
  display: grid;
  gap: 8px;
}

.color-controls {
  display: grid;
  gap: 10px;
}

.color-input,
.number-input,
.lookup-form input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 40px;
  padding: 0 10px;
  width: 100%;
}

.color-input {
  height: 40px;
  padding: 4px;
}

.color-input:disabled,
.swatch:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.swatch-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, 1fr);
}

.swatch {
  background: var(--swatch);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(23, 23, 23, 0.12);
  min-height: 32px;
  padding: 0;
}

.swatch.active {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 2px rgba(15, 111, 124, 0.2),
    inset 0 0 0 1px rgba(23, 23, 23, 0.12);
}

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}

.button-row {
  flex-wrap: wrap;
}

.button-row button {
  flex: 1 1 128px;
}

.order-summary {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.order-summary div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.checkout-actions {
  display: grid;
  gap: 10px;
}

.checkout-actions button {
  width: 100%;
}

.checkout-actions #addToCart,
#stripeCheckoutButton,
#checkoutFromCart {
  background: var(--accent);
  border-color: var(--accent-dark);
}

.checkout-actions #addToCart:hover,
#stripeCheckoutButton:hover,
#checkoutFromCart:hover {
  background: var(--accent-dark);
}

.preview-area {
  display: grid;
  gap: 14px;
  min-width: 0;
  order: -1;
  padding: 16px;
}

.stage {
  background:
    linear-gradient(90deg, rgba(79, 111, 58, 0.2), transparent),
    repeating-linear-gradient(
      45deg,
      #2b2925 0,
      #2b2925 10px,
      #24221f 10px,
      #24221f 20px
    );
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(170px, 260px) minmax(0, 1fr);
  min-height: 360px;
  overflow: hidden;
  padding: clamp(12px, 2vw, 24px);
}

.strip-panel,
.frame-panel {
  min-width: 0;
}

.stage-label {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.strip-panel {
  min-height: 280px;
  overflow: visible;
  padding-right: 6px;
}

.frame-panel {
  align-self: start;
  display: grid;
}

canvas {
  display: block;
}

#mainCanvas {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  height: auto;
  margin: 0 auto;
  max-width: min(100%, 960px);
  width: 100%;
}

.strip-preview {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.strip-preview canvas {
  background: #f4efe7;
  cursor: crosshair;
  height: auto;
  width: 100%;
}

.frame-tray {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  min-height: 76px;
}

.frame-chip {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  text-align: left;
}

.frame-chip.active {
  border-color: var(--cyan);
}

.frame-chip canvas {
  aspect-ratio: 807 / 450;
  background: #f4efe7;
  border-radius: 4px;
  height: auto;
  width: 100%;
}

.frame-chip span {
  color: var(--muted);
  font-size: 0.73rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.saved-card,
.cart-card,
.empty-state,
.checkout-summary,
.checkout-route,
.cart-summary,
.lookup-form,
.status-panel {
  padding: 20px;
}

.saved-card {
  display: grid;
  gap: 14px;
}

.saved-card header,
.cart-card header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.saved-card h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions button {
  flex: 1 1 128px;
}

.cart-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 380px);
}

.cart-items {
  display: grid;
  gap: 14px;
}

.cart-card {
  display: grid;
  gap: 16px;
}

.cart-card h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.cart-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 0;
}

.cart-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 170px) auto;
}

.cart-controls label {
  display: grid;
  gap: 8px;
}

.cart-controls span,
.cart-summary-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cart-summary {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 96px;
}

.cart-summary-actions {
  display: grid;
  gap: 10px;
}

.cart-summary-actions button {
  width: 100%;
}

.mini-price {
  color: var(--cyan);
  font-size: 1.25rem;
  font-weight: 900;
}

.checkout-summary {
  display: grid;
  gap: 14px;
}

.summary-line {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
}

.summary-total {
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 900;
}

.checkout-route,
.lookup-form,
.status-panel {
  align-self: start;
  display: grid;
  gap: 14px;
}

.form-note {
  margin-bottom: 0;
  min-height: 1.5em;
}

.status-list,
.plain-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.status-list li {
  padding-left: 4px;
}

.status-list strong,
.status-list span {
  display: block;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: start;
    order: 3;
  }

  .flow-grid,
  .use-case-grid,
  .hero-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-area {
    order: -1;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: start;
    display: grid;
  }

  .account-actions {
    width: 100%;
  }

  .account-actions a {
    flex: 1;
  }

  .hero {
    background-position: center, right -140px top 32%;
    background-size: cover, 680px auto;
    min-height: auto;
  }

  .hero-facts,
  .use-case-grid,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .compact-hero {
    align-items: start;
    display: grid;
  }

  .generator-header {
    align-items: start;
    display: grid;
  }

  .price-block {
    border-left: 0;
    border-top: 4px solid var(--accent);
    justify-items: start;
    padding-left: 0;
    padding-top: 12px;
  }

  .stage {
    grid-template-columns: minmax(124px, 168px) minmax(0, 1fr);
  }

  .spec-list div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .site-nav a {
    flex: 1 1 42%;
    text-align: center;
  }

  .stage {
    grid-template-columns: 1fr;
  }
}
