:root {
  color-scheme: light;
  --paper: #f4efe5;
  --surface: #fffdf8;
  --ink: #24211d;
  --muted: #6f675d;
  --line: rgba(65, 53, 41, 0.14);
  --accent: #9c7553;
  --danger: #8b332e;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--paper); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 253, 247, 0.98), transparent 37rem),
    linear-gradient(180deg, #f8f4eb 0%, var(--paper) 100%);
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button, input { font: inherit; }

.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 244, 235, 0.74);
  backdrop-filter: blur(18px);
}

.site-header nav,
.site-footer > div {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header nav > div,
.site-footer nav { display: flex; gap: clamp(16px, 4vw, 30px); }

.site-header nav > div a,
.site-footer a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav > div a:hover,
.site-footer a:hover { color: var(--ink); }

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.wordmark span { color: var(--accent); }

.hero { padding-block: clamp(74px, 12vw, 150px) 84px; }

.hero > h1,
.narrow > h1,
.legal > h1,
.auth-card > h1 {
  margin: 0;
  max-width: 920px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 8.4vw, 104px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.narrow > h1,
.legal > h1,
.auth-card > h1 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lede {
  max-width: 700px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.5;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.56; }
.button:focus-visible, .copy-button:focus-visible, .text-button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(156, 117, 83, 0.48);
  outline-offset: 3px;
}

.primary { background: var(--ink); color: var(--surface); }
.secondary { border-color: var(--line); background: rgba(255, 253, 248, 0.58); color: var(--ink); }
.google { width: 100%; margin-top: 18px; background: var(--surface); border-color: var(--line); color: var(--ink); }
.danger { min-height: 42px; border-color: rgba(139, 51, 46, 0.22); background: transparent; color: var(--danger); }

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: clamp(72px, 11vw, 132px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--line);
}

.privacy-grid article { min-height: 250px; padding: 32px; background: rgba(255, 253, 248, 0.82); }
.privacy-grid span, .label { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.privacy-grid h2 { margin: 48px 0 12px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.privacy-grid p, .notice, .legal p, .permission-box p { color: var(--muted); line-height: 1.65; }

.narrow, .legal { max-width: 820px; padding-block: clamp(70px, 10vw, 120px); }
.legal { max-width: 760px; }
.legal h2 { margin: 48px 0 12px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.legal p { font-size: 17px; }

.connector-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 46px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 18px 60px rgba(58, 44, 31, 0.07);
}

.connector-card > div { min-width: 0; }
.connector-card code { display: block; margin-top: 8px; overflow-wrap: anywhere; font-size: 16px; }
.copy-button { flex: 0 0 auto; min-height: 42px; border: 0; border-radius: 999px; padding: 10px 17px; background: var(--ink); color: var(--surface); font-weight: 700; cursor: pointer; }
.steps { margin: 42px 0; padding-left: 25px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.steps li + li { margin-top: 12px; }
.notice { padding: 22px 24px; border-left: 3px solid var(--accent); background: rgba(255, 253, 248, 0.68); }
.notice strong { color: var(--ink); }

.auth-shell { min-height: calc(100vh - 160px); display: grid; place-items: center; padding-block: 56px; }
.auth-card { width: min(100%, 620px); padding: clamp(28px, 6vw, 52px); border: 1px solid var(--line); border-radius: 30px; background: rgba(255, 253, 248, 0.93); box-shadow: 0 28px 90px rgba(58, 44, 31, 0.1); }
.auth-card > h1 { font-size: clamp(38px, 7vw, 62px); }
.center { text-align: center; }
.status { margin: 22px 0 0; color: var(--muted); line-height: 1.55; }
.status[role="alert"] { color: var(--danger); }
.client-row { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.client-mark { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; background: var(--ink); color: var(--surface); font: 600 24px Georgia, serif; }
.client-row h2 { margin: 4px 0 0; font-size: 22px; }
.subtle-link { display: inline-block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.permission-box { margin-top: 26px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(244, 239, 229, 0.55); }
.permission-box h3 { margin: 0; font-size: 16px; }
.permission-box ul { margin: 16px 0; padding-left: 20px; line-height: 1.7; }
.permission-box p { margin: 12px 0 0; font-size: 14px; }
.permission-box .scope-line { color: var(--accent); font-size: 12px; }
.signed-in { margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.hidden { display: none !important; }

.spinner { width: 34px; height: 34px; margin: 0 auto 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 30px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.text-button { border: 0; padding: 6px; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.grant-list { display: grid; gap: 12px; margin-top: 24px; }
.grant-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 253, 248, 0.85); }
.grant-card h2 { margin: 0; font-size: 20px; }
.grant-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer > div { min-height: 88px; color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1120px); }
  .site-header nav { min-height: 64px; }
  .site-header nav > div a:first-child { display: none; }
  .hero { padding-top: 64px; }
  .privacy-grid { grid-template-columns: 1fr; }
  .privacy-grid article { min-height: 210px; }
  .privacy-grid h2 { margin-top: 32px; }
  .connector-card { align-items: stretch; flex-direction: column; }
  .copy-button { width: 100%; }
  .auth-actions { grid-template-columns: 1fr; }
  .grant-card { align-items: stretch; flex-direction: column; }
  .grant-card .button { width: 100%; }
  .account-bar { align-items: flex-start; flex-direction: column; }
  .site-footer > div { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
