/* ============================================
   compis web design — stylesheet
   Modern Minimalist · DM Serif Display + DM Sans
   ============================================ */

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

:root {
  --black:    #0e0e0e;
  --white:    #fafaf8;
  --gray-50:  #f5f4f1;
  --gray-100: #e8e7e3;
  --gray-300: #b8b7b2;
  --gray-500: #7a7975;
  --gray-700: #3c3c3a;
  --accent:   #1a1a1a;
  --green:    #22c55e;
  --blue:     #3b82f6;
  --amber:    #f59e0b;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--black);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ============ NAV ============ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 4rem;
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#nav.scrolled {
  border-bottom-color: var(--gray-100);
  box-shadow: 0 1px 20px rgba(0,0,0,0.05);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--black);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--gray-500); font-size: 1.1rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--black); }

.nav-cta {
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 0.55rem 1.4rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.nav-cta:hover { background: var(--gray-700); transform: translateY(-1px); }

/* ============ HERO ============ */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 8rem 4rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-tag {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  border: 1px solid var(--gray-100);
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 1.5rem;
}
.hero-title em {
  font-style: italic;
  color: var(--gray-500);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 440px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
  border: 1.5px solid var(--black);
  border-radius: 100px;
  padding: 0.75rem 1.8rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover { background: var(--gray-700); border-color: var(--gray-700); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-300);
  border-radius: 100px;
  padding: 0.75rem 1.8rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover { border-color: var(--black); transform: translateY(-2px); }

.btn-full { width: 100%; }

/* Hero visual */
.hero-visual {
  position: relative;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.code-window {
  position: absolute;
  width: 190px;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  font-size: 9.5px;
  line-height: 1.6;
  z-index: 1;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.code-dots {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #2a2a2a;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.code-lines {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.code-line {
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.code-line.visible {
  opacity: 1;
  transform: translateX(0);
}

.ln { color: #444; min-width: 14px; text-align: right; user-select: none; }
.kw { color: #c792ea; }
.fn { color: #82aaff; }
.st { color: #c3e88d; }
.cm { color: #546e7a; font-style: italic; }
.pu { color: #89ddff; }
.tx { color: #cdd3de; }

.hero-card {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 120px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  animation: float 4s ease-in-out infinite;
  z-index: 3;
}
.hero-card span {
  font-size: 0.7rem;
  color: var(--gray-500);
  font-weight: 400;
}
.hero-card strong {
  font-size: 1.3rem;
  font-weight: 500;
  font-family: var(--serif);
  color: var(--black);
}
.card-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-bottom: 0.25rem;
}
.card-dot.green  { background: var(--green); }
.card-dot.blue   { background: var(--blue); }
.card-dot.amber  { background: var(--amber); }

.card-1 { top: calc(50% - 160px); left: calc(50% - 220px); animation-delay: 0s; }
.card-2 { top: calc(50% - 80px);  left: calc(50% + 100px); animation-delay: 1.2s; }
.card-3 { top: calc(50% + 60px);  left: calc(50% - 200px); animation-delay: 0.6s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ============ SECTIONS COMMON ============ */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-300);
  font-weight: 500;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  color: var(--black);
}

.section-inner, .about-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 4rem;
}

/* ============ ABOUT ============ */
#about { background: var(--gray-50); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 5rem;
  align-items: start;
}

.about-text h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--black);
}
.about-text h2 em { font-style: italic; color: var(--gray-500); }
.about-text p {
  color: var(--gray-500);
  font-weight: 300;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.skill-tag {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  font-size: 0.825rem;
  color: var(--gray-700);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.stat-box {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-box strong {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--black);
  line-height: 1;
}
.stat-box span {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* ============ PROJECTS ============ */
#projects { background: var(--white); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.project-card--wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.project-card--wide .project-thumb { height: 100%; min-height: 200px; }

.project-thumb {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--gray-100);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.4s ease;
}
.card-thumb-1 img { object-position: center 20%; }  /* veritaslux: skip dark nav */
.card-thumb-2 img { object-position: center 15%; }   /* fewo-davos: show hero */
.card-thumb-3 img { object-position: center 5%; }   /* fewo-info: show content */
.card-thumb-4 img { object-position: center 0%; }  /* compagnoni: skip blue bar */

.project-card:hover .project-thumb img {
  transform: scale(1.03);
}
.project-year {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  font-size: 0.75rem;
  color: var(--white);
  font-weight: 500;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.project-info {
  padding: 1.5rem;
}
.project-info h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--black);
}
.project-info p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-weight: 300;
}
.project-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.project-tags span {
  font-size: 0.75rem;
  background: var(--gray-50);
  color: var(--gray-700);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--gray-100);
}

/* ============ CONTACT ============ */
#contact { background: var(--gray-50); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: start;
}

.contact-text h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--black);
}
.contact-text p {
  color: var(--gray-500);
  font-weight: 300;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-info a {
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.contact-info a:hover { color: var(--black); }

/* Form */
.contact-form {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-700);
  letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--black);
  outline: none;
  transition: border-color var(--transition);
  resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--gray-300); }
.form-group input:focus,
.form-group textarea:focus { border-color: var(--gray-500); background: var(--white); }

.form-success {
  text-align: center;
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  color: #166534;
  font-size: 0.9rem;
}

.form-error {
  text-align: center;
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 0.9rem;
}

/* ============ FOOTER ============ */
footer {
  background: var(--black);
  color: var(--white);
  padding: 2rem 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
footer .nav-logo { color: var(--white); }
footer .nav-logo span { color: var(--gray-500); }
footer p { font-size: 0.8rem; color: var(--gray-500); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }

/* ============ ANIMATIONS ============ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  #hero {
    grid-template-columns: 1fr;
    padding: 7rem 2rem 3rem;
    text-align: center;
  }
  .hero-sub { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-visual { height: 260px; }

  #nav { padding: 1.25rem 2rem; }
  .nav-links { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-stats { margin-top: 0; }
  .section-inner, .about-inner { padding: 4rem 2rem; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-card--wide { grid-column: span 1; grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .form-row { grid-template-columns: 1fr; }

  footer { padding: 2rem; }
}