@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f6f2e9;
  --surface: #ffffff;
  --surface-2: #eee8db;
  --accent-gold: #2f4a3e;
  --accent-coral: #1e332b;
  --text: #23201a;
  --text-muted: #75705f;
  --line: rgba(47, 74, 62, 0.18);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

/* ---------- Header ---------- */
header {
  padding-top: 28px;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.nav-name {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 600;
}
.nav-links {
  display: flex;
  gap: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--accent-gold); }

/* ---------- Hero ---------- */
.hero {
  padding-top: 96px;
  padding-bottom: 80px;
  position: relative;
}
.hero-line {
  position: absolute;
  top: 0;
  right: -40px;
  width: 340px;
  height: 340px;
  opacity: 0.5;
  pointer-events: none;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.12;
  margin: 20px 0 6px;
  max-width: 720px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent-gold);
}
.hero p.lead {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 17px;
  margin: 20px 0 34px;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent-gold);
  color: var(--bg);
}
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-gold); }

.nowrap { white-space: nowrap; }

/* ---------- About ---------- */
.about-section { border-top: none; padding-top: 0; }
.about-grid {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  align-items: start;
}
.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--accent-gold);
  flex-shrink: 0;
}
.about-name {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 24px;
  margin: 8px 0 12px;
}
.about-text {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 520px;
  margin: 0;
}

/* ---------- Section headings ---------- */
.section { padding-top: 70px; padding-bottom: 70px; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 30px;
  margin: 10px 0 0;
}

/* ---------- Project list (constellation) ---------- */
.projects {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.projects::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-gold), transparent 95%);
  opacity: 0.35;
}
.project-card {
  position: relative;
  padding: 30px 0 30px 40px;
  border-bottom: 1px solid var(--line);
}
.project-card:last-child { border-bottom: none; }
.project-card::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 38px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 0 4px rgba(227,167,91,0.15);
}
.project-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.project-thumb {
  width: 220px;
  height: 150px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.project-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-align: center;
  padding: 12px;
}
.project-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}
.project-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 14px;
  max-width: 520px;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent-gold);
}
.project-links { display: flex; gap: 18px; font-size: 14px; }
.project-links a {
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--accent-gold);
  padding-bottom: 1px;
}
.project-links a:hover { color: var(--accent-gold); }
.status-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service:last-child { grid-column: span 2; }
.service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.service h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px;
}
.service p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ---------- Footer ---------- */
footer.wrap {
  max-width: 1100px;
  padding: 50px 32px 60px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
footer .contacts { display: flex; gap: 24px; font-size: 14px; align-items: center; flex-wrap: wrap; }
footer .contacts a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; cursor: pointer; }
footer .contacts a:hover,
footer .contacts a:active { border-color: var(--accent-gold); color: var(--accent-gold); }
footer .contacts .btn { margin-left: 8px; }
footer .copy { color: var(--text-muted); font-size: 13px; }

/* ---------- Case page ---------- */
.case-hero { padding-top: 60px; padding-bottom: 40px; }
.case-back {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 28px;
}
.case-back:hover { color: var(--accent-gold); }
.case-hero h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 46px);
  margin: 14px 0;
}
.case-cover {
  width: 100%;
  max-width: 360px;
  height: 480px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 30px;
  margin-bottom: 10px;
}
.case-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.case-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 44px 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.case-meta div .eyebrow { display: block; margin-bottom: 8px; }
.case-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 12px;
}
.case-body p { color: var(--text-muted); max-width: 640px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .project-inner { grid-template-columns: 1fr; }
  .project-thumb { width: 100%; height: 190px; }
  .services-grid { grid-template-columns: 1fr; }
  .service:last-child { grid-column: span 1; }
  .case-meta { grid-template-columns: 1fr; }
  .case-cover { max-width: 100%; height: 360px; }
  footer.wrap { flex-direction: column; align-items: flex-start; }

  .wrap { padding: 0 20px; }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
  }
  .nav-name { font-size: 18px; }
  .nav-links {
    flex-wrap: wrap;
    gap: 10px 16px;
    width: 100%;
  }
  .hero { padding-top: 48px; padding-bottom: 48px; }
  .hero .eyebrow { letter-spacing: 0.08em; font-size: 11px; }
  .hero h1 {
    font-size: 27px;
    line-height: 1.22;
    letter-spacing: -0.01em;
    margin: 12px 0 8px;
  }
  .hero p.lead { font-size: 15px; }
  #about > div,
  .about-grid {
    grid-template-columns: 1fr !important;
    justify-items: center;
    text-align: center;
    gap: 14px !important;
  }
  .about-avatar { margin: 0 auto; }
  .about-text { max-width: 100%; }
  .case-hero h1 { font-size: 28px; }
  .case-hero .eyebrow { letter-spacing: 0.08em; font-size: 11px; }
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

/* ---------- Scroll to top ---------- */
.scroll-top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(35, 32, 26, 0.12);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 50;
}
.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top-btn:hover { border-color: var(--accent-gold); }
.scroll-top-btn svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .scroll-top-btn { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* ---------- Contact modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 32, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  transform: translateY(8px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 6px;
}
.modal-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}
.field-error {
  display: block;
  font-size: 12px;
  color: #b3432f;
  margin-top: 5px;
  min-height: 14px;
}
.form-status {
  font-size: 13px;
  text-align: center;
  margin: 14px 0 0;
  min-height: 18px;
}
.form-status.success { color: var(--accent-gold); }
.form-status.error { color: #b3432f; }

@media (max-width: 480px) {
  .modal-box { padding: 26px 22px; }
}
