@font-face {
  font-family: 'CoFo Sans Variable';
  src: url('fonts/CoFoSans_Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --ink: #101010;
  --black: #000000;
  --muted: #666666;
  --page: #F5F5F5;
  --card: #FFFFFF;
  --border-strong: rgba(0, 0, 0, 0.28);
  --border-medium: rgba(0, 0, 0, 0.16);
  --green: #7ECE17;
  --green-outer: #69BC00;
  --green-mint: #97EA2D;
  --neutral: #E3E3E3;
}

html, body { margin: 0; padding: 0; }

body {
  font-family: 'CoFo Sans Variable', system-ui, -apple-system, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   HEADER  (1920 × 64,  bg rgba(0,0,0,0.9))
   ========================================================= */
.topbar {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.topbar__inner {
  width: 1200px;
  max-width: calc(100% - 48px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: block;
  width: 120px;
  height: 24px;
}
.topbar__divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
  margin: 0 -8px;
}
.topbar__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 4px 8px;
  height: 28px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 16px;
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: 24px;
  white-space: nowrap;
}
.topbar__pill-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}
.topbar__cta {
  background: var(--green-mint);
  color: var(--ink);
  border: none;
  height: 46px;
  padding: 0 24px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.topbar__cta:hover { filter: brightness(0.95); }

/* =========================================================
   MAIN  layout
   ========================================================= */
.main {
  width: 1200px;
  max-width: calc(100% - 48px);
  margin: 0 auto;
  padding: 80px 0 80px;
}

/* Hero / Title (1200 × 108, centered) */
.hero {
  text-align: center;
  margin-bottom: 60px;
}
.hero h1 {
  font-size: 70px;
  line-height: 68px;
  letter-spacing: -0.04em;
  font-weight: 480;
  margin: 0;
  color: var(--black);
}
.hero p {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 12px 0 0;
  color: var(--black);
}

/* =========================================================
   CARD (white, 1200 × auto, radius 12, padding 68 / 78)
   ========================================================= */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: clamp(40px, 5vw, 68px) clamp(24px, 5.5vw, 78px);
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  top: clamp(40px, 5vw, 68px);
  bottom: clamp(40px, 5vw, 68px);
  left: 50%;
  width: 1px;
  border-left: 1px dashed var(--border-medium);
  pointer-events: none;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 11vw, 160px);
  align-items: start;
}

/* =========================================================
   FORM  (left column)
   ========================================================= */
.form {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 0;
}

.section {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section__text { display: block; }
.section__text h2 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 32px;
  font-weight: 480;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.section__text p {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--muted);
}

/* ---- Backdrop-type cards ---- */
.thumbs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.thumb {
  width: 100%;
  background: white;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.thumb input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.thumb__point {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 24px;
  margin-bottom: 16px;
}
.thumb__label {
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.thumb__img {
  width: 100%;
  height: auto;
  aspect-ratio: 171/100;
  border-radius: 8px;
  object-fit: cover;
  background: #d9d9d9;
}
.thumb:has(input:checked) {
  border-color: var(--border-strong);
}

/* ---- Pills (lighting) ---- */
.pills {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.pill {
  width: 100%;
  height: 64px;
  background: white;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.pill:has(input:checked) {
  border-color: var(--border-strong);
}

/* ---- Radio (20×20, mint inner + green outer when checked) ---- */
.radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  background: white;
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
}
.thumb:has(input:checked) .radio,
.pill:has(input:checked) .radio {
  background: var(--green-outer);
  border-color: var(--green-outer);
}
.thumb:has(input:checked) .radio::after,
.pill:has(input:checked) .radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--green);
}

/* ---- About form (442×312 radius 8) ---- */
.aboutform {
  width: 100%;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  width: 100%;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 16px;
  column-gap: 12px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-medium);
}
.field:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.field--tall { grid-template-rows: auto; }
.field__label {
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.field__label small {
  display: block;
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
  font-weight: 400;
  margin-top: 0;
}
.field input,
.field textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 0;
  resize: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: rgba(0, 0, 0, 0.28);
}
.field textarea {
  min-height: 60px;
  display: block;
}
.field__icon {
  width: 16px;
  height: 16px;
  align-self: center;
  color: rgba(0, 0, 0, 0.4);
}
.field__icon svg { width: 100%; height: 100%; }

/* Generate / Upload — secondary buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 24px;
  height: 46px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  border: none;
  background: var(--neutral);
  color: var(--ink);
  align-self: flex-start;
}
.btn:hover { filter: brightness(0.95); }
.btn--primary {
  background: var(--green-mint);
  height: 66px;
  padding: 0 32px;
  border-radius: 8px;
  font-size: 22px;
  font-weight: 480;
  letter-spacing: -0.03em;
  line-height: 26px;
}

.logo-actions {
  display: flex;
  gap: 12px;
}

/* Mirror checkbox (442×64 full-width) */
.checkbox-row {
  width: 100%;
  height: 64px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.checkbox-row input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.checkbox {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-medium);
  border-radius: 5px;
  background: white;
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
}
.checkbox-row:has(input:checked) .checkbox {
  background: var(--green);
  border-color: var(--green);
}
.checkbox-row:has(input:checked) .checkbox::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 6px;
  height: 11px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* =========================================================
   PREVIEW  (right column, 442 wide)
   ========================================================= */
.preview {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 24px;
}
.preview h2 {
  margin: 0;
  font-size: 28px;
  line-height: 32px;
  font-weight: 480;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.canvas-wrap {
  width: 100%;
  aspect-ratio: 442/249;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  overflow: hidden;
  background: #d9d9d9;
}
#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  margin-top: 48px;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.02em;
  color: var(--muted);
}
.footer a {
  color: var(--muted);
  text-decoration: underline;
}
.footer a.footer__link--plain {
  text-decoration: none;
}
.footer a:hover { color: var(--ink); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Mid-width desktop: stack About-form fields to avoid input clipping when column gets narrow */
@media (max-width: 1024px) and (min-width: 769px) {
  .field {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    row-gap: 6px;
    position: relative;
  }
  .field__icon {
    position: absolute;
    right: 0;
    top: 6px;
  }
  .field input,
  .field textarea {
    grid-column: 1;
  }
  .field textarea {
    min-height: 48px;
  }
}

/* Mobile: stacked layout, smaller type — matches Figma "Mob" frame (360 wide) */
@media (max-width: 768px) {
  /* Header */
  .topbar {
    height: 66px;
  }
  .topbar__inner {
    width: 100%;
    max-width: calc(100% - 40px);
    gap: 12px;
  }
  .topbar__left { gap: 16px; }
  .brand {
    width: 100px;
    height: 20px;
  }

  /* Hero */
  .main {
    width: 100%;
    max-width: 100%;
    padding: 44px 0;
  }
  .hero {
    margin-bottom: 44px;
    padding: 0 20px;
  }
  .hero h1 {
    font-size: 48px;
    line-height: 48px;
    letter-spacing: -0.04em;
  }
  .hero p {
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -0.02em;
    margin-top: 12px;
  }

  /* Card */
  .card {
    padding: 20px;
    border-radius: 12px;
    margin: 0 20px;
  }
  .card::after { display: none; }  /* hide dashed divider */
  .layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }

  /* Form */
  .form {
    width: 100%;
    gap: 40px;
  }
  .section { gap: 20px; }
  .section__text h2 {
    font-size: 24px;
    line-height: 26px;
    letter-spacing: -0.04em;
  }

  /* Backdrop-type cards — 2 stacked, fixed 211 wide, left-aligned (per Figma) */
  .thumbs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .thumb {
    width: 211px;
    height: 180px;
    flex-shrink: 0;
  }

  /* Lighting pills — 2 stacked, full width */
  .pills {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .pill {
    width: 100%;
  }

  /* About form — label stacked over input */
  .aboutform {
    width: 100%;
    padding: 20px;
    gap: 16px;
  }
  .field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
    position: relative;
  }
  .field input,
  .field textarea {
    font-size: 16px;
    line-height: 24px;
  }
  .field textarea {
    min-height: 48px;
  }
  .field__icon {
    position: absolute;
    right: 0;
    top: 30px;
    width: 16px;
    height: 16px;
  }

  /* Mirror checkbox — full width */
  .checkbox-row {
    width: 100%;
  }

  /* Preview */
  .preview {
    position: static;
    width: 100%;
    gap: 20px;
  }
  .preview h2 {
    font-size: 24px;
    line-height: 26px;
    letter-spacing: -0.04em;
  }
  .canvas-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 280/158;
  }

  /* Download — smaller on mobile (per Figma: 119×46 with 16px Medium) */
  .btn--primary {
    height: 46px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: -0.02em;
    border-radius: 4px;
  }

  /* Footer */
  .footer {
    margin-top: 48px;
    text-align: center;
    padding: 0 20px;
  }
}

/* =========================================================
   PASSWORD GATE  (login.html)
   ========================================================= */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page);
  padding: 24px;
  z-index: 1000;
}
.gate__card {
  background: var(--card);
  border-radius: 12px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.gate__logo {
  height: 32px;
  width: auto;
  align-self: flex-start;
  margin-bottom: 8px;
}
.gate__title {
  font-size: 34px;
  line-height: 36px;
  letter-spacing: -0.03em;
  font-weight: 480;
  margin: 0;
  color: var(--black);
}
.gate__hint {
  font-size: 16px;
  line-height: 22px;
  color: var(--muted);
  margin: 0 0 8px;
}
.gate__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gate__label {
  font-size: 14px;
  font-weight: 450;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.gate__field input {
  font-family: inherit;
  font-size: 16px;
  letter-spacing: -0.02em;
  padding: 0 14px;
  height: 46px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: white;
  color: var(--ink);
  outline: none;
}
.gate__field input:focus {
  border-color: var(--border-strong);
}
.gate__submit {
  align-self: stretch !important;
  margin-top: 8px;
}
.gate__error {
  font-size: 14px;
  color: #c0392b;
  margin: 0;
}

@media (max-width: 600px) {
  .gate__card { padding: 32px 24px; }
  .gate__title { font-size: 28px; line-height: 30px; }
}

