/* === Fractal Portfolio — Light Mode === */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');


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

:root {
  /* Site is light-only; opt out of browser forced/auto dark mode */
  color-scheme: only light;

  --bg: #faf9f7;
  --bg-panel: rgba(255, 255, 255, 0.88);
  --text: #2a2a2a;
  --text-muted: #777;
  --accent: #5a5045;
  --accent-hover: #3d352d;
  --border: rgba(120, 110, 95, 0.15);
  --border-hover: rgba(90, 80, 69, 0.3);
  --tag-color: #8a7d6f;
  --canvas-opacity: 1;
  --canvas-filter: none;
  --nav-bg: rgba(250, 249, 247, 0.7);
  --nav-bg-scrolled: rgba(250, 249, 247, 0.92);
  --footer-muted: rgba(42, 42, 42, 0.35);

  transition: --canvas-opacity 0.6s, background 0.6s;
}

/* "Lighter" mode — everything gets even lighter */
body.lighter {
  --bg: #ffffff;
  --bg-panel: rgba(255, 255, 255, 0.95);
  --text: #3d3d3d;
  --text-muted: #888;
  --accent: #6d6256;
  --accent-hover: #5a5045;
  --border: rgba(160, 150, 135, 0.15);
  --border-hover: rgba(138, 125, 111, 0.3);
  --tag-color: #9a8e80;
  --canvas-opacity: 0.35;
  --canvas-filter: none;
  --nav-bg: rgba(255, 255, 255, 0.7);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.92);
  --footer-muted: rgba(60, 60, 60, 0.35);
}

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s, color 0.5s;
}

/* === Fractal Canvas === */
#fractal-canvas {
  position: fixed;
  top: 0; left: 0;
  z-index: 0;
  opacity: var(--canvas-opacity);
  filter: var(--canvas-filter);
  transition: opacity 0.6s, filter 0.6s;
}

/* === Content Layer === */
.content-layer {
  position: relative;
  z-index: 1;
}

/* === Navigation === */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s;
}

nav.scrolled { background: var(--nav-bg-scrolled); }

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 2px;
}

.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; list-style: none; }

.nav-links a { white-space: nowrap; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; }

/* === Mode Toggle === */
.mode-toggle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.mode-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-toggle.toggle-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(90, 80, 69, 0.08);
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1rem;
  text-shadow: 0 1px 12px rgba(250,249,247,0.95), 0 0 50px rgba(250,249,247,0.85), 0 0 80px rgba(250,249,247,0.7);
}

.hero-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(250,249,247,0.95), 0 0 40px rgba(250,249,247,0.85), 0 0 70px rgba(250,249,247,0.7);
  background: rgba(255, 255, 255, 0.65);
  padding: 0.35em 0.7em;
  border-radius: 4px;
}

.hero-hint {
  position: absolute;
  bottom: 2.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.4;
  animation: pulse-fade 3s ease-in-out infinite;
}

@keyframes pulse-fade {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.5; transform: translateY(-4px); }
}

/* === Panels (content cards) === */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3rem 3.5rem;
  max-width: 780px;
  margin: 0 auto 4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}

.panel h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.panel h2::before {
  content: '';
  display: inline-block;
  width: 20px; height: 1px;
  background: var(--accent);
}

.panel p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.panel a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s, color 0.3s;
}

.panel a:hover { border-color: var(--accent); color: var(--accent-hover); }

/* === Section spacing === */
.section { padding: 6rem 2rem; }

/* A panel that ends its section shouldn't add bottom margin —
   keeps the divider centered between sections. */
.section > .panel:last-child { margin-bottom: 0; }

/* === Sierpinski Divider === */
.zh-divider { margin: 2rem auto; max-width: 600px; }

/* === Project Cards === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 780px;
  margin: 0 auto;
}

.project-card {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem 2.2rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.4s, transform 0.4s, box-shadow 0.4s;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.project-card .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--tag-color);
  margin-bottom: 0.8rem;
  display: block;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Reveal animation === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* === Footer === */
footer {
  text-align: center;
  padding: 3rem 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--footer-muted);
  letter-spacing: 1px;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.8rem;
  transition: color 0.3s;
}

footer a:hover { color: var(--accent); }

/* === Detail Page === */
.detail-hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 2rem 4rem;
  text-align: center;
}

.detail-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 8px rgba(250,249,247,0.9), 0 0 40px rgba(250,249,247,0.8);
}

.detail-hero .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--tag-color);
  text-shadow: 0 1px 8px rgba(250,249,247,0.9), 0 0 40px rgba(250,249,247,0.8);
}

.detail-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.detail-content .panel { margin-bottom: 2rem; }

/* === Album Grid (photos hub) === */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem;
}

.album-card {
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.4s;
}

.album-card:hover { transform: translateY(-4px); }

.album-cover {
  aspect-ratio: 3/2;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: border-color 0.4s;
}

.album-card:hover .album-cover { border-color: var(--border-hover); }

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}

.album-card:hover .album-cover img { transform: scale(1.03); }

.album-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  text-shadow: 0 1px 8px rgba(250,249,247,0.9), 0 0 40px rgba(250,249,247,0.8);
}

.album-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-shadow: 0 1px 8px rgba(250,249,247,0.9), 0 0 40px rgba(250,249,247,0.8);
}

/* === Photo Gallery (album page) === */
.photo-list {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.photo-item { }

.photo-item img {
  width: 100%;
  border-radius: 4px;
  display: block;
  border: 1px solid var(--border);
}

.photo-item figcaption {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
  text-shadow: 0 1px 8px rgba(250,249,247,0.9), 0 0 40px rgba(250,249,247,0.8);
}

/* === Back link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  transition: color 0.3s;
  text-shadow: 0 1px 8px rgba(250,249,247,0.9), 0 0 40px rgba(250,249,247,0.8);
}

.back-link:hover { color: var(--accent); }

/* === Tags list === */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-top: 1rem;
}

.tag-list li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  transition: border-color 0.3s;
}

/* === Responsive === */
@media (max-width: 768px) {
  html { scroll-padding-top: 9rem; }
  nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
  }
  .nav-left {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links { gap: 1.5rem; }
  .nav-links a { font-size: 0.78rem; }
  .panel { padding: 2rem 1.5rem; margin-left: 1rem; margin-right: 1rem; }
  .project-grid { grid-template-columns: 1fr; margin: 0 1rem; }
  .album-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .photo-list { padding: 0 1rem; }
  .hero-hint { display: none; }
  .section { padding: 4rem 1rem; }
  .mode-toggle { font-size: 0.6rem; padding: 0.3rem 0.7rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.5rem; }
  .nav-logo { font-size: 1.1rem; }
}
