@font-face {
  font-family: "PropisiWeb";
  src:
    url("./assets/fonts/PropisiModern.woff2") format("woff2"),
    url("./assets/fonts/PropisiModern.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  ascent-override: 105%;
  descent-override: 38%;
  line-gap-override: 12%;
}

:root {
  --text: #302015;
  --muted: #7f6956;
  --cream: #fff8ec;
  --paper: #fffdf8;
  --gold: #f2bd55;
  --gold-deep: #bd7a26;
  --rose: #d98a74;
  --mint: #71a78e;
  --blue: #6f95b8;
  --violet: #7b6db1;
  --line: rgba(126, 88, 51, .16);
  --shadow: 0 24px 70px rgba(92, 58, 25, .16);
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(242, 189, 85, .24), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(111, 149, 184, .18), transparent 24%),
    radial-gradient(circle at 72% 86%, rgba(113, 167, 142, .16), transparent 26%),
    linear-gradient(180deg, #fff5df 0%, #f8ead1 48%, #fff8eb 100%);
  overflow-x: hidden;
}

button, input, textarea, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { -webkit-tap-highlight-color: transparent; }

.soft-light {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
}

.soft-light-one {
  width: 340px;
  height: 340px;
  left: -190px;
  top: 130px;
  background: radial-gradient(circle, rgba(123, 109, 177, .2), transparent 68%);
}

.soft-light-two {
  width: 440px;
  height: 440px;
  right: -220px;
  bottom: -170px;
  background: radial-gradient(circle, rgba(242, 189, 85, .28), transparent 68%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.back-button,
.nav-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(132, 91, 49, .16);
  border-radius: 14px;
  background: rgba(255, 253, 248, .66);
  box-shadow: 0 10px 26px rgba(103, 68, 31, .1);
  color: #4a3020;
  backdrop-filter: blur(12px);
}

.back-button {
  width: 42px;
  flex: 0 0 42px;
}

.back-button svg,
.actions svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #2d1d13;
  font-family: "Cormorant Garamond", serif;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand img {
  width: 58px;
  height: 48px;
  object-fit: contain;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
  padding: 28px 32px;
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 10%, rgba(242, 189, 85, .2), transparent 26%),
    linear-gradient(135deg, rgba(255, 253, 248, .82), rgba(255, 242, 214, .72));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(43px, 6vw, 72px);
  line-height: .92;
}

.subtitle {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.intro-section {
  margin-bottom: 22px;
  padding: 28px 32px;
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 10%, rgba(242, 189, 85, .2), transparent 26%),
    linear-gradient(135deg, rgba(255, 253, 248, .82), rgba(255, 242, 214, .72));
  box-shadow: var(--shadow);
}

.intro-section h1 {
  max-width: 780px;
}

.intro-section p:not(.eyebrow) {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.hero-mark {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(189, 122, 38, .18);
  border-radius: 28px;
  background: linear-gradient(145deg, #fffdf8, #ffe8b8);
  color: #6b4f39;
  font-family: "PropisiWeb", "Cormorant Garamond", serif;
  font-size: 56px;
  box-shadow: 0 18px 46px rgba(151, 92, 34, .14);
}

.generator-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.control-panel,
.preview-panel {
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 26px;
  background: rgba(255, 253, 248, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.control-panel {
  display: grid;
  gap: 22px;
  padding: 22px;
}

.panel-section {
  display: grid;
  gap: 12px;
}

.section-head,
.preview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2,
.preview-head h2 {
  font-size: 29px;
  line-height: 1;
}

.section-head span,
.a4-badge {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.option-grid {
  display: grid;
  gap: 10px;
}

.page-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-options {
  grid-template-columns: 1fr;
}

.option-card {
  min-height: 96px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 18px;
  background: #fffaf0;
  padding: 10px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(189, 122, 38, .28);
  box-shadow: 0 12px 26px rgba(121, 77, 37, .1);
}

.option-card.is-active {
  border-color: rgba(189, 122, 38, .42);
  box-shadow: 0 0 0 3px rgba(242, 189, 85, .2), 0 14px 30px rgba(121, 77, 37, .12);
}

.mini-preview {
  height: 52px;
  border-radius: 12px;
  background-color: #fffdf8;
  overflow: hidden;
  position: relative;
}

.mini-preview.slanted {
  background:
    repeating-linear-gradient(112deg, transparent 0 22px, rgba(217, 138, 116, .24) 22px 23px),
    repeating-linear-gradient(180deg, transparent 0 15px, rgba(111, 149, 184, .42) 15px 16px, transparent 16px 31px, rgba(111, 149, 184, .18) 31px 32px);
}

.mini-preview.narrow {
  background: repeating-linear-gradient(180deg, transparent 0 12px, rgba(111, 149, 184, .44) 12px 13px, transparent 13px 25px);
}

.mini-preview.wide {
  background: repeating-linear-gradient(180deg, transparent 0 21px, rgba(111, 149, 184, .42) 21px 22px, transparent 22px 43px);
}

.mini-preview.grid {
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(111, 149, 184, .28) 13px 14px),
    repeating-linear-gradient(180deg, transparent 0 13px, rgba(111, 149, 184, .28) 13px 14px);
}

.option-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
}

.option-title::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(127, 105, 86, .32);
  border-radius: 999px;
}

.option-card.is-active .option-title::after {
  border-color: var(--gold-deep);
  background: radial-gradient(circle, var(--gold-deep) 0 42%, transparent 46%);
}

.mode-card {
  min-height: 74px;
  grid-template-columns: 92px 1fr;
  align-items: center;
}

.mode-sample {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fffdf8;
  font-family: "PropisiWeb", "Cormorant Garamond", serif;
  font-size: 31px;
  line-height: 1;
  white-space: nowrap;
}

.mode-sample.gray { color: rgba(44, 32, 25, .34); }
.mode-sample.black { color: rgba(44, 32, 25, .92); }
.mode-sample.dotted {
  color: transparent;
  background:
    radial-gradient(circle, rgba(67, 49, 38, .58) 0 1.5px, transparent 1.8px) 0 0 / 7px 7px,
    #fffdf8;
  -webkit-background-clip: text, border-box;
  background-clip: text, border-box;
}

.mode-copy {
  display: grid;
  gap: 3px;
}

.mode-copy strong {
  font-size: 13px;
}

.mode-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #5b402c;
  font-size: 13px;
  font-weight: 900;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(132, 91, 49, .16);
  border-radius: 16px;
  background: #fffdf8;
  color: var(--text);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.field input {
  height: 48px;
  padding: 0 15px;
}

.field textarea {
  min-height: 148px;
  padding: 14px 15px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(189, 122, 38, .46);
  box-shadow: 0 0 0 3px rgba(242, 189, 85, .2);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 15px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  grid-column: 1 / -1;
  color: #2f1d10;
  background: linear-gradient(135deg, #ffd56f, #f4a63e);
  box-shadow: 0 14px 28px rgba(189, 122, 38, .22);
}

.secondary-button {
  color: #4a3020;
  background: #fff3dc;
  border: 1px solid rgba(132, 91, 49, .14);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.status-message {
  min-height: 20px;
  margin: 0;
  color: #9a5f21;
  font-size: 13px;
  line-height: 1.45;
}

.status-message.is-warning {
  color: #9b4c2d;
}

.preview-panel {
  padding: 22px;
  position: sticky;
  top: 16px;
}

.preview-head {
  margin-bottom: 16px;
}

.a4-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 32px;
  border-radius: 999px;
  background: #fff2d8;
  color: #9a6426;
}

.worksheet-frame {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(123, 109, 177, .09), transparent 35%),
    linear-gradient(180deg, rgba(255, 246, 228, .9), rgba(246, 224, 186, .7));
  overflow: auto;
}

#worksheet-canvas {
  width: min(100%, 620px);
  height: auto;
  display: block;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(94, 61, 32, .2);
}

.seo-section {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}

.seo-copy,
.faq-card {
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 26px;
  background: rgba(255, 253, 248, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.seo-copy {
  padding: 28px 30px;
}

.seo-copy h2,
.faq-card h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
}

.seo-copy p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.74;
}

.faq-card {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.faq-card h2 {
  margin-bottom: 6px;
}

.faq-card details {
  border: 1px solid rgba(132, 91, 49, .12);
  border-radius: 16px;
  background: #fffaf0;
  padding: 0 14px;
}

.faq-card summary {
  padding: 14px 0;
  color: #3f2b1d;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.faq-card p {
  margin: 0;
  padding: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.internal-links {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 26px;
  background: rgba(255, 253, 248, .72);
  box-shadow: 0 16px 42px rgba(92, 58, 25, .1);
}

.internal-links h2 {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1;
}

.internal-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.internal-links-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(132, 91, 49, .14);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff8ec;
  color: #4a3020;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(103, 68, 31, .08);
}

body.is-printing .app-shell {
  padding: 0;
}

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

  .preview-panel {
    position: static;
  }

  .seo-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    gap: 10px;
  }

  .brand span,
  .nav-link {
    display: none;
  }

  .hero {
    align-items: flex-start;
    padding: 22px;
  }

  .hero-mark {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 36px;
  }

  .control-panel,
  .preview-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .page-options,
  .actions {
    grid-template-columns: 1fr;
  }

  .primary-button {
    grid-column: auto;
  }

  .mode-card {
    grid-template-columns: 80px 1fr;
  }

  .worksheet-frame {
    padding: 10px;
  }

  .seo-copy,
  .faq-card {
    padding: 20px;
    border-radius: 22px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    min-height: auto;
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .preview-panel,
  .preview-panel * {
    visibility: visible;
  }

  .preview-panel {
    position: fixed;
    inset: 0;
    width: 210mm;
    height: 297mm;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .preview-head {
    display: none;
  }

  .worksheet-frame {
    width: 210mm;
    height: 297mm;
    padding: 0;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
  }

  #worksheet-canvas {
    width: 210mm;
    height: 297mm;
    border-radius: 0;
    box-shadow: none;
  }
}
