/* ===== Design Tokens ===== */
:root {
  --bg: #f2f2f3;
  --surface: #ffffff;
  --text: #18181b;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --border: #e4e4e7;
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --brand: #075488;
}

[data-theme="dark"] {
  --bg: #131313;
  --surface: #1e1e1e;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border: #2e2e2e;
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== Auth Gate ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s;
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 340px;
  padding: 36px;
  text-align: center;
}

.auth-logo-wrap {
  margin-bottom: 20px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: var(--brand);
}

.auth-button {
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-button:hover {
  background: #064370;
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  font-size: 13px;
  color: #ef4444;
  min-height: 18px;
}

/* ===== Dock ===== */
#mainContent {
  animation: fadeIn 0.4s ease;
}

.dock {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.dock-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.dock-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.dock-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* Grid */
.dock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 40px;
  justify-items: center;
  max-width: 480px;
}

/* Tile */
.dock-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dock-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--text);
}

[data-theme="dark"] .dock-icon {
  background: var(--tint-dark);
}

.dock-icon svg {
  width: 28px;
  height: 28px;
}

.dock-tile:hover .dock-icon {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.dock-tile:active .dock-icon {
  transform: translateY(-1px) scale(0.97);
  box-shadow: none;
}

.dock-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.dock-tile:hover .dock-name {
  color: var(--text);
}

/* Footer */
.dock-footer {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  gap: 4px;
}

.dock-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.dock-footer-btn:hover {
  color: var(--text);
  background: var(--surface);
}

/* Theme toggle icons */
.icon-sun { display: block; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ===== Scroll Indicator ===== */
.scroll-indicator {
  margin-top: 48px;
  color: var(--text-tertiary);
  animation: bounce 2s ease infinite;
  transition: opacity 0.4s ease;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== Projects Section ===== */
.projects-section {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

.projects-heading {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.projects-subheading {
  font-size: 15px;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 48px;
}

/* Project Cards */
.project-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  border-left: 3px solid var(--accent-solid);
  transition: box-shadow 0.2s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.project-card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

[data-theme="dark"] .project-card-icon {
  background: var(--accent-dark);
}

.project-card-icon svg {
  width: 22px;
  height: 22px;
}

.project-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.project-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tech Badges */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tech-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

[data-theme="dark"] .tech-badge {
  background: #262626;
}

/* Features List */
.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.features-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.features-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-solid);
  opacity: 0.6;
}

/* Card Footer */
.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.arch-note {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

.project-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.2s;
}

.project-link:hover {
  opacity: 0.7;
}

/* Infrastructure */
.projects-infra {
  margin-top: 48px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.infra-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  text-align: center;
}

.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.infra-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.infra-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.infra-value {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .dock-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 32px;
  }

  .dock-icon {
    width: 54px;
    height: 54px;
  }

  .dock-icon svg {
    width: 24px;
    height: 24px;
  }

  .dock-header {
    margin-bottom: 36px;
  }

  .project-card {
    padding: 20px;
  }

  .project-card-header {
    gap: 12px;
  }

  .project-card-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .project-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .infra-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-section {
    padding: 60px 16px 40px;
  }
}

@media (max-width: 340px) {
  .dock-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .infra-grid {
    grid-template-columns: 1fr;
  }
}
