/* ==========================================================================
   Designers Guild – temporary landing page (Option B V2)
   Poppy flatshot fills the first fold; the home and trade journeys sit as
   printed cards over the stems on desktop, or behind a two-way switch on
   mobile/tablet. Breakpoint: 1100px.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #111111;
  --muted: #5f646d;
  --placeholder: #5c6066;
  --white: #ffffff;
  --sky: #f0fbf7;
  --sky-mobile: #f1faf7;
  --mist: #e8f0f6;
  --switch: #eef0f2;
  --hairline: #e3e6e8;
  --rule: rgba(79, 83, 93, 0.22);
  --accent: #135EAA;
  --accent-hover: #0f4f8f;
  --error: #a1261b;

  --display: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --body: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;

  --card-shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 12px 28px rgba(17, 40, 70, 0.07);
  --tab-shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 6px 16px rgba(17, 40, 70, 0.10);

  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--white); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }

img.logo { display: block; height: 14px; width: auto; max-width: none; }
.link { text-decoration: underline; text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Poppies (base image; main.js upgrades it to the animated field) ---------- */
@keyframes dgSway {
  0%   { transform: skewX(0deg); }
  16%  { transform: skewX(1.5deg); }
  30%  { transform: skewX(0.5deg); }
  48%  { transform: skewX(2deg); }
  66%  { transform: skewX(-0.7deg); }
  82%  { transform: skewX(0.8deg); }
  100% { transform: skewX(0deg); }
}
@keyframes dgDrift {
  0%   { translate: 0 0; }
  25%  { translate: 1.5px 0; }
  50%  { translate: -1px 0; }
  75%  { translate: 1px 0; }
  100% { translate: 0 0; }
}
.poppies {
  position: absolute;
  display: block;
  height: auto;
  max-width: none;
  transform-origin: 50% 100%;
  animation: dgSway 11s ease-in-out infinite, dgDrift 7.3s ease-in-out infinite;
  will-change: transform, translate;
  pointer-events: none;
  user-select: none;
}

/* Wind: the whole row leans in irregular gusts and springs back;
   each poppy also flutters on its own rhythm. */
@keyframes dgGust {
  0%   { transform: skewX(0deg); }
  24%  { transform: skewX(1.7deg); }
  42%  { transform: skewX(0.7deg); }
  60%  { transform: skewX(1.3deg); }
  80%  { transform: skewX(0.25deg); }
  100% { transform: skewX(0deg); }
}
@keyframes dgBreeze {
  0%   { translate: 0 0; }
  30%  { translate: 3px 0; }
  65%  { translate: 1px 0; }
  100% { translate: 0 0; }
}
@keyframes pfFlutter {
  0%   { transform: skewX(0deg); }
  25%  { transform: skewX(calc(var(--amp) * 0.9deg)); }
  50%  { transform: skewX(calc(var(--amp) * -0.4deg)); }
  75%  { transform: skewX(calc(var(--amp) * 0.6deg)); }
  100% { transform: skewX(0deg); }
}
.poppy-field {
  animation: dgGust 17s cubic-bezier(0.37, 0, 0.63, 1) infinite, dgBreeze 13s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  transform-origin: 50% 100%;
  will-change: transform, translate;
}
.poppy-field .pf-base { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; }
.poppy-field .pf-strip {
  position: absolute; top: 0; bottom: 0;
  background-repeat: no-repeat;
  transform-origin: 50% 100%;
  will-change: transform;
  animation: pfFlutter cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 26px;
  font-family: var(--body); font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
  text-decoration: none; border-radius: 0; cursor: pointer; white-space: nowrap;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}
.btn-primary { background: var(--accent); color: var(--white); border: 0; }
.btn-primary:hover { background: var(--accent-hover); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--ink); border: 1px solid var(--ink); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn:focus-visible, .input:focus-visible, .tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Form ---------- */
.row { display: flex; }
.input {
  flex: 1 1 auto; min-width: 0; height: 48px;
  border: 1px solid var(--ink); border-right: 0; border-radius: 0;
  padding: 0 16px;
  font-family: var(--body); font-weight: 300; font-size: 14px;
  color: var(--ink); background: var(--white);
}
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.row .btn { padding: 0 30px; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; line-height: 1.5; font-weight: 400; }
.check {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin: 2px 0 0; flex: none;
  background: var(--white); border: 1px solid var(--ink); border-radius: 0;
  display: grid; place-content: center; cursor: pointer;
}
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after {
  content: ""; width: 8px; height: 4px;
  border: solid var(--white); border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.check:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.error { font-size: 12px; font-weight: 400; color: var(--error); }
.label { font-size: 12px; font-weight: 400; }

/* Spam trap: hidden from people, filled in by bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* While a sign-up is being sent */
.form[aria-busy="true"] .btn { opacity: 0.7; cursor: progress; }

/* ---------- Layout ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 64px; padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: center;
  background: rgba(241, 250, 247, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}
.hero { position: relative; overflow: hidden; }
.headline {
  position: absolute; left: 0; right: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.headline h1 { letter-spacing: -0.01em; line-height: 1; }

.card { display: flex; flex-direction: column; gap: 12px; }
.card h2 { line-height: 1.1; }
.copy { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form { display: flex; flex-direction: column; gap: 12px; }

#landing { min-height: 100svh; display: flex; flex-direction: column; }
#landing > .site-footer { margin-top: auto; }
.site-footer { border-top: 1px solid var(--hairline); font-size: 13px; font-weight: 400; display: flex; }

/* Thank-you state */
.done { position: relative; overflow: hidden; background: var(--sky); }
.done-msg {
  position: absolute; left: 0; right: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.done-msg h1 { letter-spacing: -0.01em; line-height: 1; }
.done-msg h1:focus { outline: none; }
.done-msg .done-tag { font-family: var(--display); font-style: italic; font-weight: 400; line-height: 1.2; }
.done-footer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  background: var(--white);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 400;
}

/* ==========================================================================
   Mobile and tablet (below 1100px)
   ========================================================================== */
@media (max-width: 1099px) {
  .br-d { display: none; }

  .hero { height: 500px; background: var(--sky-mobile); }
  .hero .poppies {
    --iw: max(810px, calc(100% + 24px));
    width: var(--iw);
    left: clamp(calc(100% - var(--iw)), calc(50% - var(--iw) / 2 + 38px), 0px);
    top: 120px;
  }
  img.logo.hdr-logo { height: 22px; }
  .headline { top: 102px; gap: 16px; }
  .headline h1 { font-size: 36px; }
  .headline p { font-size: 14px; line-height: 1.5; max-width: 335px; }

  .switch {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) 6px max(6px, env(safe-area-inset-left, 0px));
    background: var(--switch);
  }
  .tab {
    height: 42px; border: 0; border-radius: 0; background: transparent;
    font-family: var(--display); font-size: 19px; line-height: 1.2; font-weight: 400;
    color: var(--muted); cursor: pointer;
    transition: background-color 140ms ease, box-shadow 140ms ease;
  }
  .tab[aria-pressed="true"] { background: var(--white); box-shadow: var(--tab-shadow); color: var(--ink); font-weight: 500; }

  .m-journeys { background: var(--white); }
  .card { max-width: 560px; margin: 0 auto; padding: 18px var(--gutter-r) 28px var(--gutter-l); }
  .card h2 { font-size: 26px; }
  .card p { font-size: 14px; line-height: 1.5; }
  .m-journeys[data-active="home"] .card-trade,
  .m-journeys[data-active="trade"] .card-home { display: none; }

  /* On mobile the form / buttons come before the copy */
  .card .copy { order: 2; }
  .card-home .copy { margin-top: 6px; }
  .card .actions, .card .form { order: 1; }
  .actions { flex-direction: column; gap: 10px; }
  .actions .btn { width: 100%; }
  .form .label + .row { margin-top: -4px; }
  .input { font-size: 14px; padding: 0 14px; }
  .row .btn { padding: 0 20px; }

  .site-footer {
    flex-direction: column; align-items: center; gap: 14px; text-align: center;
    padding: 28px var(--gutter-r) 28px var(--gutter-l); font-size: 12px;
  }
  .site-footer img.logo { height: 11px; }

  .done { height: max(750px, 100svh); }
  .done .poppies {
    --iw: max(calc((max(750px, 100svh) - 150px) * 1.792), calc(100% + 24px));
    width: var(--iw); left: calc(50% - var(--iw) / 2); top: 150px;
  }
  .done-msg { top: 112px; gap: 12px; }
  .done-msg h1 { font-size: 36px; }
  .done-msg p { font-size: 15px; line-height: 1.5; max-width: 335px; }
  .done-msg .done-tag { font-size: 20px; }
  .done-msg .btn { padding: 0 24px; }
  .done-footer { padding: 16px var(--gutter-r) 16px var(--gutter-l); font-size: 12px; }
}

/* ==========================================================================
   Desktop (1100px and up)
   ========================================================================== */
@media (min-width: 1100px) {
  .site-header { height: 88px; background: rgba(240, 251, 247, 0.72); }
  .site-header img.logo { height: 38px; }

  .hero { height: clamp(680px, 62.5vw, 1000px); background: var(--sky); }
  .hero .poppies {
    --iw: max(calc(clamp(680px, 62.5vw, 1000px) * 1.792), calc(100% + 24px));
    width: var(--iw); left: calc(50% - var(--iw) / 2); top: 8px;
  }
  .headline { top: clamp(124px, 10.28vw, 148px); gap: 18px; }
  .headline h1 { font-size: clamp(46px, 3.9vw, 56px); }
  .headline p { font-size: 18px; line-height: 1.5; max-width: 620px; }

  .switch, .m-only, .br-m { display: none; }

  .d-journeys {
    position: absolute; z-index: 1;
    top: calc(clamp(680px, 62.5vw, 1000px) * 0.54);
    left: max(80px, calc((100% - 1280px) / 2));
    right: max(80px, calc((100% - 1280px) / 2));
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch;
  }
  .card {
    background: rgba(255, 255, 255, 0.86);
    outline: 1px solid var(--rule); outline-offset: -8px;
    padding: 30px 38px; box-shadow: var(--card-shadow); min-width: 0;
  }
  .card h2 { font-size: 32px; }
  .card .form .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .site-footer {
    align-items: center; justify-content: space-between; gap: 24px;
    padding: 36px max(80px, env(safe-area-inset-right, 0px)) 36px max(80px, env(safe-area-inset-left, 0px));
  }

  .done { height: max(clamp(680px, 62.5vw, 1000px), 100svh); }
  .done .poppies {
    --iw: max(calc((max(clamp(680px, 62.5vw, 1000px), 100svh) + 60px) * 1.792), calc(100% + 24px));
    width: var(--iw); left: calc(50% - var(--iw) / 2); top: 20px;
  }
  .done-msg { top: clamp(96px, 8.33vw, 120px); gap: 18px; }
  .done-msg h1 { font-size: clamp(46px, 3.9vw, 56px); }
  .done-msg p { font-size: 18px; line-height: 1.5; max-width: 620px; }
  .done-msg .done-tag { font-size: 24px; }
  .done-msg .btn { padding: 0 28px; }
  .done .site-header img.logo { height: 38px; }
  .done-footer { height: 64px; font-size: 13px; }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  .poppies, .poppy-field, .poppy-field .pf-strip { animation: none !important; }
}
