:root {
  --canvas: oklch(96% 0.007 345);
  --surface: oklch(99% 0.004 345);
  --ink: oklch(18% 0.018 345);
  --muted: oklch(48% 0.015 345);
  --line: oklch(86% 0.01 345);
  --cherry: oklch(61% 0.22 17);
  --cherry-dark: oklch(52% 0.2 17);
  --green: oklch(70% 0.17 145);
  --font: "Avenir Next", Avenir, "Century Gothic", Futura, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 44%, var(--surface) 0 28%, transparent 70%),
    var(--canvas);
  font-family: var(--font);
  font-size: 1rem;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(100%, 90rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.site-shell > *,
main,
.showcase {
  min-width: 0;
}

.masthead {
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.masthead p,
.fikfap-link {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.masthead p {
  visibility: hidden;
}

.brand {
  justify-self: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.fikfap-link {
  min-height: 2.75rem;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

main {
  min-height: 0;
  display: grid;
}

.showcase {
  min-height: 0;
  padding: clamp(0.75rem, 2.2vh, 1.5rem) 0 0.5rem;
  display: grid;
  grid-template-columns: minmax(0, 100%);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
}

.intro {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 0.4375rem;
  height: 0.4375rem;
  flex: none;
  border-radius: 50%;
  background: var(--cherry);
}

h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.1rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

h1 strong {
  display: block;
  color: var(--cherry);
  font-weight: inherit;
}

.intro > p:last-child {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.device-stage {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: min(calc(100vw + 3rem), 42rem);
  margin: 0;
  padding: 1.25rem 0 0.25rem;
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(0, 1.14fr) minmax(0, 0.93fr);
  align-items: end;
  justify-self: center;
  gap: clamp(0.25rem, 1.2vw, 0.875rem);
}

.device {
  --device-scale: 0.93;
  --device-y: 0rem;
  min-width: 0;
  align-self: end;
  display: block;
  aspect-ratio: 0.54;
  color: var(--ink);
  text-decoration: none;
  transform: translateY(var(--device-y)) scale(var(--device-scale));
  transform-origin: center bottom;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.device-featured {
  --device-scale: 1;
  --device-y: -0.5rem;
  z-index: 2;
}

.device-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(0.22rem, 0.7vw, 0.42rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid oklch(82% 0.008 345);
  border-radius: clamp(1.15rem, 3.7vw, 2.8rem);
  background: var(--surface);
  box-shadow:
    0 1.5rem 3.5rem oklch(28% 0.025 345 / 0.11),
    0 0.25rem 0.75rem oklch(28% 0.025 345 / 0.08);
}

.device-status {
  min-height: clamp(1.15rem, 3vw, 1.8rem);
  padding: 0 clamp(0.35rem, 1.2vw, 0.8rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: clamp(0.4rem, 1.15vw, 0.68rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.device-status span {
  font-size: 0.72em;
  letter-spacing: 0.12em;
}

.portrait {
  min-height: 0;
  flex: 1;
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: clamp(0.9rem, 2.8vw, 2.25rem);
  background: oklch(28% 0.03 345);
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(to bottom, transparent, oklch(12% 0.02 345 / 0.84));
}

.portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.device-sorrel .portrait img {
  object-position: 50% 30%;
}

.device-kira .portrait img {
  object-position: 48% 31%;
}

.device-teresa .portrait img {
  object-position: 55% 27%;
}

.online,
.identity {
  position: absolute;
  z-index: 2;
  color: var(--surface);
}

.online {
  top: clamp(0.4rem, 1.2vw, 0.75rem);
  left: clamp(0.4rem, 1.2vw, 0.75rem);
  padding: clamp(0.2rem, 0.5vw, 0.35rem) clamp(0.35rem, 0.8vw, 0.55rem);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  background: oklch(16% 0.02 345 / 0.72);
  font-size: clamp(0.4rem, 1vw, 0.65rem);
  font-weight: 600;
  line-height: 1;
}

.online i {
  width: 0.4rem;
  height: 0.4rem;
  display: block;
  border-radius: 50%;
  background: var(--green);
}

.identity {
  right: clamp(0.55rem, 1.5vw, 1rem);
  bottom: clamp(0.55rem, 1.5vw, 1rem);
  left: clamp(0.55rem, 1.5vw, 1rem);
  display: grid;
  gap: 0.15rem;
}

.identity small {
  font-size: clamp(0.4rem, 1vw, 0.65rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.identity b {
  overflow: hidden;
  font-size: clamp(0.8rem, 2.4vw, 1.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-copy {
  padding: clamp(0.35rem, 1vw, 0.7rem) clamp(0.5rem, 1.3vw, 0.85rem) 0;
  color: var(--muted);
  font-size: clamp(0.4rem, 1vw, 0.65rem);
  line-height: 1.35;
}

.device-action {
  min-height: clamp(2.25rem, 6vw, 3.5rem);
  padding: 0 clamp(0.5rem, 1.3vw, 0.9rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: clamp(0.48rem, 1.15vw, 0.72rem);
  line-height: 1;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.device-featured .device-action {
  color: var(--surface);
  background: var(--ink);
  border-radius: clamp(0.75rem, 2vw, 1.5rem);
  margin: clamp(0.3rem, 0.8vw, 0.55rem) clamp(0.25rem, 0.7vw, 0.45rem) 0;
}

.device-action > span:last-child {
  font-size: 1.4em;
}

.home-indicator {
  width: 35%;
  height: clamp(0.12rem, 0.35vw, 0.2rem);
  flex: none;
  margin: clamp(0.18rem, 0.5vw, 0.35rem) auto clamp(0.05rem, 0.2vw, 0.12rem);
  border-radius: 999px;
  background: var(--ink);
}

.action-row {
  position: relative;
  z-index: 4;
  width: min(100%, 46rem);
  min-height: 3rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.action-row p {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.action-row p span,
footer p span {
  color: var(--cherry);
}

.create-link {
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: 999px;
  color: var(--surface);
  background: var(--cherry);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease;
}

footer {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

footer p {
  margin: 0;
}

footer a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-underline-offset: 0.22rem;
}

.device:focus-visible,
.brand:focus-visible,
.fikfap-link:focus-visible,
.create-link:focus-visible,
footer a:focus-visible {
  outline: 3px solid var(--cherry);
  outline-offset: 0.25rem;
}

.device:focus-visible {
  border-radius: clamp(1.15rem, 3.7vw, 2.8rem);
}

.missing-page {
  width: min(100% - 2.5rem, 42rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 1.5rem;
}

.missing-page h1 {
  margin: 0;
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.07em;
}

.missing-page .eyebrow,
.missing-page .dek {
  margin: 0;
}

.missing-page .dek {
  color: var(--muted);
}

.missing-page .cta {
  width: fit-content;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  border-radius: 999px;
  color: var(--surface);
  background: var(--ink);
  text-decoration: none;
}

@media (min-width: 48rem) {
  .site-shell {
    padding-right: max(2rem, env(safe-area-inset-right));
    padding-left: max(2rem, env(safe-area-inset-left));
  }

  .masthead p {
    visibility: visible;
  }

  .brand {
    font-size: 1.125rem;
  }

  .showcase {
    padding-top: clamp(1rem, 2.5vh, 2rem);
  }

  .intro {
    gap: 0.65rem;
  }

  .device-stage {
    padding-top: 1.5rem;
  }

  .action-row {
    justify-content: space-between;
    text-align: left;
  }

  .action-row p {
    display: block;
  }
}

@media (hover: hover) {
  .device:hover {
    transform: translateY(calc(var(--device-y) - 0.3rem)) scale(var(--device-scale));
  }

  .create-link:hover {
    background: var(--cherry-dark);
    transform: translateY(-0.125rem);
  }

  .fikfap-link:hover,
  footer a:hover {
    color: var(--cherry-dark);
  }
}

@media (max-height: 43.75rem) {
  .site-shell {
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  .masthead {
    min-height: 2.25rem;
    padding-bottom: 0.4rem;
  }

  .showcase {
    padding-top: 0.45rem;
    padding-bottom: 0.25rem;
  }

  .intro {
    gap: 0.3rem;
  }

  .eyebrow {
    font-size: 0.6rem;
  }

  h1 {
    font-size: clamp(2rem, 7vw, 2.75rem);
  }

  .intro > p:last-child {
    font-size: 0.75rem;
  }

  .device-stage {
    width: min(calc(100vw + 3rem), 33rem);
    padding-top: 0.7rem;
    padding-bottom: 0;
  }

  .device-copy {
    display: none;
  }

  .action-row {
    min-height: 2.5rem;
  }

  .create-link {
    min-height: 2.5rem;
    padding-block: 0.6rem;
  }

  footer,
  footer a {
    min-height: 2rem;
  }
}

@media (min-width: 32rem) and (max-height: 38rem) {
  .site-shell {
    padding-top: max(0.4375rem, env(safe-area-inset-top));
    padding-bottom: max(0.4375rem, env(safe-area-inset-bottom));
  }

  .showcase {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "intro devices"
      "actions devices";
    gap: 0.25rem 1.5rem;
    overflow: visible;
  }

  .intro {
    grid-area: intro;
    align-self: center;
    justify-items: start;
    text-align: left;
  }

  .intro h1 {
    max-width: 10ch;
    font-size: clamp(1.85rem, 5.8vw, 2.5rem);
  }

  .intro > p:last-child {
    max-width: 24ch;
  }

  .device-stage {
    grid-area: devices;
    width: 100%;
    max-width: 23rem;
    align-self: center;
    padding: 0;
  }

  .device-status {
    min-height: 1rem;
  }

  .device-action {
    min-height: 2rem;
  }

  .device-featured .device-action {
    margin-top: 0.2rem;
  }

  .action-row {
    grid-area: actions;
    width: 100%;
    min-height: 2.25rem;
    align-self: end;
    justify-content: flex-start;
  }

  .action-row p {
    display: none;
  }

  .create-link {
    min-height: 2.25rem;
  }

  footer {
    padding-top: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device,
  .create-link {
    transition: none;
  }
}
