/* Fray's website: the same white, ink, denim and copper as the app. */
:root {
  --bg: #FFFFFF;
  --ink: #10141C;
  --muted: #556072;
  --line: #DEE3EC;
  --soft: #EEF1F8;
  --denim: #5A78A0;
  --deep: #45628A;
  --copper: #B26B2E;
  --error: #C8443F;
  /* Denim washes, lightest to darkest, for the fit calendar */
  --wash-1: #DCE4F0;
  --wash-2: #B9C8DD;
  --wash-3: #93A9C8;
  --wash-4: #6F8AB0;
  --wash-5: #4F6B93;
  --wash-6: #34496B;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--denim); outline-offset: 3px; border-radius: 6px; }

.page { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.top .logo img { display: block; height: 34px; width: auto; }

/* Hero */
.hero { display: grid; gap: 40px; padding: 24px 0 64px; }
h1 {
  grid-column: 1 / -1;
  font-weight: 800;
  font-size: clamp(52px, 13vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
}
.hero h1 { margin-bottom: 0; }
.dot { color: var(--copper); }
h1 .line { display: block; }
.lede { font-size: 19px; max-width: 34em; margin: 0 0 14px; }
.launch { color: var(--muted); margin: 0 0 32px; }

/* Get notified: stitched like the Pull the Thread button in the app */
.notify {
  border: 2px dashed var(--copper);
  border-radius: 22px;
  padding: 22px 20px 20px;
  max-width: 460px;
}
.notify h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
.notify > p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.field input:focus { border-color: var(--denim); outline: none; box-shadow: 0 0 0 3px rgba(90,120,160,0.18); }
.notify button {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 25px;
  background: var(--deep);
  color: #FFFFFF;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.notify button:hover { background: #3B5679; }
.notify button:disabled { opacity: 0.6; cursor: default; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { margin: 12px 0 0; font-size: 15px; }
.status:empty { display: none; }
.status.error { color: var(--error); }
.notify.done .field, .notify.done button { display: none; }
.notify.done .status { font-size: 17px; font-weight: 600; margin: 4px 0 0; }

/* Fit calendar: every day you post fills in, in a different denim wash */
.calendar {
  margin: 0;
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px 18px 22px;
  max-width: 460px;
  width: 100%;
}
.cal-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.cal-month { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.cal-streak { font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.cal-streak i { width: 9px; height: 9px; border-radius: 50%; background: var(--copper); display: inline-block; }
.cal-days, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-days { margin-bottom: 8px; font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.tile { aspect-ratio: 4 / 5; border-radius: 9px; position: relative; background-image: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(16,20,28,0.06)); }
.tile.empty { border: 1.5px dashed var(--line); }
.tile.w1 { background-color: var(--wash-1); }
.tile.w2 { background-color: var(--wash-2); }
.tile.w3 { background-color: var(--wash-3); }
.tile.w4 { background-color: var(--wash-4); }
.tile.w5 { background-color: var(--wash-5); }
.tile.w6 { background-color: var(--wash-6); }
.tile.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.tile.today::after {
  content: '';
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--copper);
}
.calendar figcaption { margin-top: 16px; font-size: 15px; color: var(--muted); }

/* One moment of motion: the calendar fills in, day by day */
@media (prefers-reduced-motion: no-preference) {
  .tile { animation: fill 420ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 32ms + 250ms); }
  @keyframes fill { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: none; } }
}

/* Footer */
footer { border-top: 1px solid var(--line); padding: 26px 0 40px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; font-size: 15px; color: var(--muted); }
.foot img { height: 22px; width: auto; display: block; margin-right: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* Profile link page */
.profile { padding: 40px 0 72px; max-width: 640px; }
.profile h1 { font-size: clamp(44px, 11vw, 84px); overflow-wrap: anywhere; }
.profile .lede { margin-bottom: 14px; }

/* Privacy Policy and Terms of Use */
.legal { max-width: 720px; padding: 24px 0 72px; }
.legal h1 { font-size: clamp(34px, 8.6vw, 64px); margin-bottom: 8px; }
.legal .updated { color: var(--muted); margin: 0 0 36px; }
.legal h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 40px 0 10px; }
.legal p, .legal li { font-size: 17px; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--deep); }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; }
.legal table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.legal th { background: var(--soft); font-weight: 600; }
.legal tr:last-child td { border-bottom: 0; }
/* On phones, each table row becomes a small card instead of a squished table */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .legal table { min-width: 0; }
  .legal thead { display: none; }
  .legal tr { display: block; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
  .legal td { display: block; border: 0; padding: 0; }
  .legal td:first-child { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
  .legal td + td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 8px; }
}

@media (min-width: 900px) {
  .page { padding: 0 40px; }
  .hero { grid-template-columns: 1.1fr 0.9fr; column-gap: 64px; row-gap: 36px; align-items: start; padding: 48px 0 96px; }
  h1 .line { display: inline; }
  h1 { font-size: clamp(64px, 8.4vw, 112px); margin-bottom: 32px; }
  .calendar { justify-self: end; }
}
