/* WiseCal — tokens from library-and-styles-spec.md + Figma button (24px radius, 56px height) */

:root {
  --background-primary: #fffbf1;
  --surface-primary: #ffffff;
  --surface-tertiary: #e8e2d9;
  --text-primary: #1a1a1a;
  --text-secondary: #646464;
  --text-tertiary: #838383;
  --text-muted: #8d8d8d;
  --border-subtle: #cecece;
  --border-hairline: #d9d9d9;
  --accent-interactive: #0090ff;
  --accent-brand: #faaf40;
  --brand-red: #ee4036;
  --brand-orange: #f05a28;
  --on-accent: #fffbf1;

  --radius-button: 24px;
  --radius-card: 16px;
  --button-height: 56px;

  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", system-ui, sans-serif;
  --max-width: 720px;
  --page-pad: clamp(1.25rem, 4vw, 2rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-primary);
  background:
    radial-gradient(120% 80% at 100% -10%, rgba(250, 175, 64, 0.18), transparent 55%),
    radial-gradient(90% 60% at -10% 0%, rgba(238, 64, 54, 0.1), transparent 50%),
    var(--background-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-interactive);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text-primary);
  color: var(--on-accent);
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: var(--page-pad);
  top: 0.75rem;
}

.site-header {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--max-width) + 8rem);
  margin: 0 auto;
  padding: 1.25rem var(--page-pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 46px;
  height: 36px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 3px solid var(--accent-brand);
  outline-offset: 2px;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bars {
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

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

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text-primary);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad) 4rem;
}

.home main {
  max-width: none;
  padding: 0 0 4rem;
}

.hero {
  padding: 0;
}

.hero__inner {
  max-width: calc(var(--max-width) + 8rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 4.5rem) var(--page-pad) 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.hero__icon {
  margin: 0;
  width: clamp(140px, 22vw, 220px);
  flex-shrink: 0;
  aspect-ratio: 1;
  animation: fade-scale 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22.37%;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(26, 26, 26, 0.04),
    0 8px 24px rgba(26, 26, 26, 0.08),
    0 28px 56px rgba(26, 26, 26, 0.1);
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.hero h1 {
  margin: 0 0 0.85rem;
  max-width: 14ch;
  font-family: "SF Pro Display", var(--font);
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-primary);
  text-wrap: balance;
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__lede {
  margin: 0 0 1.5rem;
  max-width: 34ch;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-secondary);
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1rem;
  margin-bottom: 0;
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent-interactive);
  min-height: auto;
  padding: 0.5rem 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.btn--ghost:hover:not([aria-disabled="true"]) {
  opacity: 1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.hero__disclaimer {
  margin: 1rem 0 0;
  max-width: 34ch;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: left;
  animation: rise-in 0.7s ease 0.2s both;
}

.hero__visual {
  margin: 0;
  width: 100%;
  max-height: min(62vh, 720px);
  overflow: hidden;
  animation: fade-scale 1s ease 0.2s both;
}

.hero__visual img {
  width: 100%;
  height: min(62vh, 720px);
  object-fit: cover;
  object-position: center 45%;
}

.moments {
  padding: 3rem 0 4rem;
}

.moments__rail {
  width: 100%;
  overflow: hidden;
  margin: 0 0 2.5rem;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 3%,
    #000 97%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 3%,
    #000 97%,
    transparent 100%
  );
}

.moments__track {
  --moments-height: clamp(280px, 42vh, 420px);
  --moments-gap: 0.75rem;
  display: flex;
  width: max-content;
  gap: var(--moments-gap);
  align-items: stretch;
  animation: moments-scroll 70s linear infinite;
  will-change: transform;
}

.moments__rail:hover .moments__track {
  animation-play-state: paused;
}

.moments__slide {
  margin: 0;
  flex: 0 0 auto;
  height: var(--moments-height);
  width: calc(var(--moments-height) * 0.72);
  overflow: hidden;
  border-radius: 4px;
}

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

.moments__copy {
  max-width: calc(var(--max-width) + 8rem);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.moments__copy h2 {
  margin: 0 0 0.85rem;
  max-width: 16ch;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.moments__copy > p {
  margin: 0 0 2.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 40ch;
  font-size: clamp(1.0625rem, 2vw, 1.2rem);
  line-height: 1.4;
}

.moments__uses {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.moments__uses li {
  display: grid;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.moments__uses strong {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-primary);
}

.moments__uses span {
  color: var(--text-secondary);
  font-size: 0.975rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 28ch;
}

@keyframes moments-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-50% - var(--moments-gap) / 2), 0, 0);
  }
}

@keyframes nav-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-scale {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero__lede,
  .cta-row,
  .hero__disclaimer,
  .hero__icon,
  .hero__visual {
    animation: none;
    transition: none;
  }

  .moments__track {
    animation: none;
    transform: none;
    width: 100%;
    max-width: calc(var(--max-width) + 8rem);
    margin: 0 auto;
    padding: 0 var(--page-pad);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .moments__slide[aria-hidden="true"] {
    display: none;
  }

  .site-header.is-nav-open .nav {
    animation: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
  padding: 0 1.5rem;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.1px;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:hover:not([aria-disabled="true"]) {
  opacity: 0.92;
  text-decoration: none;
}

.btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.85;
  pointer-events: none;
}

.btn:focus-visible {
  outline: 3px solid var(--accent-brand);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent-interactive);
  color: var(--on-accent);
}

.btn--outlined {
  background: var(--surface-primary);
  border-color: var(--border-subtle);
  color: var(--accent-interactive);
}

.btn--secondary {
  background: var(--background-primary);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.disclaimer {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 42ch;
}

.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-hairline);
}

.home .section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem var(--page-pad);
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.section p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.feature-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.feature-list li {
  padding: 1.1rem 1.2rem;
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}

.feature-list strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1rem;
  font-weight: 700;
}

.feature-list span {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.page-title {
  margin: 1.5rem 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.page-intro {
  margin: 0 0 2rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 48ch;
}

.error-page__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: clamp(1.5rem, 6vh, 3rem);
  padding-bottom: 4rem;
  min-height: min(70vh, 36rem);
}

.error-page__code {
  margin: 0 0 0.35rem;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.error-page .page-title {
  margin-top: 0;
}

.error-page .page-intro {
  margin-bottom: 1.5rem;
}

.legal-page {
  max-width: min(860px, 100%);
}

.legal-shell {
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: clamp(1.25rem, 3vw, 2rem);
  min-height: 16rem;
}

.legal-shell--termly {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.legal-shell--termly table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.legal-shell h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
}

.legal-shell__meta {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.legal-shell h2 {
  margin: 1.75rem 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.legal-shell h3 {
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.legal-shell p,
.legal-shell li {
  color: var(--text-secondary);
  font-weight: 500;
}

.legal-placeholder {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

.legal-placeholder code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--text-primary);
}

.site-footer {
  max-width: calc(var(--max-width) + 8rem);
  margin: 0 auto;
  padding: 2rem var(--page-pad) 2.5rem;
  border-top: 1px solid var(--border-hairline);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--text-primary);
}

.site-footer p {
  margin: 0.35rem 0;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 1rem var(--page-pad) calc(1rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 251, 241, 0.92);
  border-top: 1px solid var(--border-hairline);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -8px 32px rgba(26, 26, 26, 0.08);
}

body:has(.cookie-banner:not([hidden])) {
  padding-bottom: 9rem;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner {
  max-width: calc(var(--max-width) + 8rem);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.cookie-banner__copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.cookie-banner__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.cookie-banner__text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-secondary);
  max-width: 52ch;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cookie-banner__actions .btn {
  min-height: 44px;
  padding: 0 1.15rem;
  font-size: 1rem;
}

.legal-shell ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.legal-shell li {
  margin-bottom: 0.5rem;
}

.legal-shell code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--text-primary);
}

.copy-card {
  margin: 1.25rem 0 0;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--surface-primary);
}

.copy-card__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.copy-card__meta {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.copy-card__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.copy-card__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.copy-card__btn {
  flex-shrink: 0;
  min-width: 9.5rem;
}

.copy-card__status {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
}

.copy-card__status[hidden] {
  display: none;
}

.copy-card__alt {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.copy-card__template {
  margin: 0 0 1rem;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
}

@media (max-width: 900px) {
  .moments__uses {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    max-width: 36rem;
  }

  .moments__uses span {
    max-width: 42ch;
  }
}

@media (max-width: 760px) {
  .hero__inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .hero__icon {
    width: min(100%, 148px);
  }

  .hero h1 {
    max-width: 12ch;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: var(--page-pad);
    background: var(--surface-primary);
    border: 0;
    border-top: 1px solid var(--border-hairline);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 16px 36px rgba(26, 26, 26, 0.1);
  }

  .site-header.is-nav-open .nav {
    display: flex;
    animation: nav-panel-in 0.18s ease both;
  }

  .nav a {
    padding: 0.95rem 1rem;
    border-radius: 12px;
    font-size: 1.0625rem;
    color: var(--text-primary);
  }

  .nav a:hover {
    background: var(--background-primary);
  }

  .nav a[aria-current="page"] {
    background: rgba(0, 144, 255, 0.12);
    color: var(--accent-interactive);
    font-weight: 700;
  }
}

@media (max-width: 560px) {
  .btn:not(.btn--ghost) {
    width: 100%;
  }

  .cta-row {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .hero__icon {
    width: min(100%, 120px);
  }

  .hero__visual img {
    height: min(48vh, 420px);
  }

  .moments__track {
    --moments-height: clamp(240px, 38vh, 320px);
    --moments-gap: 0.55rem;
    animation-duration: 55s;
  }

  .moments__uses {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .moments__uses span {
    max-width: 42ch;
  }

  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__actions .btn {
    flex: 1 1 auto;
  }
}
