@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #17302d;
  --paper: #f3ead7;
  --cream: #fffaf0;
  --gold: #f0b746;
  --gold-strong: #b8862b;
  --coral: #d47d6d;
  --muted-coral: #e2a393;
  --beige-panel: #e6d7b8;
  --header-beige: #efe2c7;
  --gray-title: #57534f;
  --blue: #85afba;
  --line: rgba(23, 48, 45, 0.3);
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 5px, transparent 5px);
  background-size: 46px 46px;
  background-position: center;
}

button,
input {
  font: inherit;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: transparent;
  background-image: none;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--header-beige);
  background-image: none;
}

header > p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: auto;
}

.brand {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-title {
  font-size: 16px;
}

.mark {
  width: 26px;
  height: 30px;
  display: inline-flex;
  position: relative;
}

.mark span {
  width: 15px;
  height: 25px;
  position: absolute;
  top: 0;
  border-radius: 100% 0 100% 0;
  background: var(--coral);
  transform: rotate(-24deg);
}

.mark span:last-child {
  right: 0;
  top: 5px;
  background: var(--gold);
  transform: rotate(24deg) scaleX(-1);
}

.machine {
  min-height: auto;
  display: flex;
  flex-direction: column;
}

.intro-panel {
  min-height: auto;
  padding: 62px 6vw 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: rgba(230, 215, 184, 0.9);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 5px, transparent 5px);
  background-size: 46px 46px;
  background-position: center;
}

.eyebrow {
  margin: 0 0 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 40px;
  height: 2px;
  display: inline-block;
  margin-right: 12px;
  vertical-align: middle;
  background: var(--coral);
}

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

h1 {
  width: fit-content;
  margin-bottom: 18px;
  padding: 12px 20px 16px 16px;
  position: relative;
  z-index: 0;
  font-size: clamp(52px, 6vw, 96px);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.06em;
  text-align: center;
}

h1::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--coral);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-1deg);
}

.hero-heading {
  margin-top: -24px;
  padding-right: 0;
}

.heading-line {
  display: block;
}

.heading-line-primary {
  color: var(--gray-title);
}

.heading-line-secondary {
  --figma-make-local-effect-type: DROP_SHADOW;
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 4px 0;
}

.hero-heading::before {
  inset: -5px -25px -5px -15px;
}

h1 em,
h2 {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
}

h1 em {
  color: var(--muted-coral);
}

.intro {
  max-width: 500px;
  margin-bottom: 26px;
  padding-left: 1px;
  font-size: 17px;
  line-height: 1.45;
  text-align: center;
}

.fg-inline-italic {
  font-style: italic;
}

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

label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input-row {
  display: flex;
  border: 1px solid var(--ink);
  background: var(--cream);
}

input {
  width: 100%;
  min-width: 0;
  padding: 18px 20px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

input::placeholder {
  color: rgba(23, 48, 45, 0.45);
}

.input-row:focus-within {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.input-row button {
  min-width: 156px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.input-row button span {
  font-size: 22px;
}

.input-row button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.suggestions {
  max-width: 620px;
  width: min(100%, 620px);
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions > span {
  margin-right: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.suggestions button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.suggestions button:hover {
  border-color: var(--ink);
  background: var(--cream);
}

.result-panel {
  flex: 1;
  min-height: 360px;
  padding: 0 6vw 12px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #b8dce6;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 5px, transparent 5px);
  background-size: 46px 46px;
  background-position: center;
}

.result-card {
  width: min(100%, 570px);
  min-height: auto;
  margin: -8px auto 0 auto;
  padding: 20px 24px 18px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  background: var(--coral);
  transform: rotate(1.5deg);
  transition: transform 300ms ease;
}

.book-icon {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 2rem;
  line-height: 1;
  color: var(--cream);
  opacity: 0.9;
}

.result-card.fresh {
  transform: rotate(-1deg) scale(1.015);
}

.card-label {
  margin: 0 auto 0 auto;
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.result-copy {
  margin: 0 auto;
  width: 100%;
}

.result-copy > p {
  margin-bottom: 12px;
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.25;
}

.result-copy > p strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

h2 {
  max-width: 35ch;
  margin-bottom: 6px;
  color: var(--cream);
  font-size: clamp(2.2rem, 1.2vw + 1.5rem, 4rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.author {
  margin-bottom: 18px;
  color: var(--cream);
  font-size: 16px;
  font-weight: 600;
}

.reason {
  max-width: 390px;
  margin-bottom: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 250, 240, 0.45);
  font-size: 14px;
  line-height: 1.5;
}

.card-footer {
  margin: 0 auto 0 auto;
  width: 100%;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer {
  min-height: 52px;
  padding: 12px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--cream);
  background: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .intro-panel {
    min-height: 660px;
  }

  .result-panel {
    min-height: 700px;
  }
}

@media (max-width: 560px) {
  header {
    height: 72px;
  }

  header > p {
    display: none;
  }

  .intro-panel {
    min-height: auto;
    padding: 64px 6vw 70px;
  }

  h1 {
    font-size: clamp(58px, 18vw, 82px);
  }

  .input-row {
    flex-direction: column;
  }

  .input-row button {
    min-height: 52px;
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .result-panel {
    min-height: 650px;
    padding: 64px 7vw;
  }

  .result-card {
    min-height: auto;
    padding: 26px 22px 20px;
  }

  .book-icon {
    top: 18px;
    right: 18px;
    font-size: 1.6rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
