/* Hue & Glow Studio: shared styles for index.html and thanks.html */

:root {
  /* Materials */
  --porcelain: #edefec;
  --slate: #1e2b33;
  --pla: #f7f6f1;
  --cyan: #009dc4;
  --magenta: #c8287a;
  --yellow: #e8b500;

  /* Room light on (default) */
  --page: var(--porcelain);
  --ink: var(--slate);
  --ink-hover: #34454f;
  --muted: #55626a;
  --surface: #e2e6e2;
  --rule: rgba(30, 43, 51, 0.2);
  --focus: var(--magenta);
  --stand: #e3e5e1;
  --stand-lines: rgba(30, 43, 51, 0.06);

  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --gutter: 20px;
}

/* Room light off: the lamp is the only light */
html[data-light="on"] {
  --page: #1a232b;
  --ink: #e7edec;
  --ink-hover: #ffffff;
  --muted: #a9b6ba;
  --surface: #212c35;
  --rule: rgba(231, 237, 236, 0.2);
  --focus: var(--yellow);
  --stand: #2b363e;
  --stand-lines: rgba(255, 255, 255, 0.04);
}

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

[hidden] {
  display: none !important;
}

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

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  line-height: 1.15;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--page);
  font-weight: 600;
  border-radius: 6px;
}

.skip-link:focus {
  top: 12px;
}

/* Notice */

.notice {
  margin: 0;
  padding: 9px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
}

.notice::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.95em;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--yellow);
  vertical-align: -0.1em;
}

/* Header */

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1;
}

.mark {
  display: inline-flex;
  gap: 3px;
  flex: none;
}

.mark span {
  width: 5px;
  height: 18px;
  border-radius: 3px;
}

.mark span:nth-child(1) { background: var(--cyan); }
.mark span:nth-child(2) { background: var(--magenta); }
.mark span:nth-child(3) { background: var(--yellow); }
.mark span:nth-child(4) {
  background: var(--pla);
  box-shadow: inset 0 0 0 1px rgba(30, 43, 51, 0.3);
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .nav-extra {
    display: none;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--page);
  font: 600 1rem/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--ink-hover);
  border-color: var(--ink-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--ink);
}

.btn[aria-disabled="true"] {
  background: transparent;
  border-style: dashed;
  border-color: var(--muted);
  color: var(--muted);
  cursor: not-allowed;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-block: 20px 40px;
  overflow-x: clip;
}

.hero h1 {
  font-size: clamp(2.125rem, 4.2vw + 1rem, 3.5rem);
  line-height: 1.07;
  max-width: 14ch;
  margin-bottom: 20px;
}

.lede {
  font-size: 1.1875rem;
  max-width: 34em;
}

.hero-text > p:not(.lede):not(.hero-actions) {
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 28px;
}

.hero-note {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* On phones the demo comes first */
.demo {
  order: -1;
}

@media (min-width: 880px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 56px;
    padding-block: 48px 40px;
  }

  .demo {
    order: 0;
  }

  .lamp {
    width: 320px;
  }
}

/* Lithophane demo */

.demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 0;
}

.lamp {
  position: relative;
  width: min(58vw, 290px);
  padding-top: 8px;
}

/* Light spilling onto the wall behind the lamp */
.lamp::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -22% -42% -6%;
  background: radial-gradient(closest-side, rgba(64, 226, 160, 0.3), rgba(31, 196, 196, 0.12) 55%, rgba(200, 40, 122, 0.05) 75%, transparent);
  opacity: 0;
  pointer-events: none;
}

/* Contact shadow under the stand */
.lamp::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: -8%;
  right: -8%;
  bottom: -10px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(10, 18, 24, 0.28), transparent);
}

.panel {
  position: relative;
  z-index: 1;
  aspect-ratio: 3 / 4;
  border-radius: 3px;
  overflow: hidden;
  background: var(--pla);
  box-shadow:
    0 0 0 1px rgba(30, 43, 51, 0.08),
    0 22px 36px -24px rgba(30, 43, 51, 0.5);
}

.panel-face,
.panel-face > svg,
.panel-face > video,
.panel-face > img {
  display: block;
  width: 100%;
  height: 100%;
}

.panel-face > video,
.panel-face > img {
  object-fit: cover;
}

.art-lit {
  opacity: 0;
}

.stand {
  position: relative;
  z-index: 2;
  height: 44px;
  margin: -20px -22px 0;
  border-radius: 8px 8px 5px 5px;
  background-color: var(--stand);
  background-image: repeating-linear-gradient(to bottom, var(--stand-lines) 0 1px, transparent 1px 3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(30, 43, 51, 0.06),
    0 1px 0 rgba(30, 43, 51, 0.08);
}

/* The LED's edge, glowing through the slot */
.stand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 2px;
  background: #c8ffe4;
  box-shadow: 0 0 10px 2px rgba(120, 240, 200, 0.6);
  opacity: 0;
}

html[data-light="on"] .art-lit,
html[data-light="on"] .lamp::before,
html[data-light="on"] .stand::before {
  opacity: 1;
}

html[data-light="on"] .panel {
  box-shadow:
    0 0 0 1px rgba(150, 255, 210, 0.08),
    0 0 36px rgba(64, 226, 160, 0.28),
    0 0 110px rgba(200, 40, 122, 0.14);
}

html[data-light="on"] .stand {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(0, 0, 0, 0.2);
}

.light-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1.2 var(--font-body);
  cursor: pointer;
}

.light-toggle:hover {
  background: var(--surface);
}

.light-toggle:focus-visible {
  border-radius: 999px;
}

.bulb {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.light-toggle[aria-pressed="true"] .bulb {
  border-color: var(--yellow);
  background: var(--yellow);
  box-shadow: 0 0 10px 2px rgba(232, 181, 0, 0.55);
}

.demo figcaption {
  max-width: 30ch;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

/* Sections */

.section {
  padding-block: 56px;
}

.section h2 {
  font-size: clamp(1.75rem, 2.2vw + 1rem, 2.375rem);
  margin-bottom: 14px;
}

.section-intro {
  max-width: 40em;
  color: var(--muted);
}

@media (min-width: 880px) {
  .section {
    padding-block: 64px;
  }
}

/* Products: a ruled list */

.products {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.product {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "info info"
    "price action";
  align-items: center;
  gap: 14px 20px;
  padding-block: 24px;
  border-bottom: 1px solid var(--rule);
}

.product-info {
  grid-area: info;
}

.product-info h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  margin-bottom: 6px;
}

.product-info p {
  margin: 0;
  max-width: 36em;
}

.product-info .product-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.product-price {
  grid-area: price;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.625rem;
  line-height: 1;
}

.product-action {
  grid-area: action;
  justify-self: end;
}

.product-action .btn {
  min-width: 190px;
}

@media (min-width: 720px) {
  .product {
    grid-template-columns: minmax(0, 1fr) 96px 200px;
    grid-template-areas: "info price action";
    gap: 24px;
    padding-block: 28px;
  }

  .product-price {
    justify-self: end;
  }

  .product-action .btn {
    width: 100%;
  }
}

/* Steps */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 28px;
  margin: 32px 0 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.steps h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.steps p {
  margin: 0;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 32px;
  }
}

@media (min-width: 960px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Photo tips */

.photo-tips {
  display: grid;
  gap: 24px;
  margin: 28px 0;
}

.photo-tips > div {
  padding-left: 18px;
  border-left: 3px solid var(--cyan);
}

.photo-tips > div + div {
  border-left-color: var(--magenta);
}

.photo-tips h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.photo-tips p {
  margin: 0;
  max-width: 30em;
}

.tip-note {
  max-width: 40em;
  color: var(--muted);
}

@media (min-width: 640px) {
  .photo-tips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

/* Policies */

.policies {
  max-width: 760px;
  margin-top: 28px;
  border-top: 1px solid var(--rule);
}

.policies details {
  border-bottom: 1px solid var(--rule);
}

.policies summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.policies summary::-webkit-details-marker {
  display: none;
}

.policies summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.policies details[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.policies details p {
  max-width: 62ch;
}

.policies details p:last-child {
  margin-bottom: 20px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 40px;
  padding-block: 36px 48px;
}

.footer-inner p {
  margin: 0 0 4px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
}

.footer-brand .mark span {
  height: 15px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 4px;
}

.footer-links a {
  color: var(--ink);
}

/* Thanks page */

.thanks {
  padding-block: 32px 72px;
}

.thanks h1 {
  font-size: clamp(2rem, 3.4vw + 1rem, 3rem);
  max-width: 16ch;
  margin-bottom: 16px;
}

.thanks .lede {
  max-width: 34em;
}

.ref {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 12px 0 8px;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  background: var(--pla);
}

.ref-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.ref-code {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.copy-btn {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 0.9375rem;
}

.thanks .section {
  padding-block: 40px 0;
}

.thanks .section h2 {
  margin-bottom: 12px;
}

.thanks .section > p {
  max-width: 40em;
}

.send-options {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.send-option {
  padding: 20px 0 0;
  border-top: 1px solid var(--rule);
}

.send-option h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.send-option p {
  max-width: 34em;
}

@media (min-width: 720px) {
  .send-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }
}

.next-steps {
  margin: 0;
  padding-left: 1.4em;
  max-width: 40em;
}

.next-steps li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.next-steps li::marker {
  font-family: var(--font-display);
}

/* Motion: only the light switch moves, and only if motion is welcome */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .art-lit,
  .lamp::before,
  .stand::before {
    transition: opacity 1s ease;
  }

  .panel,
  .stand {
    transition: box-shadow 1s ease, background-color 1s ease;
  }

  /* Added by script for the length of the switch, so the room dims gently */
  html.dimming,
  html.dimming *,
  html.dimming *::before,
  html.dimming *::after {
    transition:
      background-color 1s ease,
      color 1s ease,
      border-color 1s ease,
      box-shadow 1s ease,
      opacity 1s ease !important;
  }
}

.back-link {
  margin-top: 40px;
}

.thanks > p {
  max-width: 40em;
}
