/* Wattch website. Palette, type and the wafer shape come from the app's theme.dart. */

@font-face {
  font-family: "Sofia Sans";
  src: url("fonts/sofia-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Sans";
  src: url("fonts/sofia-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Sans Condensed";
  src: url("fonts/sofia-sans-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* The palette. Everything below is one of these or a mix of two of them. */
  --silicon: #0e1a30;
  --night: #081020;
  --frame: #eceff3;
  --ink: #101a2c;
  --busbar: #d5dce5;
  --solar: #ffae00;
  --grid: #2f74e8;
  --battery: #12a594;

  /* Roles, light scheme. The panel is white in light mode, as in the app. */
  --page: var(--frame);
  --panel: #fff;
  --text: var(--ink);
  --muted: color-mix(in srgb, var(--ink) 68%, var(--frame));
  --line: color-mix(in srgb, var(--ink) 16%, var(--frame));

  --text-font: "Sofia Sans", system-ui, sans-serif;
  --figure-font: "Sofia Sans Condensed", "Sofia Sans", system-ui, sans-serif;

  --gutter: 1rem;
  --section-gap: 4.5rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: var(--night);
    --panel: var(--silicon);
    --text: var(--busbar);
    --muted: color-mix(in srgb, var(--busbar) 68%, var(--night));
    --line: color-mix(in srgb, var(--busbar) 20%, var(--night));
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
    --section-gap: 7rem;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--text-font);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

/* The wafer: a rectangle with its corners cut at 45 degrees. Each element sets
   its own --cut; an inner layer takes 0.59px less so the bevel edge between the
   two stays one pixel wide. */
.hero::before,
.hero::after,
.give::before,
.give::after,
.shot,
.shot img,
.brand img {
  clip-path: polygon(
    var(--cut) 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut)),
    0 var(--cut)
  );
}

.wrap {
  width: min(100% - 2 * var(--gutter), 70rem);
  margin-inline: auto;
}

/* Header */

.site-header {
  padding-block: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--figure-font);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1;
}

.brand img {
  --cut: 6px;
  width: 2.25rem;
  height: 2.25rem;
}

/* Hero: the production panel of the page */

.hero {
  --cut: 1.5rem;
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 2.5rem;
  padding: 2.25rem 1.25rem 1.75rem;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
}

.hero::before {
  inset: 0;
  background: var(--line);
}

.hero::after {
  --cut: calc(1.5rem - 0.59px);
  inset: 1px;
  background: var(--panel);
}

.hero h1 {
  font-family: var(--figure-font);
  font-weight: 600;
  font-size: clamp(2.125rem, 10.5vw, 4rem);
  line-height: 1;
  text-wrap: balance;
}

.lead {
  max-width: 33rem;
  margin-top: 1.25rem;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.download {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: 6px;
  background: var(--solar);
  color: var(--ink);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.2;
  text-decoration: none;
}

.download:hover {
  background: color-mix(in srgb, var(--solar) 86%, var(--frame));
}

.download:active {
  transform: translateY(1px);
}

.download:focus-visible {
  border-radius: 6px;
}

.note {
  max-width: 33rem;
  margin-top: 0.875rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.shot {
  --cut: 1rem;
  padding: 1px;
  background: var(--line);
}

.shot img {
  --cut: calc(1rem - 0.59px);
  width: 100%;
}

.hero-figure {
  width: min(100%, 23rem);
}

figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (min-width: 56rem) {
  .hero {
    --cut: 2.5rem;
    grid-template-columns: minmax(0, 1fr) 23rem;
    align-items: center;
    gap: 3.5rem;
    padding: 4rem;
  }

  .hero::after {
    --cut: calc(2.5rem - 0.59px);
  }
}

/* Sections */

.section {
  margin-top: var(--section-gap);
}

.section-title {
  font-family: var(--figure-font);
  font-weight: 600;
  font-size: clamp(2rem, 1.35rem + 2.8vw, 3rem);
  line-height: 1.05;
}

.section-intro {
  max-width: 36rem;
  margin-top: 1rem;
}

/* What it does differently */

.feature {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.feature-title,
.extras-title {
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
}

.feature-text p {
  max-width: 34rem;
  margin-top: 0.75rem;
}

.feature-figure {
  display: grid;
  gap: 0.75rem;
  align-self: start;
  width: min(100%, 25.75rem);
}

.shot-strip {
  --cut: 0.625rem;
}

.shot-strip img {
  --cut: calc(0.625rem - 0.59px);
}

@media (min-width: 56rem) {
  .feature {
    grid-template-columns: minmax(0, 1fr) 25.75rem;
    gap: 4rem;
    margin-top: 3.5rem;
    padding-top: 3.5rem;
  }
}

.extras {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.extras-list {
  max-width: 44rem;
  margin-top: 1rem;
}

.extras-list li {
  position: relative;
  padding: 0.625rem 0 0.625rem 1.625rem;
}

.extras-list li + li {
  border-top: 1px solid var(--line);
}

/* A key square, like the legend under the app's share bar. Colour says which
   side of the inverter the item belongs to; no colour means neither. */
.extras-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.125rem;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--muted);
}

.extras-list .is-solar::before {
  background: var(--solar);
}

.extras-list .is-grid::before {
  background: var(--grid);
}

.extras-list .is-battery::before {
  background: var(--battery);
}

@media (min-width: 56rem) {
  .extras {
    margin-top: 3.5rem;
    padding-top: 3.5rem;
  }
}

/* Requirements, set like the rating plate on the inverter, on the same surface
   as the app's cards. */

.plate {
  max-width: 52rem;
  margin-top: 2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.plate-row {
  padding: 1rem 1.25rem 1.125rem;
}

.plate-row + .plate-row {
  border-top: 1px solid var(--line);
}

.plate dt {
  color: var(--muted);
  font-size: 0.9375rem;
}

.plate-value {
  display: block;
  font-family: var(--figure-font);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
}

.plate-detail {
  display: block;
  max-width: 34rem;
  margin-top: 0.25rem;
  font-size: 1rem;
}

@media (min-width: 40rem) {
  .plate-row {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.125rem 1.75rem 1.25rem;
  }

  .plate dt {
    padding-top: 0.3125rem;
  }
}

/* Installation: a real sequence, so it is numbered. */

.steps {
  display: grid;
  gap: 1.75rem;
  margin-top: 2rem;
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: 3rem;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.375rem;
  font-family: var(--figure-font);
  font-weight: 600;
  font-size: 2.75rem;
  line-height: 1;
}

.step-title {
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.3;
}

.step p {
  max-width: 30rem;
  margin-top: 0.375rem;
}

@media (min-width: 56rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
  }

  .step {
    padding-left: 0;
    padding-top: 3.75rem;
  }

  .step::before {
    top: 0;
  }
}

.get {
  margin-top: 2.5rem;
}

.get .download {
  margin-top: 0;
}

/* Setup: the steps beside the settings they are about. */

.setup {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.setup-steps {
  display: grid;
  gap: 1.75rem;
  align-content: start;
  counter-reset: setup;
}

.setup-step {
  position: relative;
  padding-left: 3rem;
  counter-increment: setup;
}

.setup-step::before {
  content: counter(setup);
  position: absolute;
  left: 0;
  top: -0.375rem;
  font-family: var(--figure-font);
  font-weight: 600;
  font-size: 2.75rem;
  line-height: 1;
}

.setup-step p {
  max-width: 34rem;
  margin-top: 0.375rem;
}

.setup-step p + p {
  margin-top: 0.75rem;
}

@media (min-width: 56rem) {
  .setup {
    grid-template-columns: minmax(0, 1fr) 25.75rem;
    gap: 4rem;
    margin-top: 2.5rem;
  }
}

/* Donation: a second, smaller wafer that closes the page. The button is ink or
   silver like the app's controls; amber stays reserved for the download. */

.give {
  --cut: 1.25rem;
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 1.75rem;
  padding: 2rem 1.25rem;
}

.give::before,
.give::after {
  content: "";
  position: absolute;
  z-index: -1;
}

.give::before {
  inset: 0;
  background: var(--line);
}

.give::after {
  --cut: calc(1.25rem - 0.59px);
  inset: 1px;
  background: var(--panel);
}

.give-text {
  max-width: 36rem;
  margin-top: 1rem;
}

.give-button {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--panel);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.2;
  text-decoration: none;
}

.give-button:hover {
  background: color-mix(in srgb, var(--text) 86%, var(--panel));
}

.give-button:active {
  transform: translateY(1px);
}

.give-button:focus-visible {
  border-radius: 6px;
}

@media (min-width: 56rem) {
  .give {
    --cut: 2rem;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4rem;
    padding: 3rem 4rem;
  }

  .give::after {
    --cut: calc(2rem - 0.59px);
  }
}

/* Footer */

.site-footer {
  margin-top: var(--section-gap);
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer p {
  max-width: 40rem;
}

.site-footer p + p {
  margin-top: 0.5rem;
}
