/* Base styles for the 3D entrance and the text-only portfolio.
   Desktop styles live in desktop.css. */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
#webgl {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #20372f;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #3a3a3a;
  border-top-color: #e8e8e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: #a3a3a3;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  letter-spacing: 0.04em;
}

/* ========== Fast Mode controls ========== */
.fast-mode-btn {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 10001;
  padding: 10px 18px;
  background: #111;
  color: #f5f5f5;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-weight: 500;
  opacity: 1;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.fast-mode-btn:hover {
  background: #222;
}

.fast-mode-scroll-indicator {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #f5f5f5;
  background: #111;
  border: 1px solid #333;
  display: none;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

/* ========== Fast Mode overlay ========== */
.fast-mode {
  --fm-bg: #fafafa;
  --fm-text: #141414;
  --fm-muted: #5c5c5c;
  --fm-border: #dcdcdc;
  --fm-link: #0b3d2e;

  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow-y: auto;
  background: var(--fm-bg);
  color: var(--fm-text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  line-height: 1.55;
}

.fm-exit {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 1100;
  background: var(--fm-bg);
  color: var(--fm-text);
  border: 1px solid var(--fm-border);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
}

.fm-exit:hover {
  background: #efefef;
}

.fm-ready {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  z-index: 1150;
  align-items: center;
  gap: 12px;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 10px 12px;
  color: #f5f5f5;
  font-size: 13px;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.fm-ready-btn {
  border: 1px solid #555;
  background: transparent;
  color: #f5f5f5;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.fm-ready-btn:hover {
  background: #222;
}

.fm-header {
  padding: 72px 40px 36px;
  border-bottom: 1px solid var(--fm-border);
  max-width: 720px;
  margin: 0 auto;
}

.fm-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fm-text);
}

.fm-tagline {
  margin: 10px 0 0;
  font-size: 1.05rem;
  color: var(--fm-muted);
  font-weight: 400;
}

.fm-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.fm-section {
  margin-bottom: 56px;
}

.fm-section h2 {
  margin: 0 0 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fm-muted);
}

.fm-section > p {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--fm-text);
}

.fm-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--fm-border);
}

.fm-meta dt {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fm-muted);
  margin-bottom: 4px;
}

.fm-meta dd {
  margin: 0;
  font-size: 0.95rem;
}

.fm-meta a,
.fm-section a {
  color: var(--fm-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fm-meta a:hover,
.fm-section a:hover {
  color: var(--fm-text);
}

.fm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.fm-list > li {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--fm-border);
}

.fm-list > li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fm-list h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.fm-list h3 a {
  color: inherit;
  text-decoration: none;
}

.fm-list h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fm-meta-line {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--fm-muted);
}

.fm-list > li > p:not(.fm-meta-line) {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.fm-list > li > ul {
  margin: 8px 0 0;
  padding-left: 1.15rem;
  color: var(--fm-text);
  font-size: 0.95rem;
}

.fm-list > li > ul li {
  margin: 4px 0;
}

.fm-plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.95rem;
}

.fm-plain-list strong {
  font-weight: 600;
}

.fm-skills {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fm-skills dt {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fm-muted);
  margin-bottom: 4px;
}

.fm-skills dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--fm-text);
}

.fm-resume {
  margin-bottom: 0;
  padding-top: 8px;
}

.fm-resume-link {
  display: inline-block;
  padding: 10px 16px;
  background: #141414;
  color: #fafafa !important;
  text-decoration: none !important;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}

.fm-resume-link:hover {
  background: #2a2a2a;
  color: #fafafa !important;
}

@media (max-width: 640px) {
  .fm-header,
  .fm-main {
    padding-left: 24px;
    padding-right: 24px;
  }

  .fm-meta {
    grid-template-columns: 1fr;
  }
}
