/*
 * trendy.ai — the legal documents and the support page.
 *
 * The home page's palette and typeface, set for reading: no motion, one
 * column on a phone, the contents pinned beside the text on a wide screen.
 * The words come from public/legal as written; this only arranges them.
 */

:root {
  --ink: #0a0a0a;
  --ink-2: #121211;
  --bone: #f2f2ee;
  --bone-2: rgb(242 242 238 / 0.8);
  --bone-3: rgb(242 242 238 / 0.52);
  --line: rgb(242 242 238 / 0.1);
  --line-2: rgb(242 242 238 / 0.17);
  --cobalt: #2640ff;
  --lime: #d8ff00;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: dark;
}

:root:lang(ja) {
  --sans: "Geist", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  line-break: strict;
}

:root:lang(ko) {
  --sans: "Geist", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all;
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--bone);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* The home page's cobalt light, held still at the top. */
  background:
    radial-gradient(90% 55% at 15% -8%, rgb(38 64 255 / 0.42), transparent 70%),
    radial-gradient(60% 40% at 100% 0%, rgb(129 144 255 / 0.14), transparent 70%),
    var(--ink);
  background-repeat: no-repeat;
}

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

a {
  color: inherit;
}

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

::selection {
  background: var(--lime);
  color: var(--ink);
}

/* ───────────────────────────── bar ───────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px;
  background: rgb(10 10 10 / 0.72);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}

.bar-home img {
  width: 112px;
  height: auto;
}

/* An app without wordmark artwork goes by its name, set in the site's face. */
.bar-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--bone);
}

/* The language menu: the same document in every language, as on the home page. */
.langs {
  position: relative;
}

.langs summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px 0 11px;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: rgb(242 242 238 / 0.05);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font: 600 12.5px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--bone);
}

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

.langs summary:hover,
.langs[open] summary {
  background: rgb(242 242 238 / 0.1);
  box-shadow: inset 0 0 0 1px var(--bone-3);
}

.langs summary svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.langs .chev {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.langs[open] .chev {
  transform: rotate(180deg);
}

.langs-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 236px;
  max-height: min(72vh, 470px);
  overflow-y: auto;
  padding: 6px;
  border-radius: 20px;
  background: rgb(22 22 21 / 0.96);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    inset 0 0 0 1px var(--line-2),
    0 30px 70px -20px rgb(0 0 0 / 0.9);
}

.langs-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  color: var(--bone-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.langs-menu a:hover,
.langs-menu a:focus-visible {
  background: rgb(242 242 238 / 0.08);
  color: var(--bone);
}

.langs-menu a[aria-current="page"] {
  color: var(--bone);
  background: rgb(216 255 0 / 0.1);
}

.langs-menu small {
  margin-left: auto;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--bone-3);
}

.langs-menu a[aria-current="page"] small {
  color: var(--lime);
}

/* ───────────────────────────── head ───────────────────────────── */

.doc {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
  padding-bottom: 96px;
}

.doc-head {
  padding: clamp(40px, 8vw, 88px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.doc-head h1 {
  margin: 0;
  max-width: 18ch;
  font-weight: 700;
  font-size: clamp(36px, 7.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.048em;
  text-wrap: balance;
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  font: 500 12.5px/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--bone-3);
}

.meta::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgb(216 255 0 / 0.7);
}

/* Above a translated document: the English one applies, and here it is. */
.translation {
  max-width: 64ch;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgb(242 242 238 / 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  line-height: 1.55;
  color: var(--bone-3);
}

.translation a {
  color: var(--lime);
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* The four documents, one tap apart. A phone scrolls the row sideways. */
.tabs {
  display: flex;
  gap: 8px;
  margin: 30px calc(-1 * var(--gutter)) 0;
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  flex: none;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgb(242 242 238 / 0.04);
  box-shadow: inset 0 0 0 1px var(--line-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--bone-2);
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--bone);
  box-shadow: inset 0 0 0 1px var(--bone-3);
}

.tabs a[aria-current="page"] {
  background: var(--bone);
  color: var(--ink);
  box-shadow: none;
}

@media (min-width: 720px) {
  .tabs {
    flex-wrap: wrap;
    margin-inline: 0;
    padding-inline: 0;
  }
}

/* ───────────────────────────── contents ───────────────────────────── */

.doc-grid {
  padding-top: clamp(28px, 5vw, 56px);
}

.contents ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.contents a {
  display: block;
  padding: 7px 0;
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--bone-3);
}

.contents a:hover {
  color: var(--bone);
}

/* On a phone: folded above the text. */
.contents-fold {
  margin-bottom: 36px;
  border-radius: 18px;
  background: rgb(242 242 238 / 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
}

.contents-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  list-style: none;
  cursor: pointer;
  font: 600 12.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
}

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

.contents-fold summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--bone-3);
  border-bottom: 1.5px solid var(--bone-3);
  transform: rotate(45deg) translate(-2px, -2px);
}

.contents-fold[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.contents-fold ol {
  padding: 0 18px 14px;
}

.contents-side {
  display: none;
}

/* On a wide screen: pinned beside the text. */
@media (min-width: 1024px) {
  .doc-grid.with-contents {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 72px;
    align-items: start;
  }

  .contents-fold {
    display: none;
  }

  .contents-side {
    display: block;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 8px;
  }

  .contents-side p {
    margin: 0 0 12px;
    font: 600 12px/1 var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lime);
  }

  .contents-side a {
    padding: 6px 0 6px 14px;
    border-left: 1px solid var(--line-2);
  }

  .contents-side a:hover {
    border-left-color: var(--lime);
  }
}

/* ───────────────────────────── the text ───────────────────────────── */

.prose {
  max-width: 70ch;
  font-size: 17px;
  line-height: 1.75;
  color: var(--bone-2);
  overflow-wrap: break-word;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}

.prose h2 {
  margin: 2.6em 0 0.9em;
  padding-top: 1.6em;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--bone);
  scroll-margin-top: 96px;
}

.prose > h2:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  margin: 2em 0 0.5em;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--bone);
}

.prose strong {
  font-weight: 600;
  color: var(--bone);
}

.prose a {
  color: var(--lime);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

/* Lists wear the wordmark's square. */
.prose ul,
.prose ol {
  margin: 0 0 1.3em;
  padding: 0;
  list-style: none;
}

.prose li {
  position: relative;
  margin: 0 0 0.7em;
  padding-left: 26px;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  background: var(--lime);
}

.prose ol {
  counter-reset: step;
}

.prose ol > li {
  counter-increment: step;
  padding-left: 36px;
}

.prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.2em;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgb(38 64 255 / 0.3);
  box-shadow: inset 0 0 0 1px rgb(129 144 255 / 0.4);
  font: 600 12px/1 var(--mono);
  color: var(--bone);
}

/* ───────────────────────────── foot ───────────────────────────── */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.foot-home img {
  width: 140px;
  height: auto;
}

.foot p {
  margin: 0;
  font: 500 12.5px/1.5 var(--mono);
  letter-spacing: 0.04em;
  color: var(--bone-3);
}

.foot p a {
  color: var(--bone-2);
}

/* Japanese and Korean: their own tracking and line height. */
:lang(ja) .doc-head h1,
:lang(ko) .doc-head h1 {
  /* 18ch is sized for Latin letters; a kana is twice as wide. The size lets a
     ten-character word such as プライバシーポリシー sit on one line of a phone. */
  max-width: none;
  font-size: clamp(28px, 7.2vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Break Japanese between phrases, not inside a word, where the browser can. */
:lang(ja) .doc-head h1,
:lang(ja) .prose h2,
:lang(ja) .prose h3 {
  word-break: auto-phrase;
}

:lang(ja) .prose h2,
:lang(ko) .prose h2,
:lang(ja) .prose h3,
:lang(ko) .prose h3 {
  letter-spacing: 0;
  line-height: 1.4;
}

:lang(ja) .kicker,
:lang(ko) .kicker {
  letter-spacing: 0.06em;
}

/* Printed or saved as PDF, it is a plain document again. */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .bar,
  .tabs,
  .contents,
  .foot {
    display: none;
  }

  .prose,
  .prose h2,
  .prose h3,
  .prose strong,
  .doc-head h1 {
    color: #000;
  }

  .prose a {
    color: #000;
  }
}
