/*
 * Nestory marketing site. Warm paper, an old photo album: calm, safe, intimate.
 * The palette mirrors the app's locked tokens (apps/web/src/styles/tokens.css and
 * apps/ios/Nestory/Design/Theme.swift). Light only, as the brief asks.
 */

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("fonts/lora-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url("fonts/lora-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Brand palette (the app's) */
  --canvas: #faf7f0;
  --surface: #f0e8d9;
  --raised: #fffdf8;
  --border-subtle: #e4d9c7;
  --text-primary: #3a2f28;
  --text-secondary: #6b5c52;
  --primary-500: #b97a5f; /* terracotta: large type and marks only (3.4:1 on canvas) */
  --primary-100: #f4e4d9;
  --primary-text: #945841; /* terracotta for small text: 5.3:1 on canvas */
  --trust-600: #2c3f35; /* privacy */
  --trust-tint: #e3eae4;
  --accent-400: #e8b88a;
  --ink: #2a221d;
  --on-dark: #f4ece1;
  --on-dark-soft: rgb(244 236 225 / 0.8);

  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-soft: 0 12px 32px rgb(58 47 40 / 0.1), 0 2px 6px rgb(58 47 40 / 0.05);
  --gutter: 20px;
  --container: 1120px;
  --section: 72px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

@media (min-width: 700px) {
  :root {
    --gutter: 32px;
    --section: 104px;
  }
}

/* --- Base ------------------------------------------------------------------------------------ */

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p,
blockquote {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--primary-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

:where(ul[role="list"]) {
  list-style: none;
  margin: 0;
  padding: 0;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: var(--on-dark);
  font-weight: 600;
  text-decoration: none;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* --- Brand ----------------------------------------------------------------------------------- */

.brand-mark {
  display: inline-block;
  flex: none;
  width: 38px;
  height: 36px;
  background: var(--primary-500);
  -webkit-mask: url("images/nest-mark.png") center / contain no-repeat;
  mask: url("images/nest-mark.png") center / contain no-repeat;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
}

.wordmark--small {
  gap: 8px;
  font-size: 1.125rem;
}

.wordmark--small .brand-mark {
  width: 28px;
  height: 27px;
}

/* --- Buttons and store badge ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.button--dark {
  background: var(--text-primary);
  color: var(--on-dark);
}

.button--dark:hover {
  background: var(--ink);
}

.button:active {
  transform: scale(0.98);
}

/* Until launch: shaped like the App Store badge, but no Apple marks (Apple's badge must link to a live listing). */
.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 26px 10px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
}

.store-soon__icon {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--accent-400);
  stroke-width: 1.5;
}

.store-soon__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.store-soon__small {
  color: rgb(255 255 255 / 0.78);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

.store-soon__large {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(148 88 65 / 0.35);
}

.text-link::after {
  content: " ↓" / "";
}

.text-link:hover {
  text-decoration-color: currentColor;
}

/* --- Header ---------------------------------------------------------------------------------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  padding-block: 18px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* --- Hero ------------------------------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 112px var(--section);
}

.hero::before {
  content: "";
  position: absolute;
  top: -360px;
  right: -280px;
  width: 980px;
  height: 980px;
  background: radial-gradient(closest-side, rgb(232 184 138 / 0.3), rgb(232 184 138 / 0));
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  gap: 56px;
  align-items: center;
}

.hero__title {
  margin-top: 18px;
  font-size: clamp(2.75rem, 1.5rem + 5vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero__line {
  display: block;
}

.hero__title em {
  color: var(--primary-500);
  font-weight: 500;
}

.hero__lede {
  max-width: 34rem;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}

.hero__note {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.hero__visual {
  position: relative;
  isolation: isolate;
  justify-self: center;
  padding-bottom: 28px;
}

.hero__visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4% -30% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary-100) 30%, rgb(244 228 217 / 0));
}

@media (min-width: 900px) {
  .hero {
    padding-top: 136px;
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 48px;
  }

  .hero__visual {
    padding-bottom: 0;
  }
}

/* --- Phone ----------------------------------------------------------------------------------- */

.phone {
  --phone-w: 272px;
  --bezel: 10px;
  --screen-w: calc(var(--phone-w) - 2 * var(--bezel));
  width: var(--phone-w);
  padding: var(--bezel);
  border-radius: calc(var(--phone-w) * 0.16);
  background: linear-gradient(150deg, #4a3f38, #1d1714 40%, #2a221d);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / 0.1),
    0 2px 4px rgb(42 34 29 / 0.12),
    0 30px 60px -18px rgb(58 47 40 / 0.4);
}

.phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--screen-w) * 0.137);
  background: var(--canvas);
}

/* The Dynamic Island: simulator screenshots leave its spot empty. */
.phone__screen::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(var(--screen-w) * 0.0274);
  left: 50%;
  width: 31.3%;
  aspect-ratio: 126 / 37;
  border-radius: var(--radius-pill);
  background: #0c0a09;
  transform: translateX(-50%);
}

.phone__screen img {
  width: 100%;
}

.phone--cropped {
  padding-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.phone--cropped .phone__screen {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

@media (min-width: 900px) {
  .phone {
    --phone-w: 312px;
    --bezel: 11px;
  }
}

.chip {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border: 1px solid rgb(228 217 199 / 0.7);
  border-radius: 16px;
  background: var(--raised);
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transform: translateX(-50%);
}

.chip__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--trust-tint);
  color: var(--trust-600);
}

.chip__icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

@media (min-width: 900px) {
  .chip {
    bottom: 7%;
    left: -104px;
    transform: none;
  }
}

/* --- What is Nestory + features ------------------------------------------------------------- */

.about {
  padding-block: var(--section);
  background: var(--surface);
}

.about__intro {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}

.about__title {
  margin-top: 16px;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

.about__body {
  margin-top: 20px;
  text-wrap: balance;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.5;
}

.about__body em {
  color: var(--primary-text);
}

.features {
  display: grid;
  gap: 20px;
  margin-top: 56px;
}

.feature {
  padding: 28px;
  border: 1px solid rgb(228 217 199 / 0.8);
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow:
    0 1px 2px rgb(58 47 40 / 0.04),
    0 10px 28px rgb(58 47 40 / 0.06);
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-100);
  color: var(--primary-text);
}

.feature__icon svg {
  width: 28px;
  height: 28px;
}

.feature h3 {
  margin-top: 22px;
  font-size: 1.4375rem;
}

.feature p {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 1rem;
}

@media (min-width: 800px) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 72px;
  }

  .feature {
    padding: 32px;
  }
}

/* --- Privacy promise ------------------------------------------------------------------------ */

.privacy {
  position: relative;
  overflow: hidden;
  padding-top: var(--section);
  background: var(--trust-600);
  color: var(--on-dark);
}

.privacy::before {
  content: "";
  position: absolute;
  bottom: -420px;
  left: -300px;
  width: 900px;
  height: 900px;
  background: radial-gradient(closest-side, rgb(143 179 160 / 0.16), rgb(143 179 160 / 0));
  pointer-events: none;
}

.privacy__inner {
  position: relative;
  display: grid;
  gap: 48px;
}

.eyebrow--on-dark {
  color: var(--accent-400);
}

.privacy__title {
  margin-top: 16px;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

.promise {
  margin-top: 32px;
  padding-left: 24px;
  border-left: 2px solid var(--accent-400);
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
}

.privacy__body {
  max-width: 36rem;
  margin-top: 28px;
  color: var(--on-dark-soft);
  font-size: 1.0625rem;
}

.proof {
  display: grid;
  gap: 16px;
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid rgb(244 236 225 / 0.16);
}

.proof li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--on-dark-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.proof svg {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 1px;
  color: var(--accent-400);
}

.privacy__visual {
  justify-self: center;
  align-self: end;
}

@media (min-width: 900px) {
  .privacy__inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 64px;
  }

  .privacy__copy {
    padding-bottom: var(--section);
  }
}

/* --- Download -------------------------------------------------------------------------------- */

.download {
  position: relative;
  overflow: hidden;
  padding-block: var(--section);
  text-align: center;
}

.download::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 900px;
  height: 640px;
  background: radial-gradient(closest-side, rgb(232 184 138 / 0.22), rgb(232 184 138 / 0));
  transform: translateX(-50%);
  pointer-events: none;
}

.download__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-icon {
  width: 104px;
  height: 104px;
  border-radius: 23px;
  box-shadow:
    0 0 0 1px rgb(58 47 40 / 0.06),
    0 12px 28px rgb(58 47 40 / 0.16);
}

.download__title {
  margin-top: 32px;
  font-size: clamp(2.125rem, 1.5rem + 2.6vw, 3.5rem);
}

.download__lede {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
}

.download .store-soon {
  margin-top: 36px;
}

.download__web {
  max-width: 26rem;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* --- Footer ---------------------------------------------------------------------------------- */

.site-footer {
  padding-block: 32px 40px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.site-footer__legal {
  flex-basis: 100%;
}

@media (min-width: 700px) {
  .site-footer__legal {
    flex-basis: auto;
    margin-left: auto;
  }
}

/* --- Not found ------------------------------------------------------------------------------- */

.not-found {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  min-height: 100dvh;
  padding: 32px var(--gutter);
  text-align: center;
}

.not-found .brand-mark {
  width: 110px;
  height: 104px;
  margin-bottom: 8px;
}

.not-found h1 {
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
}

.not-found p {
  color: var(--text-secondary);
}

.not-found .button {
  margin-top: 12px;
}

/* --- Motion and accessibility --------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * {
    animation: rise 0.9s var(--ease) both;
  }

  .hero__copy > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero__copy > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .hero__copy > :nth-child(n + 4) {
    animation-delay: 0.18s;
  }

  .hero__visual {
    animation: rise 1.1s 0.1s var(--ease) both;
  }

  .chip {
    animation: fade 0.8s 0.7s var(--ease) both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

@media (forced-colors: active) {
  .brand-mark {
    background: CanvasText;
  }
}
