@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=DM+Sans:wght@300;400;500&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --accent: #7eb8d4;
  --text-primary: #e8e8ec;
  --text-secondary: #888896;
  --border: #1e1e2a;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.portal-shell {
  width: 100%;
  max-width: 560px;
}

/* Wordmark */

.portal-wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 3rem;
}

/* States */

.portal-state {
  display: none;
}

.portal-state.active {
  display: block;
}

/* Loading */

#state-loading p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Logged in */

#state-loggedin h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

#state-loggedin .workspace-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 1.5rem;
  margin-top: 1.75rem;
  display: block;
}

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.file-list li a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-list li a:hover {
  border-color: var(--accent);
  background: rgba(126, 184, 212, 0.04);
}

.file-list li a::after {
  content: '→';
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.file-text {
  display: flex;
  flex-direction: column;
}

.file-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-primary);
}

.file-description {
  display: block;
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.file-list-empty {
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.portal-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.portal-note a {
  color: var(--accent);
  text-decoration: none;
}

.portal-note a:hover {
  text-decoration: underline;
}

/* No match */

#state-nomatch h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

#state-nomatch p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

#state-nomatch a {
  color: var(--accent);
  text-decoration: none;
}

#state-nomatch a:hover {
  text-decoration: underline;
}

/* Debug line — remove once email detection is confirmed */
.portal-debug {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: #444455;
  font-family: monospace;
  word-break: break-all;
}

@media (max-width: 480px) {
  .portal-wordmark {
    margin-bottom: 2rem;
  }
}
