/* ========================================
   Dimitris Katsiros — Portfolio
   Dark theme, Anthropic warm aesthetic
   ======================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0D0D0D;
  --bg-elevated: #161616;
  --bg-card: #1A1A1A;
  --accent: #E8927C;
  --accent-dim: rgba(232, 146, 124, 0.15);
  --accent-glow: rgba(232, 146, 124, 0.3);
  --text: #E0E0E0;
  --text-muted: #888;
  --text-dim: #555;
  --serif: 'EB Garamond', Georgia, serif;
  --mono: 'Kode Mono', 'Courier New', monospace;
  --radius: 8px;
  --radius-lg: 16px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--accent);
  opacity: 1;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.nav-active {
  color: var(--accent);
  opacity: 1;
}

.nav-links a:hover {
  animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
  0% {
    transform: translate(0);
    text-shadow: none;
  }
  10% {
    transform: translate(-2px, 1px);
    text-shadow: 2px 0 #E8927C, -2px 0 #7CE8C4;
  }
  20% {
    transform: translate(2px, -1px);
    text-shadow: -2px 0 #E8927C, 2px 0 #7CE8C4;
  }
  30% {
    transform: translate(-1px, 0);
    text-shadow: 1px 0 #E8927C, -1px 0 #7CE8C4;
  }
  40% {
    transform: translate(1px, 1px);
    text-shadow: -1px 0 #7CE8C4;
  }
  50% {
    transform: translate(-1px, -1px);
    text-shadow: 2px 0 #E8927C;
  }
  60% {
    transform: translate(0);
    text-shadow: none;
  }
  100% {
    transform: translate(0);
    text-shadow: none;
  }
}

/* --- About Hero (bio page) --- */
.about-hero {
  padding: 160px 0 60px;
}

.about-bio-full p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  max-width: 700px;
  margin-bottom: 16px;
}

.about-bio-full p:last-child {
  margin-bottom: 0;
}

/* --- Hero tagline + CTA --- */
.hero-tagline {
  font-family: var(--mono);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.hero-cta {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border: 1px solid rgba(232, 146, 124, 0.3);
  border-radius: 24px;
  transition: background 0.2s, border-color 0.2s;
}

.hero-cta:hover {
  background: var(--accent-dim);
  border-color: rgba(232, 146, 124, 0.5);
  opacity: 1;
}

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Section --- */
.section {
  padding: 120px 0;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 60px;
}

/* --- Fade-up animation --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--accent-glow), rgba(232, 146, 124, 0.08) 50%, transparent 70%);
  filter: blur(80px);
  animation: orb-drift 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes orb-drift {
  0% {
    transform: translate(-60px, -40px) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.15);
  }
  100% {
    transform: translate(-20px, 50px) scale(0.95);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-subtitle {
  font-family: var(--mono);
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--accent);
  margin-top: 16px;
  font-weight: 400;
  letter-spacing: 0.05em;
  min-height: 1.5em;
  text-shadow: 0 0 8px rgba(232, 146, 124, 0.4), 0 0 20px rgba(232, 146, 124, 0.15);
}

.typewriter {
  border-right: none;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 0.7s step-end infinite;
  font-weight: 700;
  margin-left: 1px;
  text-shadow: 0 0 6px rgba(232, 146, 124, 0.6);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* CRT scanline overlay on hero */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.scroll-indicator {
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.scroll-indicator span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.scroll-indicator:hover span {
  color: var(--accent);
}

.scroll-indicator span.hover-text {
  display: none;
}

@media (hover: hover) {
  .scroll-indicator:hover span.default-text {
    display: none;
  }

  .scroll-indicator:hover span.hover-text {
    display: inline;
  }
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--text-dim);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

/* ========================================
   ABOUT
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-bio p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.stack-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

/* --- Pills --- */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(232, 146, 124, 0.2);
  border-radius: 20px;
  transition: background 0.2s, border-color 0.2s;
}

.pill:hover {
  background: rgba(232, 146, 124, 0.25);
  border-color: rgba(232, 146, 124, 0.4);
}

.pill-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* ========================================
   EXPERIENCE — Timeline
   ======================================== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--text-dim);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline-item:first-child .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.timeline-role {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 4px;
}

.timeline-company {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 400;
  margin-top: 2px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 500px;
}

/* ========================================
   TERMINAL OVERLAY
   ======================================== */
.terminal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.terminal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.terminal-overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.terminal-overlay-container {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 700px;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

.terminal-overlay.active .terminal-overlay-container {
  transform: translateY(0) scale(1);
}

/* Floating hint button */
.terminal-hint {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
  opacity: 0.6;
}

.terminal-hint:hover {
  border-color: rgba(232, 146, 124, 0.4);
  transform: translateY(-2px);
  opacity: 1;
}

.terminal-hint-key {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  background: rgba(232, 146, 124, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(232, 146, 124, 0.2);
}

.terminal-hint-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Hide hint when terminal is open */
.terminal-overlay.active ~ .terminal-hint {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .terminal-overlay-container {
    width: 95%;
  }

  .terminal-hint {
    bottom: 20px;
    right: 20px;
    padding: 8px 12px;
  }

  .terminal-hint-label {
    display: none;
  }
}

/* ========================================
   HIGHLIGHTS
   ======================================== */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.highlight-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.3s, transform 0.3s;
}

.highlight-card:hover {
  border-color: rgba(232, 146, 124, 0.3);
  transform: translateY(-4px);
}

.highlight-emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 12px;
}

.highlight-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.highlight-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================
   SKILLS
   ======================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.skill-group-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

/* ========================================
   PROJECTS
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color 0.3s, transform 0.3s;
}

.project-card:hover {
  border-color: rgba(232, 146, 124, 0.3);
  transform: translateY(-4px);
}

.project-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Project card clickable */
.project-card {
  cursor: pointer;
}

.project-card-more {
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  letter-spacing: 0.03em;
}

.project-card:hover .project-card-more {
  opacity: 1;
}

/* ========================================
   PROJECT MODAL
   ======================================== */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.project-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.project-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.project-modal-content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 860px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease, max-width 0.3s ease, width 0.3s ease,
              max-height 0.3s ease, border-radius 0.3s ease, padding 0.3s ease;
}

.project-modal.active .project-modal-content {
  transform: translateY(0) scale(1);
}

/* Full page mode */
.project-modal.fullpage .project-modal-content {
  width: 100%;
  max-width: 100%;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
  padding: 48px 10vw;
}

.project-modal.fullpage .project-modal-backdrop {
  background: var(--bg);
}

/* Header bar with close + expand buttons */
.project-modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
}

.project-modal-close,
.project-modal-expand {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}

.project-modal-close {
  font-size: 24px;
}

.project-modal-close:hover,
.project-modal-expand:hover {
  color: var(--accent);
}

/* Back button in full page mode */
.project-modal-back {
  display: none;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 14px;
  margin-bottom: 24px;
  transition: color 0.2s, border-color 0.2s;
}

.project-modal-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.project-modal.fullpage .project-modal-back {
  display: inline-flex;
}

/* Modal content styling */
.project-detail-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.project-detail-tagline {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 24px;
}

.project-detail-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 24px;
}

.project-detail-desc p {
  margin-bottom: 12px;
}

.project-detail-section {
  margin-bottom: 24px;
}

.project-detail-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.project-detail-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.project-detail-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding: 8px 18px;
  border: 1px solid rgba(232, 146, 124, 0.3);
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.project-detail-link:hover {
  background: var(--accent-dim);
  border-color: rgba(232, 146, 124, 0.5);
  opacity: 1;
}

/* Screenshots placeholder */
.project-detail-screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.project-detail-screenshot {
  min-width: 200px;
  height: 130px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Scrollbar for modal */
.project-modal-content::-webkit-scrollbar {
  width: 6px;
}

.project-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.project-modal-content::-webkit-scrollbar-thumb {
  background: rgba(232, 146, 124, 0.2);
  border-radius: 3px;
}

@media (max-width: 768px) {
  .project-modal-content {
    width: 95%;
    padding: 28px 20px;
    max-height: 90vh;
  }
  .project-modal.fullpage .project-modal-content {
    padding: 32px 20px;
  }
}

/* ========================================
   CONTACT
   ======================================== */
.contact {
  text-align: center;
  padding-bottom: 80px;
}

.contact-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.contact-email {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.contact-email:hover {
  border-bottom-color: var(--accent);
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-link {
  color: var(--text-muted);
  transition: color 0.2s;
}

.social-link:hover {
  color: var(--accent);
  opacity: 1;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .section {
    padding: 80px 0;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-orb {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .container {
    padding: 0 16px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .timeline {
    padding-left: 28px;
  }
}

/* ========================================
   ARCHITECTURE DIAGRAMS (Mermaid)
   ======================================== */
.project-detail-architecture {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(232, 146, 124, 0.05);
  border: 1px solid rgba(232, 146, 124, 0.15);
  border-radius: 8px;
  overflow-x: auto;
}

.project-detail-architecture .mermaid {
  display: flex;
  justify-content: center;
  min-height: 60px;
}

.project-detail-architecture .mermaid svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .project-detail-architecture {
    padding: 0.75rem;
  }
}
