/* ============================================
   DR. JOHNNA TOOL SUITE
   Light style: #FEFCF9 bg · #202020 text · #53C5B3 teal
   DM Serif Display + Switzer
   ============================================ */

:root {
  --bg:           #FEFCF9;
  --text:         #202020;
  --text-muted:   #7A7A72;
  --teal:         #53C5B3;
  --teal-hover:   #3AADA0;
  --border:       #E8E5DF;
  --card-bg:      #FFFFFF;
  --shadow-hover: 0 4px 12px rgba(32,32,32,0.08), 0 12px 28px rgba(32,32,32,0.07);
  --radius:       12px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width:    1080px;
  --amber:        #E09A00;
  --amber-bg:     #FEF5E4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); min-height: 100vh; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============ GATE ============ */

.gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 2rem; transition: opacity 0.35s ease; }
.gate-exit { opacity: 0; pointer-events: none; }
.gate-inner { width: 100%; max-width: 420px; text-align: center; }

.gate-eyebrow { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin-bottom: 1.5rem; }
.gate-title { font-family: var(--font-display); font-size: clamp(2.25rem, 7vw, 3rem); font-weight: 400; line-height: 1.1; color: var(--text); margin-bottom: 1rem; }
.gate-lede { font-size: 0.9375rem; line-height: 1.65; color: var(--text-muted); margin: 0 auto 2.25rem; max-width: 320px; }

.gate-form { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.875rem; }
.gate-input { width: 100%; padding: 0.875rem 1.25rem; font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 8px; outline: none; transition: border-color 0.2s; text-align: center; }
.gate-input:focus { border-color: var(--teal); }
.gate-input::placeholder { color: #B8B5AE; }

.gate-button { width: 100%; padding: 0.875rem 1.5rem; font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.02em; color: #FEFCF9; background: var(--text); border: none; border-radius: 8px; cursor: pointer; transition: background 0.15s, transform 0.1s; }
.gate-button:hover { background: #333; }
.gate-button:active { transform: scale(0.99); }

.gate-error { font-size: 0.875rem; color: #C0392B; margin-bottom: 0.875rem; }
.gate-note { font-size: 0.8125rem; color: var(--text-muted); }
.gate-join { color: var(--teal); text-decoration: none; font-weight: 600; transition: color 0.15s; }
.gate-join:hover { color: var(--teal-hover); }

/* ============ HEADER ============ */

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.portal { animation: fadeIn 0.4s ease forwards; }

.portal-header { position: sticky; top: 0; z-index: 10; background: rgba(254,252,249,0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 0 2rem; }
.portal-header-inner { max-width: var(--max-width); margin: 0 auto; height: 58px; display: flex; align-items: center; justify-content: space-between; }
.brand-mark { font-family: var(--font-body); font-style: normal; font-weight: 700; font-size: 0.9375rem; letter-spacing: 0.08em; color: var(--text); text-decoration: none; }
.brand-mark:hover { color: var(--teal); transition: color 0.15s; }
.portal-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }

/* ============ MAIN ============ */

.portal-main { max-width: var(--max-width); margin: 0 auto; padding: 2rem 2rem 6rem; }
.portal-intro { padding: 3rem 0 2.5rem; border-bottom: 1px solid var(--border); margin-bottom: 4.5rem; }
.portal-intro-text { font-size: 1rem; line-height: 1.7; color: var(--text-muted); max-width: 520px; }

/* ============ PHASES ============ */

.phase { margin-bottom: 5.5rem; }
.phase-header { margin-bottom: 2.25rem; }
.phase-meta { display: flex; align-items: flex-start; gap: 1.5rem; }

.phase-number { font-family: var(--font-display); font-size: 4rem; font-weight: 400; line-height: 1; color: var(--teal); opacity: 0.55; flex-shrink: 0; margin-top: -0.375rem; user-select: none; }
.phase-number-dim { opacity: 0.2; }
.phase-title-block { padding-top: 0.25rem; }
.phase-title { font-family: var(--font-display); font-size: 1.875rem; font-weight: 400; color: var(--text); margin-bottom: 0.5rem; line-height: 1.2; }
.phase-title-dim { color: var(--text-muted); }
.phase-desc { font-size: 0.9375rem; line-height: 1.65; color: var(--text-muted); max-width: 500px; }

/* ============ CARDS ============ */

.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.125rem; }

.tool-card { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.375rem; transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; }
.tool-card:not(.tool-card-soon):hover { box-shadow: var(--shadow-hover); border-color: #D5D2CB; transform: translateY(-2px); }
.tool-card-soon { opacity: 0.5; }
.tool-card-top { flex: 1; }
.tool-card-name-row { display: flex; align-items: flex-start; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.625rem; }
.tool-name { font-size: 0.9375rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.tool-desc { font-size: 0.875rem; line-height: 1.65; color: var(--text-muted); }

/* ============ BADGES ============ */

.badge { display: inline-block; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.03em; padding: 0.2rem 0.5rem; border-radius: 4px; white-space: nowrap; flex-shrink: 0; line-height: 1.4; }
.badge-refresh { background: var(--amber-bg); color: var(--amber); }
.badge-soon { background: #F0EEE9; color: #999490; }

/* ============ LINKS ============ */

.tool-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.875rem; font-weight: 600; color: var(--teal); text-decoration: none; transition: color 0.15s; }
.tool-link .arrow { display: inline-block; transition: transform 0.2s; }
.tool-link:hover { color: var(--teal-hover); }
.tool-link:hover .arrow { transform: translateX(3px); }
.tool-link-disabled { font-size: 0.875rem; font-weight: 500; color: #B8B5AE; cursor: default; }

/* ============ FOOTER ============ */

.portal-footer { border-top: 1px solid var(--border); padding: 0 2rem; }
.portal-footer-inner { max-width: var(--max-width); margin: 0 auto; height: 52px; display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; color: var(--text-muted); }
.footer-link { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.footer-link:hover { color: var(--text); }

/* ============ RESPONSIVE ============ */

@media (max-width: 680px) {
  .tools-grid { grid-template-columns: 1fr; }
  .phase-number { font-size: 2.75rem; }
  .phase-title { font-size: 1.5rem; }
  .portal-main { padding: 0 1.25rem 5rem; }
  .portal-header, .portal-footer { padding: 0 1.25rem; }
  .portal-intro { padding: 2.5rem 0 2rem; margin-bottom: 3.5rem; }
  .phase { margin-bottom: 4rem; }
}
