/* ============================================================
   SYNORB — Shared Styles
   Design tokens, nav, footer, auth forms, theme, responsive.
   ============================================================ */

:root {
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  --h1-size: clamp(2.5rem, 5vw, 3.5rem);
  --body-size: 1.0625rem;
  --small-size: 0.9375rem;
  --micro-size: 0.8125rem;
  --mono-size: 0.75rem;
  --bg: #fafafa;
  --bg-subtle: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #484848;
  --text-tertiary: #999999;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.12);
  --accent: #1a1a1a;
  --selection-bg: rgba(0, 0, 0, 0.08);
  --error: #c33;
  --error-bg: rgba(204, 51, 51, 0.06);
  --success: #3d6b35;
  --success-bg: rgba(61, 107, 53, 0.06);
  --page-max: 960px;
  --page-pad: clamp(1.25rem, 4vw, 2.5rem);
  --ease-out-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out-gentle: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-subtle: #111111;
  --text: #ededed;
  --text-secondary: #999999;
  --text-tertiary: #666666;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --accent: #ededed;
  --selection-bg: rgba(255, 255, 255, 0.15);
  --error: #e66;
  --error-bg: rgba(238, 102, 102, 0.08);
  --success: #8b9a7b;
  --success-bg: rgba(139, 154, 123, 0.08);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { font-family: var(--font-body); font-size: var(--body-size); line-height: 1.65; color: var(--text-secondary); background: var(--bg); overflow-x: hidden; transition: background 0.3s ease, color 0.3s ease; }
::selection { background: var(--selection-bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-pad); }

/* NAV */
.site-header { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 0.375rem; font-family: "IBM Plex Sans", var(--font-body); font-size: 1.0625rem; font-weight: 600; color: var(--text); letter-spacing: 0.12em; text-transform: uppercase; }
.nav-brand svg { flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { font-size: var(--small-size); color: var(--text-tertiary); transition: color 0.2s var(--ease-out-smooth), transform 0.2s var(--ease-out-smooth); }
.nav-links a:hover { color: var(--text); transform: translateY(-1px); }
.nav-cta { font-size: var(--small-size) !important; color: var(--bg) !important; background: var(--text); padding: 0.5rem 1.125rem; border-radius: 3px; font-weight: 500; transition: opacity 0.2s var(--ease-out-smooth), transform 0.2s var(--ease-out-smooth); }
.nav-cta:hover { opacity: 0.85; transform: translateY(-1px) !important; }
.nav-menu-btn { display: none; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--text); padding: 0.5rem; min-width: 2.75rem; min-height: 2.75rem; -webkit-tap-highlight-color: transparent; }
.nav-overlay { position: fixed; inset: 0; z-index: 999; background: var(--bg); display: flex; flex-direction: column; padding: 1.5rem var(--page-pad); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.nav-overlay.open { opacity: 1; pointer-events: auto; }
.nav-overlay-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.nav-overlay-close { background: none; border: none; cursor: pointer; color: var(--text); padding: 0.25rem; -webkit-tap-highlight-color: transparent; }
.nav-overlay-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.5rem; padding: 2rem 0; }
.nav-overlay-group { display: flex; flex-direction: column; gap: 1rem; }
.nav-overlay-label { font-family: var(--font-mono); font-size: var(--mono-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.nav-overlay-group a { font-family: var(--font-display); font-size: 1.75rem; color: var(--text); line-height: 1.2; transition: color 0.15s ease; }
.nav-overlay-group a:hover { color: var(--text-secondary); }
.nav-overlay-group a.nav-overlay-cta { display: inline-block; font-family: var(--font-body); font-size: var(--body-size); font-weight: 500; color: var(--bg); background: var(--text); padding: 0.6rem 1.5rem; border-radius: 3px; margin-top: 0.5rem; width: fit-content; }

/* THEME TOGGLE */
.theme-toggle { background: none; border: 1px solid var(--line-strong); border-radius: 50%; width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-tertiary); font-size: 0.875rem; transition: color 0.2s var(--ease-out-smooth), border-color 0.2s var(--ease-out-smooth), opacity 0.2s var(--ease-out-smooth); padding: 0; line-height: 1; flex-shrink: 0; }
.theme-toggle:hover { color: var(--text); border-color: var(--text-secondary); }
.theme-toggle.switching { opacity: 0; }

/* AUTH LAYOUT */
.auth-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100dvh - 3.75rem); padding: clamp(3rem, 8vh, 6rem) 0; }
.auth-card { width: 100%; max-width: 380px; }
.auth-title { font-family: var(--font-display); font-size: var(--h1-size); font-weight: 400; color: var(--text); letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.5rem; }
.auth-subtitle { font-size: var(--small-size); color: var(--text-tertiary); margin-bottom: 2.5rem; }

/* FORM */
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { font-family: var(--font-mono); font-size: var(--mono-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.form-input { padding: 0.625rem 0; border: none; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--text); font-family: var(--font-body); font-size: var(--small-size); transition: border-color 0.2s ease; width: 100%; outline: none; }
.form-input:focus { border-bottom-color: var(--text); }
.form-input::placeholder { color: var(--text-tertiary); }
.form-input.error { border-bottom-color: var(--error); }
.form-hint { font-size: var(--mono-size); color: var(--text-tertiary); margin-top: 0.125rem; }
.btn-submit { padding: 0.7rem 1.5rem; background: var(--text); color: var(--bg); border: none; border-radius: 0; font-family: var(--font-body); font-size: var(--small-size); font-weight: 500; cursor: pointer; transition: opacity 0.2s var(--ease-out-smooth); width: 100%; min-height: 2.75rem; margin-top: 1.5rem; }
.btn-submit:hover { opacity: 0.85; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* AUTH FOOTER */
.auth-footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); text-align: center; font-size: var(--small-size); color: var(--text-tertiary); }
.auth-footer a { color: var(--text); font-weight: 500; transition: opacity 0.2s ease; }
.auth-footer a:hover { opacity: 0.7; }

/* MESSAGES */
.auth-message { padding: 0.75rem 1rem; border-radius: 3px; font-size: var(--small-size); line-height: 1.5; display: none; }
.auth-message.error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); display: block; }
.auth-message.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); display: block; }

/* HONEYPOT */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; z-index: -1; }

/* CAPTCHA */
.captcha-container { position: absolute; visibility: hidden; }

/* SITE FOOTER */
.site-footer { padding: 1.5rem 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-copy { font-size: var(--mono-size); color: var(--text-tertiary); font-family: var(--font-mono); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: var(--mono-size); color: var(--text-tertiary); transition: color 0.2s var(--ease-out-smooth); }
.footer-links a:hover { color: var(--text); }

/* A11Y */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ENTRANCE ANIMATION */
.auth-card { opacity: 0; }
.auth-card.animate { animation: dissolve-up 0.6s var(--ease-out-gentle) forwards; }
@keyframes dissolve-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVE */
@media (min-width: 1200px) { :root { --page-max: 1060px; } }
@media (max-width: 720px) {
  .nav-links > a { display: none; }
  .nav-links { gap: 0.75rem; }
  .nav-menu-btn { display: flex; }
  .auth-card { max-width: 100%; }
}
@media (max-width: 480px) {
  .nav-links { gap: 0.75rem; }
  .footer-links { gap: 1rem; }
}
