/* WYDAI Team Tools hub. Palette is fixed: black, white, gold; red accents only. */

:root {
  --ink: #0a0a0a;
  --ink-2: #141414;
  --ink-3: #1f1f1f;
  --line-dark: #2a2a2a;
  --paper: #ffffff;
  --paper-2: #f6f5f2;
  --line: #e4e1d8;
  --text: #111111;
  --muted: #6b6b6b;
  --gold: #c9a84c;
  --gold-light: #e3c877;
  --gold-dark: #9e7f2f;
  --red: #c8102e;
  --red-dark: #9b0c23;

  --input-line: #8f8a7d;
  --on-dark-muted: #b3b3b3;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .05), 0 2px 6px rgba(10, 10, 10, .06);
  --shadow-md: 0 6px 16px rgba(10, 10, 10, .08), 0 16px 40px rgba(10, 10, 10, .10);
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 400 16px/1.6 var(--font-ui);
  color: var(--text);
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
code { font-size: .9em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; }

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

/* Focus: gold ring on black, darker gold on white (keeps 3:1 against the surface). */
:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 3px; border-radius: 4px; }
.surface-dark :focus-visible { outline-color: var(--gold); }
.surface-light :focus-visible { outline-color: var(--gold-dark); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--gold); color: var(--ink); font-weight: 600; padding: 10px 16px; border-radius: var(--radius); text-decoration: none;
}
.skip-link:focus { top: 12px; outline: 3px solid var(--paper); }

.icon { width: 24px; height: 24px; flex: none; }
.icon--sm { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- wordmark */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-decoration: none;
}
.wordmark__text { margin-right: -.08em; }
.wordmark::after { content: ""; display: block; width: 1.2em; height: 2px; margin-top: .28em; background: var(--red); }
.wordmark--on-dark { color: var(--gold); }
.wordmark--on-light { color: var(--ink); }
.wordmark--sm { font-size: 1.375rem; }
.wordmark--md { font-size: 1.75rem; }
.wordmark--xl { font-size: clamp(3rem, 12vw, 5.5rem); }
a.wordmark:hover { color: var(--gold-light); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: .625rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius);
  font: 600 .9375rem/1.2 var(--font-ui); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn .icon { width: 18px; height: 18px; }
.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn--gold:active { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn--ghost-dark { background: transparent; border-color: #3a3a3a; color: var(--paper); }
.btn--ghost-dark:hover { border-color: var(--gold); color: var(--gold-light); }
.btn--sm { min-height: 40px; padding: .5rem .875rem; font-size: .875rem; }
.btn--lg { min-height: 52px; padding: .875rem 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }

.link-on-dark { display: inline-flex; align-items: center; gap: .45em; color: var(--on-dark-muted); font-size: .875rem; font-weight: 500; text-decoration: none; }
.link-on-dark .icon { width: 18px; height: 18px; }
.link-on-dark:hover { color: var(--gold-light); }

.eyebrow {
  display: flex; align-items: center; gap: .75em;
  font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-light);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--red); }
.eyebrow--on-light { color: var(--text); }

/* ------------------------------------------------------------------ header */
.site-header { background: var(--ink); border-bottom: 1px solid var(--line-dark); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.site-header__actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inline-form { margin: 0; }

.user-chip { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--paper); font-size: .9375rem; font-weight: 500; }
.user-chip__avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--gold); border-radius: 50%; background: var(--ink-3);
  color: var(--gold); font-size: .8125rem; font-weight: 600; letter-spacing: .04em;
}
.user-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--paper);
  padding-block: clamp(64px, 12vw, 128px) clamp(56px, 10vw, 112px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 70% at 88% 0%, rgba(201, 168, 76, .16), transparent 62%),
    radial-gradient(40% 55% at 0% 100%, rgba(201, 168, 76, .07), transparent 70%);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(201, 168, 76, .45), transparent); }
.hero__inner { position: relative; }
.hero .eyebrow { margin-top: clamp(32px, 6vw, 48px); }
.hero__title {
  margin: 16px 0 16px; max-width: 18ch;
  font-family: var(--font-head); font-weight: 600; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.12;
  color: var(--paper);
}
.hero__lead { max-width: 56ch; font-size: clamp(1.0625rem, 2.2vw, 1.25rem); color: var(--on-dark-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__note { margin-top: 16px; font-size: .875rem; color: #8f8f8f; }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(48px, 8vw, 88px); background: var(--paper-2); }
.section--tools { padding-block: clamp(32px, 6vw, 56px) clamp(56px, 8vw, 88px); }
.section__head { max-width: 640px; margin-bottom: 32px; }
.section__title { margin: 0 0 8px; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.625rem, 3.5vw, 2.25rem); line-height: 1.2; color: var(--ink); }
.section__lead { color: var(--muted); }

.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card-grid > li { display: flex; }

.icon-tile { display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: var(--radius); background: var(--ink); color: var(--gold); }

.feature { flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.feature__title { margin: 20px 0 8px; font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; line-height: 1.3; color: var(--ink); }
.feature__text { color: var(--muted); font-size: .9375rem; }

/* ----------------------------------------------------------------- welcome */
.welcome { background: var(--ink); color: var(--paper); padding-block: clamp(36px, 7vw, 64px); position: relative; }
.welcome::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(201, 168, 76, .45), transparent); }
.welcome__title { margin: 12px 0 6px; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.75rem, 4.5vw, 2.75rem); line-height: 1.15; overflow-wrap: anywhere; }
.welcome__lead { color: var(--on-dark-muted); }

/* -------------------------------------------------------------- tool cards */
.tool-group + .tool-group { margin-top: 44px; }
.tool-group__title {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px;
  font: 600 .8125rem/1.2 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.tool-group__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.tool-card {
  position: relative; flex: 1; display: flex; flex-direction: column;
  min-height: 230px; padding: 24px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold); }
a.tool-card:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.tool-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tool-card__name { display: block; margin: 18px 0 6px; font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; line-height: 1.3; color: var(--ink); }
.tool-card__desc { display: block; color: var(--muted); font-size: .9375rem; }
.tool-card__note { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .8125rem; font-weight: 500; color: var(--text); }
.tool-card__note::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--red); }
.tool-card__meta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .8125rem; color: var(--muted); }
.tool-card__meta .icon { width: 14px; height: 14px; }
.tool-card__cta { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 20px; font-weight: 600; font-size: .9375rem; color: var(--ink); }
.tool-card__cta .icon { transition: transform .15s ease; }
a.tool-card:hover .tool-card__cta .icon { transform: translateX(3px); }
.tool-card--coming-soon { background: transparent; border-style: dashed; border-color: #cfcabd; box-shadow: none; }
.tool-card--coming-soon .icon-tile { background: var(--ink-3); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.badge--live { background: var(--ink); color: var(--paper); }
.badge--live::before { background: var(--gold); }
.badge--review { background: var(--paper); color: var(--text); border: 1px solid var(--gold-dark); }
.badge--review::before { background: var(--gold-dark); }
.badge--coming-soon { background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); }
.badge--coming-soon::before { background: #a8a399; }

.empty { color: var(--muted); }

/* -------------------------------------------------------------------- auth */
.auth {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(32px, 8vw, 88px) 16px;
  background: var(--ink);
}
.auth::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(50% 60% at 50% 0%, rgba(201, 168, 76, .12), transparent 70%); }
.auth-card {
  position: relative; width: 100%; max-width: 440px;
  padding: clamp(24px, 6vw, 40px);
  background: var(--paper); border-radius: var(--radius); border-top: 3px solid var(--gold);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
.auth-card__title { margin: 12px 0 8px; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.625rem, 5vw, 2rem); line-height: 1.2; color: var(--ink); }
.auth-card .eyebrow + .auth-card__title { margin-top: 12px; }
.auth-card__title:first-child { margin-top: 0; }
.auth-card__lead { margin-bottom: 24px; color: var(--muted); font-size: .9375rem; }
.auth-card__lead strong { color: var(--text); }
.auth-card__alt { margin-top: 16px; text-align: center; font-size: .875rem; }
.auth__help { position: relative; margin-top: 20px; font-size: .875rem; color: var(--on-dark-muted); text-align: center; }

.form { margin: 0; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; color: var(--text); }
.input {
  width: 100%; min-height: 48px; padding: .625rem .875rem;
  font: 400 1rem/1.4 var(--font-ui); color: var(--text);
  background: var(--paper); border: 1px solid var(--input-line); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:hover { border-color: var(--text); }
.input:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(201, 168, 76, .55); }
.input[aria-invalid="true"] { border-color: var(--red); }
.field + .btn { margin-top: 6px; }

.alert { margin-bottom: 20px; padding: 12px 14px; border-radius: var(--radius); font-size: .9375rem; line-height: 1.45; }
.alert--error { background: #fdf2f4; color: var(--red-dark); border: 1px solid #f0c4cc; border-left: 3px solid var(--red); }
.alert--info { background: var(--paper-2); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--gold-dark); }

.alert--success { background: var(--paper); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.field__hint { margin-top: 6px; font-size: .8125rem; color: var(--muted); }
.field__error { margin-top: 6px; font-size: .8125rem; font-weight: 500; color: var(--red-dark); }

/* ------------------------------------------------------------------- admin */
.welcome__back { margin-top: 18px; }
.section--admin { padding-block: clamp(28px, 5vw, 48px) clamp(56px, 8vw, 88px); }
.admin-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-bottom: 20px; }
.panel { min-width: 0; padding: clamp(20px, 3vw, 28px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 20px; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.panel__title { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.panel__lead { margin-bottom: 18px; color: var(--muted); font-size: .9375rem; }
.panel__meta { font-size: .8125rem; color: var(--muted); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: .9375rem; }
.admin-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.admin-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.cell-name { font-weight: 600; color: var(--ink); }
.cell-email { overflow-wrap: anywhere; }
.cell-muted { color: var(--muted); white-space: nowrap; font-size: .875rem; }
.tag-you { margin-left: 6px; font-size: .75rem; font-weight: 500; color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; max-width: 360px; }
.row-details { flex-basis: 100%; }
.row-details summary { padding: 4px 0; cursor: pointer; font-size: .8125rem; font-weight: 600; color: var(--text); }
.row-details[open] summary { margin-bottom: 8px; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.inline-fields .input { flex: 1 1 180px; width: auto; min-height: 36px; font-size: .875rem; }

.btn--outline { background: var(--paper); border-color: var(--input-line); color: var(--text); }
.btn--outline:hover { background: var(--paper-2); border-color: var(--gold-dark); }
.btn--danger { background: var(--paper); border-color: #e3a9b3; color: var(--red-dark); }
.btn--danger:hover { background: #fdf2f4; border-color: var(--red); }
.btn--xs { min-height: 34px; padding: .375rem .7rem; font-size: .8125rem; }

.badge--admin { background: var(--ink); color: var(--gold-light); }
.badge--admin::before { background: var(--gold); }
.badge--member { background: var(--paper-2); color: var(--text); border: 1px solid var(--line); }
.badge--member::before { background: #a8a399; }
.badge--disabled { background: #fdf2f4; color: var(--red-dark); border: 1px solid #f0c4cc; }
.badge--disabled::before { background: var(--red); }

.audit-list { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.audit-list li { display: grid; grid-template-columns: 12rem 1fr; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.audit-list li:last-child { border-bottom: 0; }
.audit-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-list span { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ footer */
.site-footer { flex-shrink: 0; background: var(--ink); border-top: 1px solid var(--line-dark); color: #8f8f8f; font-size: .8125rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 28px; }
.site-footer .wordmark--sm { font-size: 1.125rem; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 560px) {
  .user-chip__name { display: none; }
  .site-header__inner { min-height: 64px; }
  .link-on-dark span { font-size: .8125rem; }
  .hero__actions .btn { width: 100%; }
  .feature, .tool-card { padding: 20px; }
  .site-header__actions .btn span { display: none; }
  .audit-list li { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  a.tool-card:hover { transform: none; }
}
