/* ============================================================================
   Teaser pages "sta arrivando": organa, stylus, abacus, tabula, minerva, cuma .html (DPS-184) and smartek,
   revisa, hakobi .html (DPS-192).

   The pages are written by DPSTUDIO/scripts/site/TeaserPages.java; this sheet and js/teaser.js are
   shared. A page shows the DPStudio logo, the product's mark with its name in lower case, one line of text
   and the "Tienimi informato" box. Nothing on it says what the product is, except on smartek, revisa and
   hakobi, which carry one more small line (.what) that does.

   The product is chosen by <html data-product="...">: it sets the accent colour and which entrance the mark
   plays. Fonts come from css/fonts.css, except Outfit, used only for the name next to the mark (brand rule).
   ============================================================================ */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
}

:root {
  --night: #0F1230;
  --ink: #FFFFFF;
  --ink-soft: rgba(255, 255, 255, .72);
  --ink-faint: rgba(255, 255, 255, .5);
  --hairline: rgba(255, 255, 255, .16);
  --field: rgba(255, 255, 255, .06);
  --danger: #FF9C9C;
  --accent: #2f6bed;
  --accent-soft: rgba(47, 107, 237, .28);
  --on-accent: #FFFFFF;
  --bar: linear-gradient(90deg, #2f6bed 0 33.33%, #1f9d63 33.33% 66.66%, #ef7436 66.66% 100%);
  --font-display: 'Red Hat Display', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-name: 'Outfit', 'Segoe UI', system-ui, sans-serif;
}
html[data-product="stylus"] {
  --accent: #2f6bed;
  --accent-soft: rgba(47, 107, 237, .28);
  --bar: #2f6bed;
}
html[data-product="abacus"] {
  --accent: #1f9d63;
  --accent-soft: rgba(31, 157, 99, .3);
  --bar: #1f9d63;
}
html[data-product="tabula"] {
  --accent: #ef7436;
  --accent-soft: rgba(239, 116, 54, .3);
  --bar: #ef7436;
}
html[data-product="minerva"] {
  --accent: #b45309;
  --accent-soft: rgba(180, 83, 9, .34);
  --bar: #b45309;
}
html[data-product="cuma"] {
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, .32);
  --bar: #7c3aed;
}
html[data-product="smartek"] {
  --accent: #0e7c88;
  --accent-soft: rgba(14, 124, 136, .36);
  --bar: #0e7c88;
}
html[data-product="revisa"] {
  --accent: #4467a6;
  --accent-soft: rgba(68, 103, 166, .4);
  --bar: #4467a6;
}
/* the orange of the mark is too light for white letters: the button writes in the dark of the bench */
html[data-product="hakobi"] {
  --accent: #F28C28;
  --accent-soft: rgba(242, 140, 40, .26);
  --on-accent: #14202b;
  --bar: #F28C28;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[data-lang="it"] [lang="en"],
html[data-lang="en"] [lang="it"] { display: none; }

.page {
  position: relative;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  overflow: hidden;
}

/* the mark again, very large and very faint, leaving the page on the right (js/teaser.js copies it here) */
.echo {
  position: absolute;
  z-index: -1;
  right: -9vw;
  top: 50%;
  width: min(92vh, 62vw);
  transform: translateY(-50%);
  opacity: .07;
  pointer-events: none;
}
.echo > svg { display: block; width: 100%; height: auto; }
.glow {
  position: absolute;
  z-index: -2;
  left: -12vw;
  top: 18%;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  opacity: .5;
  pointer-events: none;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 6vw, 88px);
}
.bar__logo { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.bar__logo img { display: block; height: 34px; width: auto; }
.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: none;
  color: var(--ink-faint);
  font: 500 12px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .14em;
  cursor: pointer;
}
.lang b { font-weight: 500; }
html[data-lang="it"] .lang b[data-l="it"],
html[data-lang="en"] .lang b[data-l="en"] { color: var(--ink); }

.stage {
  align-self: center;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(20px, 6vw, 88px) 56px;
}
.lockup {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3.4vw, 52px);
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.mark { flex: none; width: clamp(104px, 15vw, 208px); height: auto; overflow: visible; }
.name {
  font-family: var(--font-name);
  font-weight: 400;
  font-size: clamp(64px, 11.4vw, 164px);
  line-height: .9;
  letter-spacing: 0;
  padding-bottom: .08em;
}
/* a program of a suite: the suite name, small, under the program name (as on the splash screen) */
.wordmark { display: flex; flex-direction: column; }
.family {
  margin-top: .04em;
  padding-left: .04em;
  font-family: var(--font-name);
  font-weight: 400;
  font-size: clamp(22px, 3.4vw, 50px);
  line-height: 1;
  color: rgba(255, 255, 255, .7);
  animation: teaser-rise .7s cubic-bezier(.2, .7, .2, 1) .9s both;
}
.line {
  margin: clamp(20px, 3.2vw, 40px) 0 0;
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(30px, 4.6vw, 62px);
  line-height: 1.12;
  color: var(--ink);
  text-wrap: balance;
}

/* the line that says what the product does: only on the pages of the products that are no surprise */
.what {
  margin: clamp(14px, 1.8vw, 24px) 0 0;
  max-width: 46ch;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.45;
  color: var(--ink-soft);
  text-wrap: balance;
}

.notify {
  margin-top: clamp(36px, 5.5vw, 68px);
  max-width: 540px;
}
.notify__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.notify__row { display: flex; gap: 10px; }
.notify__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: 400 17px/1 var(--font-body);
}
.notify__input:focus-visible,
.notify__btn:focus-visible,
.lang:focus-visible,
.consent input:focus-visible,
.page a:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}
.notify__input[aria-invalid="true"] { border-color: var(--danger); }
.notify__btn {
  flex: none;
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 16px/1 var(--font-body);
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}
.notify__btn:hover { filter: brightness(1.12); }
.notify__btn:active { transform: translateY(1px); }
.notify__btn[disabled] { opacity: .55; cursor: default; filter: none; }
.consent {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 16px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}
.consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent a, .foot a { color: var(--ink); text-underline-offset: 3px; cursor: pointer; }
.notify__msg { min-height: 24px; margin: 10px 0 0; font-size: 15px; color: var(--ink); }
.notify__msg.is-error { color: var(--danger); }
.notify__note { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.notify.is-done .notify__row,
.notify.is-done .notify__label,
.notify.is-done .consent { display: none; }
.notify.is-done .notify__msg {
  margin-top: 0;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--field);
  font-size: 17px;
}

.foot {
  padding: 18px clamp(20px, 6vw, 88px) 30px;
  font-size: 13px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
}
.foot a { color: var(--ink-soft); display: inline-flex; align-items: center; min-height: 44px; }
.colorbar { position: fixed; left: 0; right: 0; bottom: 0; height: 6px; background: var(--bar); }

/* ---- entrance, once. Each mark composes itself the way its own picture suggests. ---- */
@keyframes teaser-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.name { animation: teaser-rise .7s cubic-bezier(.2, .7, .2, 1) .75s both; }
.line { animation: teaser-rise .7s cubic-bezier(.2, .7, .2, 1) 1.05s both; }
.what { animation: teaser-rise .7s cubic-bezier(.2, .7, .2, 1) 1.2s both; }
.notify { animation: teaser-rise .7s cubic-bezier(.2, .7, .2, 1) 1.35s both; }

/* Organa: the three arcs come in clockwise, each handing over to the next */
@keyframes teaser-arc { from { opacity: 0; transform: rotate(-75deg); } to { opacity: 1; transform: none; } }
.mark--organa path { transform-origin: 32px 32px; animation: teaser-arc .8s cubic-bezier(.2, .7, .2, 1) both; }
.mark--organa path:nth-child(2) { animation-delay: .2s; }
.mark--organa path:nth-child(3) { animation-delay: .4s; }

/* Minerva: the bases, then the stones from the outside in, the keystone last */
@keyframes teaser-stone { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes teaser-key {
  0% { opacity: 0; transform: translateY(-9px); }
  70% { opacity: 1; transform: none; filter: brightness(1.7); }
  100% { opacity: 1; transform: none; filter: none; }
}
.mark--minerva g > * { animation: teaser-stone .5s ease-out both; }
.mark--minerva g > :nth-child(8), .mark--minerva g > :nth-child(9) { animation-delay: 0s; }
.mark--minerva g > :nth-child(1), .mark--minerva g > :nth-child(7) { animation-delay: .16s; }
.mark--minerva g > :nth-child(2), .mark--minerva g > :nth-child(6) { animation-delay: .32s; }
.mark--minerva g > :nth-child(3), .mark--minerva g > :nth-child(5) { animation-delay: .48s; }
.mark--minerva g > :nth-child(4) { animation: teaser-key .8s ease-out .72s both; }

/* Cuma: the faint branches are tried, then one is followed to its end and the dot lands */
@keyframes teaser-draw { from { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes teaser-dot { from { opacity: 0; transform: scale(0); } 70% { transform: scale(1.18); } to { opacity: 1; transform: none; } }
.mark--cuma path { stroke-dasharray: 1; animation: teaser-draw .9s ease-in-out both; }
.mark--cuma path:nth-child(2) { animation-duration: .8s; animation-delay: .55s; }
.mark--cuma circle { transform-origin: 41px 11px; animation: teaser-dot .45s ease-out 1.3s both; }

/* SmarTek: the tooth is built from the bottom, layer on layer, and the enamel closes it */
@keyframes teaser-layer { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes teaser-fade { from { opacity: 0; } to { opacity: 1; } }
.mark--smartek > g { animation: teaser-layer .55s cubic-bezier(.2, .7, .2, 1) both; }
.mark--smartek > g:nth-of-type(2) { animation-delay: .24s; }
.mark--smartek > path { animation: teaser-fade .6s ease-out .5s both; }

/* Revisa: the sheets of the round fan out behind the current one, then the outcome lands on them */
@keyframes teaser-fan-far { from { opacity: 0; transform: rotate(0deg); } to { opacity: 1; transform: rotate(-14deg); } }
@keyframes teaser-fan-near { from { opacity: 0; transform: rotate(0deg); } to { opacity: 1; transform: rotate(-6deg); } }
.mark--revisa > g > g { transform-origin: 50px 58px; }
.mark--revisa > g > g:nth-child(3) { animation: teaser-fade .45s ease-out both; }
.mark--revisa > g > g:nth-child(2) { animation: teaser-fan-near .6s cubic-bezier(.2, .7, .2, 1) .2s both; }
.mark--revisa > g > g:nth-child(1) { animation: teaser-fan-far .7s cubic-bezier(.2, .7, .2, 1) .32s both; }
.mark--revisa > g > g:nth-child(4) { transform-origin: 68px 70px; animation: teaser-dot .45s ease-out 1.05s both; }

/* Hakobi: the bench is set up, the top is laid on it, and the job is ticked */
.mark--hakobi path:nth-child(-n+2) { animation: teaser-layer .5s ease-out both; }
.mark--hakobi path:nth-child(2) { animation-delay: .12s; }
.mark--hakobi path:nth-child(n+3) { stroke-dasharray: 1; animation: teaser-draw .55s ease-in-out .32s both; }
.mark--hakobi path:nth-child(4) { animation-duration: .5s; animation-delay: 1s; }

.echo * { animation: none !important; stroke-dasharray: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- phone ---- */
@media (max-width: 640px) {
  .bar { padding: 14px 20px; }
  .bar__logo img { height: 28px; }
  .stage { padding: 12px 20px 40px; }
  .lockup { flex-direction: column; align-items: flex-start; gap: 18px; }
  .mark { width: 112px; }
  .name { font-size: clamp(64px, 21vw, 88px); }
  .line { font-size: clamp(28px, 8.4vw, 36px); margin-top: 14px; }
  .notify { margin-top: 34px; }
  .notify__row { flex-direction: column; }
  .notify__btn { width: 100%; }
  .echo { display: none; }
  .glow { left: -40vw; top: 4%; width: 140vw; height: 60vh; }
  .foot { padding: 12px 20px 26px; }
}
