:root {
  --ink: #20233a;
  --muted: #73758a;
  --paper: #f7f4ed;
  --card: #fffdf8;
  --line: #dedce0;
  --orange: #f06b55;
  --orange-dark: #d84d49;
  --green: #375a78;
  --yellow: #f3c969;
  --violet: #6c63b5;
  --lavender: #eeecfb;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
  --mono: "DM Mono", monospace;
  --shadow: rgba(38, 37, 34, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  transition: color .35s ease, background .35s ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='%23n' opacity='.4'/%3E%3C/svg%3E");
}

.topbar {
  height: 78px;
  padding: 0 max(5vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 240, .9);
  position: relative;
  z-index: 2;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.7px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: white;
  background: linear-gradient(135deg, var(--orange), var(--violet));
  border-radius: 50%;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(108, 99, 181, .28);
}

.brand-accent {
  color: var(--orange);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.privacy-pill,
.ai-badge {
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #71a26f;
  margin-right: 6px;
  vertical-align: 1px;
}

.icon-button {
  border: 0;
  background: transparent;
  font-size: 18px;
  color: var(--muted);
  padding: 5px;
}

.theme-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 16px;
  transition: transform .25s ease, background .25s ease;
}

.theme-toggle:hover {
  transform: rotate(18deg) scale(1.08);
  background: var(--yellow);
}

.theme-toggle:active {
  transform: rotate(180deg) scale(.88);
}

.app-shell {
  max-width: 1180px;
  padding: 74px 30px 0;
  margin: auto;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 58px;
}

.hero > div:first-child {
  animation: rise-in .7s ease both;
}

.eyebrow,
.step-label,
.block-label {
  font-family: var(--mono);
  letter-spacing: 1.5px;
  font-size: 10px;
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--green);
}

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

h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 7vw, 86px);
  line-height: .84;
  letter-spacing: -2px;
  margin-bottom: 28px;
  font-weight: 700;
}

em {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -2px;
}

.hero-copy {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 420px;
  margin: 0;
}

.hero-note {
  color: var(--muted);
  display: flex;
  align-items: start;
  gap: 13px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .7px;
  font-size: 10px;
  line-height: 1.7;
  padding-bottom: 7px;
}

.note-icon {
  font-size: 23px;
  color: var(--orange);
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 32px;
  min-height: 610px;
  box-shadow: 0 12px 30px var(--shadow);
  transition:
    transform .3s ease,
    box-shadow .3s ease,
    background .35s ease,
    border-color .35s ease;
}

.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px var(--shadow);
}

.form-panel {
  background: linear-gradient(145deg, #eef3fb, #fbefeb);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 30px;
}

.step-label {
  color: var(--green);
  margin-bottom: 8px;
}

h2 {
  font-size: 27px;
  letter-spacing: -1px;
  margin: 0;
}

.required-note {
  color: var(--muted);
  font-size: 11px;
}

.field-label {
  display: block;
  color: #55524c;
  font-size: 11px;
  font-weight: 600;
  margin: 19px 0 8px;
}

.field-label span {
  color: var(--orange);
}

.text-input {
  display: block;
  width: 100%;
  color: var(--ink);
  background: rgba(255, 254, 250, .75);
  border: 1px solid #d4d1c8;
  border-radius: 2px;
  padding: 12px 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.text-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(235, 98, 61, .1);
}

.text-input::placeholder {
  color: #aaa69c;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.textarea {
  min-height: 91px;
  resize: vertical;
  line-height: 1.5;
}

.char-count {
  color: var(--muted);
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  margin-top: 5px;
}

.input-prefix {
  position: relative;
}

.input-prefix > span {
  position: absolute;
  left: 13px;
  top: 12px;
  color: var(--muted);
  z-index: 1;
}

.input-prefix input {
  padding-left: 26px;
}

.segmented {
  display: flex;
  gap: 5px;
  position: relative;
}

.segment {
  color: var(--muted);
  background: transparent;
  border: 1px solid #d3d0c8;
  padding: 9px 16px;
  font-size: 12px;
  position: relative;
  z-index: 1;
  transition: color .25s ease, transform .2s ease;
}

.segment:hover {
  color: var(--ink);
}

.segment:active {
  transform: scale(.94);
}

.segment.active {
  color: var(--ink);
  background: var(--card);
  border-color: var(--ink);
  animation: choice-pop .3s ease;
}

.segment-slider {
  display: none;
}

.primary-button {
  width: 100%;
  color: white;
  background: var(--orange);
  border: 0;
  padding: 15px 17px;
  margin-top: 25px;
  font-weight: 600;
  font-size: 13px;
  transition: transform .2s, background .2s;
}

.primary-button:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

.primary-button:active,
.copy-button:active,
.secondary-button:active {
  transform: scale(.97);
}

.button-spark {
  margin-right: 8px;
}

.button-arrow {
  float: right;
  font-size: 20px;
  line-height: 13px;
}

.form-footnote {
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  margin: 13px 0 0;
}

.form-footnote span {
  font-family: var(--mono);
}

.photo-drop {
  height: 112px;
  border: 1px dashed #c5c1b7;
  background: rgba(255, 254, 250, .35);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.photo-drop:active {
  transform: scale(.99);
}

.photo-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.upload-icon {
  color: var(--violet);
  font-size: 25px;
  font-weight: 300;
}

.photo-placeholder strong,
.photo-placeholder small {
  display: block;
}

.photo-placeholder strong {
  font-size: 12px;
  color: #56524c;
}

.photo-placeholder small {
  font-size: 10px;
  margin-top: 3px;
}

.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview:not(.hidden) {
  animation: photo-swap .45s cubic-bezier(.2, .8, .2, 1) both;
}

.remove-photo {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: rgba(38, 37, 34, .7);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
}

.hidden {
  display: none !important;
}

.output-panel {
  background: var(--card);
}

.output-heading {
  margin-bottom: 0;
}

.ai-badge {
  border: 1px solid #bed1bf;
  padding: 6px 9px;
  border-radius: 2px;
}

.empty-state {
  min-height: 490px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 30px;
}

.empty-orbit {
  width: 86px;
  height: 86px;
  border: 1px solid #dedbd3;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 25px;
  position: relative;
  animation: float 4s ease-in-out infinite;
}

.empty-orbit:before,
.empty-orbit:after {
  content: "";
  position: absolute;
  border: 1px solid #dedbd3;
  border-radius: 50%;
}

.empty-orbit:before {
  inset: 12px -8px;
  transform: rotate(38deg);
}

.empty-orbit:after {
  inset: -8px 12px;
  transform: rotate(38deg);
}

.empty-orbit span {
  color: var(--orange);
  font-size: 25px;
  z-index: 1;
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 26px;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--muted);
  max-width: 280px;
  line-height: 1.6;
  font-size: 12px;
}

.empty-tip {
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 14px;
  font-size: 10px;
}

.empty-tip span {
  color: var(--orange);
  font-family: var(--mono);
  letter-spacing: 1px;
  margin-right: 7px;
}

.result {
  padding-top: 28px;
}

.result:not(.hidden) {
  animation: result-in .45s ease both;
}

.result.swapping {
  animation: result-swap .45s ease both;
}

.result-toolbar {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.generated-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.sparkle {
  color: var(--orange);
  margin-right: 5px;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.text-button,
.mini-copy {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  padding: 0;
}

.copy-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 11px;
  padding: 7px 10px;
}

.copy-button span {
  color: var(--orange);
  margin-left: 4px;
}

.output-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.block-label {
  color: var(--muted);
  margin-bottom: 11px;
}

.block-label > span {
  font-family: var(--sans);
  letter-spacing: 0;
  text-transform: none;
  font-size: 10px;
}

.block-label .mini-copy {
  float: right;
  color: var(--orange);
}

.editable-output {
  outline: none;
  line-height: 1.65;
  font-size: 13px;
}

.title-output {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.3px;
}

.output-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
  margin-top: 9px;
}

.description-output {
  white-space: pre-line;
  min-height: 107px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  color: #3d4e91;
  background: #e7e8fb;
  padding: 7px 9px;
  font-size: 10px;
  animation: tag-in .35s ease both;
}

.price-suggestion {
  padding-bottom: 18px;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.price-line strong {
  font-family: var(--serif);
  font-size: 29px;
}

.price-line span {
  color: var(--muted);
  font-size: 11px;
}

.local-note {
  color: var(--green);
  font-size: 10px;
  padding-top: 15px;
}

.local-note span {
  font-size: 17px;
  margin-right: 5px;
}

.how-it-works {
  border-top: 1px solid var(--line);
  margin-top: 94px;
  padding: 74px 0 90px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 70px;
}

.how-it-works h2 {
  font-size: 43px;
  line-height: .95;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.benefit-number {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 10px;
}

.benefits h3 {
  font-size: 15px;
  margin: 22px 0 10px;
}

.benefits p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.footer {
  border-top: 1px solid var(--line);
  max-width: 1180px;
  margin: auto;
  padding: 24px 30px 35px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .7px;
}

.footer-star {
  color: var(--orange);
  font-size: 14px;
  margin-left: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38, 37, 34, .42);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  position: relative;
  width: min(100%, 460px);
  background: var(--card);
  padding: 34px;
  box-shadow: 0 20px 60px rgba(38, 37, 34, .2);
}

.modal h2 {
  font-family: var(--serif);
  font-size: 33px;
  margin-bottom: 13px;
}

.modal-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 25px;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  border: 0;
  background: none;
  font-size: 24px;
  color: var(--muted);
}

.ollama-help {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  margin-top: 14px;
}

code {
  font-family: var(--mono);
  color: var(--orange-dark);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.secondary-button {
  flex: 1;
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
  padding: 13px;
  font-size: 12px;
}

.small-button {
  flex: 1;
  margin: 0;
  padding: 13px;
}

.connection-status {
  font-size: 11px;
  margin: 13px 0 0;
  min-height: 15px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  color: white;
  background: var(--ink);
  padding: 11px 16px;
  font-size: 12px;
  transition: .25s;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-swap {
  0% {
    opacity: .3;
    transform: translateX(15px) scale(.98);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes tag-in {
  from {
    opacity: 0;
    transform: scale(.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes choice-pop {
  0% {
    transform: scale(.92);
  }

  70% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes photo-swap {
  from {
    opacity: 0;
    transform: scale(1.12) rotate(2deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes click-ripple {
  to {
    transform: scale(5);
    opacity: 0;
  }
}

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

body.dark {
  --ink: #f7f4ed;
  --muted: #aaaabd;
  --paper: #111526;
  --card: #1c2238;
  --line: #353d5a;
  --orange: #ff806b;
  --orange-dark: #ff9b83;
  --green: #9cc7ed;
  --yellow: #f2cf77;
  --violet: #a7a0ff;
  --lavender: #2c3154;
  --shadow: rgba(0, 0, 0, .26);
}

body.dark .topbar {
  background: #1d1f25;
}

body.dark .form-panel {
  background: linear-gradient(145deg, #1a2c46, #382b40);
}

body.dark .text-input {
  background: #292c34;
  border-color: #464a55;
  color: var(--ink);
}

body.dark .photo-drop {
  background: #252830;
  border-color: #505561;
}

body.dark .segment.active,
body.dark .copy-button {
  background: #30333c;
  color: var(--ink);
  border-color: #8f929a;
}

body.dark .tag {
  color: #d6d4ff;
  background: #353b6a;
}

body.dark .segment.active {
  background: #30333c;
}

body.dark .empty-orbit,
body.dark .empty-orbit::before,
body.dark .empty-orbit::after {
  border-color: #454852;
}

.ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  pointer-events: none;
  transform: scale(0);
  animation: click-ripple .55s ease-out forwards;
}

.ripple-host {
  position: relative;
  overflow: hidden;
}

@media (max-width: 800px) {
  .app-shell {
    padding-top: 48px;
  }

  .hero {
    display: block;
  }

  .hero-note {
    margin-top: 26px;
  }

  .workspace,
  .how-it-works {
    grid-template-columns: 1fr;
  }

  .how-it-works {
    gap: 35px;
    margin-top: 60px;
    padding-top: 55px;
  }

  .benefits {
    gap: 15px;
  }
}

@media (max-width: 520px) {
  .topbar {
    height: 65px;
    padding: 0 20px;
  }

  .privacy-pill {
    display: none;
  }

  .app-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 48px;
  }

  .panel {
    padding: 22px 18px;
  }

  .field-grid,
  .benefits {
    grid-template-columns: 1fr;
  }

  .tone-row {
    margin-top: 3px;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
    padding: 9px 7px;
  }

  .output-heading {
    align-items: center;
  }

  .result-toolbar {
    align-items: start;
    gap: 12px;
  }

  .toolbar-actions {
    flex-direction: column-reverse;
    align-items: end;
  }

  .footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}
