/* ===========================================================================
   DAC.ONE landing page
   Hand written, no framework, no build step, one stylesheet.

   The page is deliberately light only. The whole design rests on a white
   wordmark reading as raised type against a near-white surface; there is no
   honest dark-mode translation of that, and a second palette would only be
   a second thing to keep in sync.

   Order: tokens, reset, layout, hero, contact, form, messages, error page.
   =========================================================================== */

:root {
  color-scheme: light;

  --bg:            #eef1f7;
  --bg-top:        #f7f9fc;
  --surface:       #ffffff;

  --text:          #131a26;
  --text-muted:    #5c6779;
  --text-placeholder: #6b7686;   /* 4.6:1 on white - these placeholders are the
                                    only visible label the fields have */

  --border:        #e2e7f0;
  --border-strong: #cdd5e2;

  --accent:        #1552e0;
  --accent-soft:   #e8efff;
  --danger:        #c0273b;

  --ink:           #1b2333;   /* submit button */
  --ink-hover:     #0d1422;

  /* Wordmark extrusion. Offsets are in em so the depth scales with the type
     instead of looking heavy on a phone and flat on a 4K display. */
  --extrude:       #dfe5ef;
  --extrude-deep:  #ccd4e2;
  --cast:          rgba(24, 40, 82, .13);

  --radius-pill:   999px;
  --radius:        14px;

  --measure:       30rem;     /* form column */
  --frame:         86rem;     /* widest the hero stage ever gets */

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* The HTML `hidden` attribute only carries a default of display:none, which
   any later display rule silently overrides. Making it important keeps
   hidden elements hidden. */
[hidden] { display: none !important; }

html {
  /* A wordmark sized in vw depends on the font the visitor's system
     supplies, and a wide one can end up a few pixels past the edge. Clipping
     here guarantees the "no horizontal scrollbar" rule holds regardless. */
  overflow-x: clip;
  /* Anchoring the root font size to the viewport between the two ends makes
     every rem-based size below breathe with the screen, which removes most
     of the need for breakpoints. */
  font-size: clamp(100%, 0.92rem + 0.25vw, 118%);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  /* The device is wider than the text column on small screens; without this
     a rounding error can produce a horizontal scrollbar. */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }

img, picture, svg { display: block; max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* --- Page ---------------------------------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  /* A floor, not a target. The hero is normally as tall as the composition
     inside it plus the padding above and below, which is what keeps the
     margin around the device even from a phone to a 4K display. The floor
     only steps in when the composition is small relative to the screen -
     a tall narrow phone, where a landscape composition cannot fill the
     viewport no matter how it is scaled. Either way the curve of the
     contact section stays just in view. */
  min-height: clamp(22rem, 62svh, 46rem);
  padding: clamp(2rem, 6vh, 5rem) clamp(1rem, 4vw, 3rem) clamp(2.5rem, 5vh, 4rem);
  background:
    radial-gradient(70% 55% at 50% 8%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(48% 40% at 50% 34%, rgba(37, 99, 235, .10) 0%, rgba(37, 99, 235, 0) 72%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 62%, #e9edf5 100%);
}

/* The two sizes the whole composition is derived from. Capping them against
   the viewport *height* as well as its width is what keeps the hero on one
   screen: on a wide but short display the type stops growing before the
   device would be pushed under the fold.

   Their RATIO also matters. The device has to stay around two thirds of the
   wordmark's width, because the overlap below depends on how far the lid's
   silhouette drops away from its high corner - on a device that is small
   relative to the type, that drop is a few pixels and there is nothing left
   to overlap with. */
.hero__stage {
  --mark: min(18vw, 9rem);
  --device: min(84vw, 22rem);

  position: relative;
  width: 100%;
  max-width: var(--frame);
  display: flex;
  justify-content: center;
}

.wordmark {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  font-size: var(--mark);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.035em;
  white-space: nowrap;
  color: #fff;
  /* Six hairline copies build the extrusion, three wide blurs put the block
     of type onto the surface. Anything deeper immediately reads as a 1990s
     word-art preset. */
  text-shadow:
    0 .006em 0 var(--extrude),
    0 .012em 0 var(--extrude),
    0 .018em 0 var(--extrude),
    0 .024em 0 var(--extrude-deep),
    0 .030em 0 var(--extrude-deep),
    0 .036em 0 var(--extrude-deep),
    0 .05em .04em rgba(24, 40, 82, .10),
    0 .09em .10em var(--cast),
    0 .16em .22em rgba(24, 40, 82, .10);
  /* Nothing to select and nothing to copy - it is a logo, not a sentence. */
  -webkit-user-select: none;
  user-select: none;
}

.device {
  position: relative;
  z-index: 1;
  width: var(--device);
  /* Where the device meets the type. The binding constraint is the full stop
     in DAC.ONE: it sits on the baseline, so it is the first thing the device
     swallows, and once it is gone the wordmark reads "DAC ONE". 0.75 puts the
     lid's leading edge just below it - measured against the mockup, which
     has the full stop grazing that edge - while the lid's high corner, which
     is right of centre, still covers the feet of the letters there.

     If the photo is ever replaced, re-check this number: it depends on the
     silhouette of the lid, not just on the type. */
  margin-top: calc(var(--mark) * .74);
}

.device__image {
  width: 100%;
  height: auto;
  /* The photo's own cast shadow was removed when it was cut out, so the
     contact shadow is drawn here - it follows the silhouette and scales. */
  filter:
    drop-shadow(0 .02em .02em rgba(16, 28, 56, .10))
    drop-shadow(0 .06em .07em rgba(16, 28, 56, .12))
    drop-shadow(0 .14em .16em rgba(16, 28, 56, .14));
}

/* --- Contact ------------------------------------------------------------- */

.contact {
  position: relative;
  z-index: 2;
  flex: 1;
  /* The shallow ellipse where the grey hero meets the white panel. Pulling
     the section up by its own curve keeps the seam invisible. */
  margin-top: -2.5rem;
  padding: clamp(2.5rem, 7vh, 4.5rem) clamp(1rem, 5vw, 3rem) clamp(3rem, 9vh, 6rem);
  background: var(--surface);
  border-radius: 50% 50% 0 0 / 2.5rem 2.5rem 0 0;
}

.contact__inner {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}

.contact__heading {
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
}

/* --- Form ---------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.field { position: relative; }

.field__icon {
  position: absolute;
  top: 1.05rem;
  left: 1.15rem;
  color: var(--text-placeholder);
  pointer-events: none;
}

.field__input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.25rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color .15s, box-shadow .15s;
}

.field__input::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}

.field__input:hover { border-color: var(--border-strong); }

.field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.field--invalid .field__input { border-color: var(--danger); }
.field--invalid .field__icon  { color: var(--danger); }

.field__error {
  min-height: 0;
  margin: .35rem 0 0 1.35rem;
  font-size: .82rem;
  color: var(--danger);
}

.field__error:empty { display: none; }

.form__alert {
  margin-bottom: .25rem;
  padding: .7rem 1rem;
  font-size: .88rem;
  color: var(--danger);
  background: #fdeaed;
  border-radius: var(--radius);
}

.submit {
  align-self: center;
  min-width: 12rem;
  margin-top: .75rem;
  padding: .95rem 2.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}

.submit:hover { background: var(--ink-hover); }
.submit:active { transform: translateY(1px); }

.submit[disabled] {
  cursor: progress;
  opacity: .65;
}

/* --- Confirmation -------------------------------------------------------- */

.done {
  padding: 1.5rem 0;
  text-align: center;
}

.done__text {
  font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
}

.done:focus { outline: none; }

/* --- Error page ---------------------------------------------------------- */

.page--error {
  place-content: center;
  padding: 2rem;
  text-align: center;
}

.error__code {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 800;
  letter-spacing: -.04em;
  color: #fff;
  text-shadow:
    0 .012em 0 var(--extrude),
    0 .024em 0 var(--extrude-deep),
    0 .09em .10em var(--cast);
}

.error__message {
  margin: .5rem 0 1.5rem;
  color: var(--text-muted);
}

.error__back { color: var(--accent); }

/* --- Adjustments --------------------------------------------------------- */

/* The single breakpoint. Below it the device fills nearly the whole width
   and the type is sized off the viewport width alone; above it both sizes
   also answer to the viewport height, which is the axis that runs out first
   on a laptop. */
@media (min-width: 48rem) {
  .hero__stage {
    --mark: min(19vw, 21svh, 16rem);
    --device: min(44rem, 62vw, 70svh);
  }
}

@media (max-width: 24rem) {
  .field__input { padding-left: 3rem; }
  .field__icon { left: 1rem; }
}

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

@media (prefers-contrast: more) {
  .field__input { border-color: var(--text-muted); }
  .field__input::placeholder { color: var(--text-muted); }
}
