@font-face {
  font-family: Figtree;
  src: url("./figtree-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  font-family: Figtree, "Helvetica Neue", Arial, sans-serif;
  color: #1f2922;
  background: #d9dfc7;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background: #d9dfc7 url("./nature-desktop.jpg") center center / cover fixed no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255,253,247,.25), rgba(245,243,224,.18));
  backdrop-filter: blur(8px) saturate(86%);
  -webkit-backdrop-filter: blur(8px) saturate(86%);
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100svh;
  padding: 24px;
}

.search {
  min-height: calc(100svh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.app.has-results .search { min-height: min(54svh, 520px); }

h1 {
  max-width: 760px;
  margin: 0 0 clamp(27px, 4vw, 42px);
  color: #18241c;
  font-size: clamp(42px, 6.1vw, 74px);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 1px 14px rgba(255,255,255,.48);
}

#task-form { width: min(100%, 620px); }

.glass-input {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 16px 17px 15px 23px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 27px;
  background: linear-gradient(145deg, rgba(255,255,255,.65), rgba(255,255,255,.3));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.95), inset 0 -1px 1px rgba(255,255,255,.35), 0 22px 55px rgba(18,40,18,.16), 0 3px 11px rgba(30,48,30,.08);
  backdrop-filter: blur(38px) saturate(140%);
  -webkit-backdrop-filter: blur(38px) saturate(140%);
}

.glass-input:focus-within {
  border-color: rgba(191,88,29,.6);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 4px rgba(191,88,29,.12), 0 20px 55px rgba(18,40,18,.16);
}

#task-input {
  flex: 1;
  min-width: 0;
  min-height: 65px;
  max-height: 240px;
  padding: 8px 0;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202b23;
  font-size: 18px;
  line-height: 1.45;
  text-align: center;
}

#task-input::placeholder { color: #69736b; }

.submit-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(248,239,232,.66));
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgba(84,60,42,.15);
  color: #bf581d;
  transition: transform .2s, background .2s;
}

.submit-button:hover { transform: translateX(2px); background: #fff; }
.submit-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.submit-button:focus-visible, .copy-button:focus-visible, .how-to a:focus-visible { outline: 3px solid #a94d1c; outline-offset: 3px; }

.form-error { margin: 13px 0 0; color: #8d3321; font-size: 14px; }

.results {
  width: min(100%, 690px);
  margin: 0 auto;
  padding: 0 0 80px;
  scroll-margin-top: 35px;
  text-align: center;
}

.results h2 {
  margin: 0 0 8px;
  font-size: clamp(29px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -.045em;
  text-shadow: 0 1px 12px rgba(255,255,255,.5);
}

.results-intro {
  max-width: 520px;
  margin: 0 auto 25px;
  font-size: 16px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(255,255,255,.65);
}

.builder-card, .prompt-card, .how-to {
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(255,255,255,.77), rgba(255,255,255,.49));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.94), 0 12px 35px rgba(17,36,19,.13);
  backdrop-filter: blur(36px) saturate(135%);
  -webkit-backdrop-filter: blur(36px) saturate(135%);
}

.builder-card { padding: 26px 28px 28px; margin-bottom: 17px; text-align: left; }
.model-label { margin: 0 0 19px; color: #5e695e; font-size: 14px; }
.model-label strong { color: #a24c1a; font-weight: 700; }
.builder-fields { display: grid; gap: 0; }
.builder-fields label { display: block; margin: 0 0 9px; }
.builder-fields label strong { display: block; color: #1f2c22; font-size: 16px; font-weight: 700; }
.builder-fields label span { display: block; margin-top: 3px; color: #506054; font-size: 13px; line-height: 1.45; }
.builder-fields textarea {
  display: block;
  width: 100%;
  min-height: 74px;
  margin: 0 0 22px;
  padding: 14px 16px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 15px;
  outline: none;
  background: rgba(255,255,255,.67);
  box-shadow: inset 0 1px 2px rgba(35,53,35,.05);
  color: #233026;
  font-size: 15px;
  line-height: 1.5;
}
.builder-fields textarea:last-child { margin-bottom: 0; }
.builder-fields textarea::placeholder { color: #6d796f; }
.builder-fields textarea:focus { border-color: rgba(191,88,29,.62); box-shadow: 0 0 0 3px rgba(191,88,29,.12); }

.prompt-card { padding: 28px; text-align: left; }
.prompt-card h3 { margin: 0 0 16px; font-size: 23px; font-weight: 600; letter-spacing: -.03em; }

.prompt-preview {
  padding: 20px 22px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  color: #303b33;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.prompt-preview p { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid rgba(50,70,52,.12); }
.prompt-preview p:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.prompt-preview strong { display: block; margin-bottom: 5px; color: #1e3022; font-size: 14px; font-weight: 700; }
.prompt-preview span { display: block; white-space: pre-wrap; }

.copy-button, .copy-dialog button {
  margin-top: 19px;
  padding: 12px 21px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  background: #fff;
  color: #263126;
  box-shadow: 0 5px 16px rgba(74,54,44,.11);
  font-size: 15px;
  font-weight: 650;
}

.copy-button:hover, .copy-dialog button:hover { background: #fff8f0; }
.copy-button.copied { color: #277044; }
.copy-button:disabled { opacity: .5; cursor: not-allowed; }
.manual-link { display: inline-block; margin-left: 15px; padding: 10px 0; border: 0; background: transparent; color: #6b4e3b; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.manual-link:focus-visible { outline: 3px solid #a94d1c; outline-offset: 3px; }

.how-to {
  margin-top: 17px;
  padding: 26px 28px 12px;
  text-align: left;
}

.how-to h3 { margin: 0 0 14px; font-size: 23px; font-weight: 600; letter-spacing: -.03em; }
.how-to ol { list-style: none; padding: 0; margin: 0; }
.how-to li {
  position: relative;
  min-height: 46px;
  padding: 0 0 17px 42px;
  margin: 0 0 16px;
  border-bottom: 1px solid rgba(62,83,66,.15);
  color: #344038;
  font-size: 15px;
  line-height: 1.55;
}

.how-to li:last-child { margin-bottom: 0; border-bottom: 0; }
.step-number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  color: #9e4d21;
  font-size: 13px;
  font-weight: 700;
}

.how-to strong { color: #1f2c22; font-weight: 700; }
.how-to a { color: #974514; font-weight: 700; text-underline-offset: 3px; }

.copy-dialog {
  width: min(600px, calc(100% - 30px));
  padding: 26px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 25px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 24px 80px rgba(40,30,26,.24);
  backdrop-filter: blur(30px);
}

.copy-dialog::backdrop { background: rgba(38,34,31,.37); backdrop-filter: blur(10px); }
.copy-dialog h2 { margin: 0 0 7px; font-size: 25px; font-weight: 600; letter-spacing: -.04em; }
.copy-dialog p { margin: 0 0 15px; font-size: 15px; line-height: 1.5; }
.copy-dialog textarea { width: 100%; min-height: 240px; max-height: 50svh; padding: 15px; resize: none; border: 1px solid #ddd5cf; border-radius: 12px; background: #fff; font-size: 14px; }
.copy-dialog button { display: block; }

@media (max-width: 600px) {
  body { background-image: url("./nature-mobile.jpg"); background-attachment: scroll; background-position: center top; }
  body::before { background: rgba(255,253,246,.23); backdrop-filter: blur(7px) saturate(86%); -webkit-backdrop-filter: blur(7px) saturate(86%); }
  .app { padding: 18px; }
  .search { min-height: calc(100svh - 36px); }
  .app.has-results .search { min-height: 43svh; }
  h1 { max-width: 100%; margin-bottom: 29px; font-size: clamp(40px, 10.2vw, 50px); }
  .glass-input { gap: 8px; padding: 13px 13px 12px 18px; border-radius: 23px; }
  #task-input { min-height: 66px; font-size: 17px; }
  .submit-button { width: 44px; height: 44px; }
  .results { padding-bottom: 50px; }
  .results h2 { font-size: 29px; }
  .results-intro { font-size: 15px; }
  .builder-card, .prompt-card { padding: 20px; }
  .prompt-card h3, .how-to h3 { font-size: 21px; }
  .prompt-preview { padding: 17px; font-size: 14px; }
  .manual-link { display: block; margin-left: 0; }
  .how-to { padding: 21px 20px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .search, .submit-button { transition: none; }
}
