/*!
 * Smart Apps Lab — site styles
 * Hand-rolled. No framework.
 */

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  /* palette: a lab at night */
  --night: #0b1726;
  --deep: #0f1f33;
  --raised: #13263d;
  --line: #1f3551;
  --ice: #e8f1f3;
  --mist: #93a7b8;
  --cyan: #3ccfdd;
  --cyan-hi: #6ee6ef;
  --cyan-lo: #22b8c9;

  /* type */
  --font: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  /* rhythm */
  --gutter: clamp(1rem, 5vw, 3rem);
  --measure: 72rem;
  --section-y: clamp(4.5rem, 10vw, 8rem);
  --radius: 28px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--ice);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Fine grain over the whole page, so the flat navy has some tooth. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.sprite {
  position: absolute;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  background: var(--ice);
  color: var(--night);
  font-weight: 500;
}

.skip-link:focus {
  top: 0.75rem;
}

.shell {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- emblem */

.emblem__top {
  stroke: var(--ice);
}

.emblem__bottom {
  stroke: url(#emblem-cyan);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.375rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, filter 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--cyan-hi), var(--cyan-lo));
  color: var(--night);
}

.btn--primary:hover {
  filter: brightness(1.08);
}

.btn--quiet {
  border: 1px solid var(--line);
  color: var(--ice);
}

.btn--quiet:hover {
  border-color: var(--mist);
}

/* ------------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(11, 23, 38, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(31, 53, 81, 0.7);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  min-height: 2.75rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  width: 1.875rem;
  height: 1.875rem;
  flex: none;
}

.nav__links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  display: inline-block;
  padding: 0.625rem 0.75rem;
  color: var(--mist);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav__links a:hover {
  color: var(--ice);
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 5rem);
  overflow-x: clip;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.display {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 33rem;
  text-wrap: pretty;
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--mist);
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

/* The emblem sits in a pool of its own light. */
.hero__mark {
  position: relative;
  isolation: isolate;
  justify-self: end;
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 1;
}

.hero__mark::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(60, 207, 221, 0.22), rgba(60, 207, 221, 0.06) 55%, transparent);
}

.hero__emblem {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
}

/* On load, each half slides in from its own side and hooks into the other. */
.hero__half {
  animation: 1.2s var(--ease-out) 0.2s both;
}

.hero__half--top {
  animation-name: half-top;
}

.hero__half--bottom {
  animation-name: half-bottom;
}

@keyframes half-top {
  from {
    transform: translateX(-9px);
    opacity: 0;
  }
}

@keyframes half-bottom {
  from {
    transform: translateX(9px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__half {
    animation: none;
  }
}

/* -------------------------------------------------------------- sections */

.section {
  padding: var(--section-y) 0;
}

.section__head {
  display: grid;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.muted {
  max-width: 36rem;
  color: var(--mist);
}

/* -------------------------------------------------------------- projects */

.projects {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

/* Each project is shown in its own product's colours. */
.project {
  --p-bg: var(--deep);
  --p-ink: var(--ice);
  --p-muted: var(--mist);
  --p-accent: var(--cyan);
  --p-accent-ink: var(--night);

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(1.75rem, 4.5vw, 3.5rem);
  border-radius: var(--radius);
  background: var(--p-bg);
  color: var(--p-ink);
  overflow: hidden;
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--p-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.project__name {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.project__desc {
  max-width: 30rem;
  text-wrap: pretty;
  margin-top: 1rem;
  color: var(--p-muted);
}

.project__cta {
  margin-top: 1.75rem;
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

.project__cta:hover {
  filter: brightness(1.08);
}

/* Streakhouse: warm ember brown and flame orange, as in the product. */
.project--streakhouse {
  --p-bg: radial-gradient(120% 90% at 85% 50%, #3b2618 0%, #231913 55%, #1b1512 100%);
  --p-ink: #f7ede5;
  --p-muted: #cdb9aa;
  --p-accent: #f0915a;
  --p-accent-ink: #1b1512;
}

.project__visual {
  display: block;
  text-decoration: none;
}

.sh-card {
  width: min(100%, 22rem);
  margin-left: auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 22px;
  background: #3a2a1f;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  transform: rotate(2.5deg);
}

.sh-card__flame {
  font-size: 2.25rem;
  line-height: 1;
}

.sh-card__title {
  margin-top: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.sh-card__sub {
  margin-top: 0.375rem;
  color: #cdb9aa;
  font-size: 0.875rem;
}

.sh-week {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 1.25rem;
}

.sh-week span {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #8f7a6b;
  font-size: 0.75rem;
  font-weight: 700;
}

.sh-week .is-lit {
  background: #f0915a;
  color: #1b1512;
}

.sh-week .is-today {
  box-shadow: inset 0 0 0 2px #f0915a;
  color: #f7ede5;
}

.sh-card__button {
  margin-top: 1.25rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: #f0915a;
  color: #1b1512;
  font-weight: 700;
}

/* Pearla: bright clinic white with its mint-to-pink gradient. */
.project--pearla {
  --p-bg: radial-gradient(60% 80% at 88% 20%, rgba(94, 224, 168, 0.28), transparent 70%),
    radial-gradient(55% 75% at 78% 95%, rgba(236, 72, 153, 0.2), transparent 70%),
    #f6f6f8;
  --p-ink: #0f0f12;
  --p-muted: #5d5d70;
  --p-accent: #0f0f12;
  --p-accent-ink: #ffffff;
}

.pl-call {
  display: grid;
  gap: 0.625rem;
  width: min(100%, 23rem);
  margin-left: auto;
  padding: 1.25rem;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 30px 60px -24px rgba(15, 15, 18, 0.28), 0 0 0 1px rgba(15, 15, 18, 0.05);
  color: #0f0f12;
  font-size: 0.9375rem;
  line-height: 1.4;
  transform: rotate(-2deg);
}

.pl-call__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.pl-call__orb {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #5ee0a8, #9b8cf0, #ec4899, #5ee0a8);
  flex: none;
}

.pl-call__label {
  flex: 1;
}

.pl-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 1.25rem;
}

.pl-wave i {
  width: 3px;
  border-radius: 2px;
  background: #0f0f12;
}

.pl-wave i:nth-child(1) { height: 35%; }
.pl-wave i:nth-child(2) { height: 80%; }
.pl-wave i:nth-child(3) { height: 55%; }
.pl-wave i:nth-child(4) { height: 100%; }
.pl-wave i:nth-child(5) { height: 45%; }

.pl-line {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 16px;
}

.pl-line--patient {
  justify-self: end;
  border-bottom-right-radius: 6px;
  background: #0f0f12;
  color: #ffffff;
}

.pl-line--pearla {
  justify-self: start;
  border-bottom-left-radius: 6px;
  background: #f1f1f5;
}

.pl-call__result {
  justify-self: start;
  margin-top: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: #e3f9ef;
  color: #0b7a4b;
  font-size: 0.8125rem;
  font-weight: 700;
}

/* The next project: an open slot, drawn as an outline. */
.project--next {
  --p-bg: transparent;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1.5px dashed var(--line);
}

.project--next .project__name {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
}

/* ------------------------------------------------------------ earlier work */

.earlier {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.earlier__title {
  color: var(--mist);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.earlier__list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.earlier__item {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.5rem 2.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.earlier__id {
  display: grid;
  gap: 0.125rem;
}

.earlier__name {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.earlier__meta {
  color: var(--mist);
  font-size: 0.875rem;
}

.earlier__desc {
  max-width: 34rem;
  color: var(--mist);
}

.earlier__link {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  white-space: nowrap;
}

.earlier__link:hover {
  color: var(--cyan-hi);
}

/* --------------------------------------------------------------- contact */

.contact {
  padding-top: 0;
}

.contact__panel {
  position: relative;
  padding: clamp(2rem, 6vw, 5rem);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--raised), var(--deep));
  border: 1px solid var(--line);
  overflow: hidden;
}

.contact__panel .muted {
  margin-top: 0.875rem;
}

/* A large, faint emblem anchors the panel's empty corner. */
.contact__mark {
  position: absolute;
  right: -3rem;
  bottom: -3rem;
  width: clamp(12rem, 30vw, 22rem);
  height: clamp(12rem, 30vw, 22rem);
  opacity: 0.08;
}

.mail {
  position: relative;
  display: inline-block;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(1.375rem, 4.2vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}

.mail:hover {
  color: var(--cyan-hi);
}

/* ---------------------------------------------------------------- footer */

.footer {
  padding: 2rem 0 2.5rem;
  color: var(--mist);
  font-size: 0.875rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 52rem) {
  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__mark {
    grid-row: 1;
    justify-self: start;
    max-width: 7rem;
  }

  .hero__mark::before {
    inset: -80%;
  }

  .project,
  .project--next {
    grid-template-columns: 1fr;
  }

  .sh-card {
    width: 100%;
    margin: 0;
    padding: 1.5rem 1rem 1rem;
    transform: none;
  }

  .pl-call {
    width: 100%;
    margin: 0;
    transform: none;
  }

  .sh-week {
    gap: 0.25rem;
  }

  .sh-week span {
    width: 1.875rem;
    height: 1.875rem;
  }

  .project--next .btn {
    justify-self: start;
  }

  .earlier__item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 26rem) {
  .brand {
    gap: 0.5rem;
  }

  .brand span {
    font-size: 1rem;
  }

  .nav__links {
    gap: 0;
  }

  .nav__links a {
    padding: 0.625rem 0.5rem;
  }
}

@media (max-width: 22.5rem) {
  .brand span,
  .nav__links a {
    font-size: 0.875rem;
  }

  .brand__mark {
    width: 1.625rem;
    height: 1.625rem;
  }

  .btn {
    padding: 0 1.125rem;
  }

  .contact__panel {
    padding: 1.75rem 1.25rem;
  }

  .mail {
    font-size: clamp(1rem, 6.2vw, 1.3125rem);
    overflow-wrap: normal;
  }
}
