/* --- Variables --- */
:root {
  --bg-dark: #1a1a1a;
  --bg-darker: #121212;
  --bg-contact: #252d24;
  --input-bg: #2d2d2d;
  --accent: #b8d94a;
  --accent-hover: #c5e86c;
  --text: #f5f5f5;
  --text-muted: #a0a0a0;
  --sidebar-width: 220px;
  --font-head: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
/* Prevent any child from causing horizontal scroll */
body > * {
  max-width: 100%;
}
a { color: inherit; text-decoration: none; }

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-darker);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.sidebar-brand {
  margin-bottom: 0;
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.sidebar-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.sidebar-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.sidebar-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s;
}

.sidebar-backdrop.is-visible {
  opacity: 1;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.brand-name {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-tagline {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-link {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.4rem 0;
  transition: color 0.2s;
  display: block;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.social-icon {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.copyright {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Main content --- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  max-width: 100%;
  overflow-x: hidden;
}

.section {
  padding: 0;
  max-width: 100%;
}

.main-content .section {
  overflow-x: hidden;
}

/* --- Hero / Home --- */
.section-hero {
  padding-bottom: 0;
}

.hero-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-darker);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-block {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  text-align: center;
}

.welcome-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 1.25rem;
  line-height: 1.3;
}

.welcome-text {
  color: var(--text);
  margin: 0 0 1.75rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-darker);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* --- Portfolio --- */
.section-portfolio {
  padding: 2rem 1.5rem 4rem;
  background: var(--bg-darker);
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.portfolio-filter-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.portfolio-filter-btn:hover,
.portfolio-filter-btn.is-active {
  background: var(--accent);
  color: var(--bg-dark);
}

.portfolio-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.portfolio-item {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-dark);
}

.portfolio-item.hidden {
  display: none;
}

.portfolio-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

/* SimpleGallery lightbox */
.sg-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}
.sg-modal.open {
  display: flex;
}
.sg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  cursor: pointer;
  touch-action: manipulation;
}
.sg-content {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 1rem;
}
.sg-progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background: rgba(184, 217, 74, 0.3);
  overflow: hidden;
  z-index: 10000;
}
.sg-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: right;
}
.sg-progress-bar.sg-progress-active {
  animation: sg-progress-shrink linear forwards;
}
@keyframes sg-progress-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
.sg-inner {
  display: flex;
  justify-content: center;
  align-items: center;
}
.sg-inner .sg-image,
.sg-inner .sg-video {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}
.sg-inner .sg-video {
  display: block;
  background: #000;
}
.sg-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  line-height: 0;
}
.sg-prev,
.sg-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  line-height: 0;
}
.sg-prev { left: 0.5rem; }
.sg-next { right: 0.5rem; }

/* --- About --- */
.section-about {
  padding: 0;
  background: var(--bg-dark);
}

.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 520px;
}

.about-image {
  overflow: hidden;
  background: var(--bg-darker);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-content {
  padding: 3rem 3rem 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 0 0 1.25rem;
  line-height: 1.3;
}

.about-content p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.about-content .btn {
  margin-top: 1rem;
  align-self: flex-start;
}

/* --- Quote --- */
.section-quote {
  position: relative;
  padding: 4rem 2rem;
  text-align: center;
  overflow: hidden;
}

.quote-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,18,18,0.92) 0%, rgba(18,18,18,0.97) 100%),
    url('https://images.unsplash.com/photo-1509440159596-0249088772ff?w=1200&fit=crop') center/cover;
  z-index: 0;
}

.quote-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--text);
  margin: 0 auto 1rem;
  max-width: 700px;
}

.quote-cite {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-style: normal;
}

/* --- Contact form --- */
.section-contact {
  background: var(--bg-contact);
  padding: 3rem 2rem 4rem;
}

.contact-inner {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.contact-heading {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-align: center;
  margin: 0 0 1rem;
}

.contact-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
  margin: 0 0 2.25rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: block;
}

.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group .required {
  color: var(--accent);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
  min-height: 44px;
}

.contact-form textarea {
  min-height: 88px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(184, 217, 74, 0.4);
}

.contact-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.25rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 80px;
  padding-top: 0.75rem;
}

.input-phone,
.input-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0 0.75rem;
}

.input-phone:focus-within,
.input-date:focus-within {
  border-color: rgba(184, 217, 74, 0.4);
}

.phone-flag,
.date-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.phone-country {
  width: auto;
  min-width: 4rem;
  border: none;
  background: transparent;
  padding: 0.75rem 0.25rem 0.75rem 0;
}

.input-phone input,
.input-date input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.75rem 0;
}

.input-phone input {
  padding-left: 0.25rem;
}

.input-date input {
  padding-left: 0.25rem;
}

.input-date input::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.btn-submit {
  margin-top: 0.5rem;
  background: var(--input-bg);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  align-self: flex-start;
}

.btn-submit:hover {
  background: #383838;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
  transform: none;
}

.contact-footer-brand {
  margin-top: 2.5rem;
  text-align: center;
}

.contact-footer-brand .twig-icon {
  margin: 0 auto;
}

/* --- Footer --- */
.section-footer {
  padding: 3rem 2rem 2.5rem;
  background: var(--bg-darker);
  text-align: center;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.footer-col {
  padding: 0 1rem;
}

.footer-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 0.25rem;
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--text);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-brand {
  margin-bottom: 1rem;
}

.twig-icon {
  width: 32px;
  height: 24px;
  margin: 0 auto;
  background: var(--accent);
  clip-path: polygon(0 50%, 20% 20%, 40% 40%, 60% 30%, 80% 50%, 100% 30%, 100% 70%, 80% 50%, 60% 70%, 40% 60%, 20% 80%, 0 50%);
  opacity: 0.9;
}

.footer-copy {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .about-split {
    grid-template-columns: 1fr;
  }

  .about-image {
    min-height: 320px;
  }

  .about-content {
    padding: 2rem 1.5rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-columns {
    grid-template-columns: 1fr;
  }

  .form-row-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0;
    gap: 0;
    align-items: stretch;
    z-index: 101;
    background: var(--bg-darker);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .sidebar-header {
    margin-bottom: 0;
    padding: 1rem 1.25rem;
    min-height: 56px;
  }

  .sidebar-brand {
    margin-right: auto;
  }

  .nav-toggle {
    display: flex;
  }

  .sidebar-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  .sidebar-open .sidebar-menu {
    max-height: 80vh;
    overflow-y: auto;
  }

  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0.5rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    min-height: 48px;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
  }

  .sidebar-nav .nav-link:last-of-type {
    border-bottom: none;
  }

  .sidebar-nav .nav-link:hover,
  .sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent);
  }

  .sidebar-footer {
    padding: 1rem 1.25rem 1.25rem;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
  }

  .sidebar-backdrop {
    display: block;
    pointer-events: none;
  }

  .sidebar-backdrop.is-visible {
    pointer-events: auto;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .section-hero .hero-image {
    aspect-ratio: 4 / 3;
  }

  .welcome-block {
    padding: 2rem 1.25rem 2.5rem;
  }

  .welcome-title {
    font-size: 1.35rem;
  }

  .welcome-text {
    font-size: 0.95rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .section-portfolio {
    padding: 1.5rem 1rem 3rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .about-split {
    min-height: auto;
  }

  .about-image {
    min-height: 260px;
  }

  .about-content {
    padding: 1.75rem 1.25rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .section-quote {
    padding: 3rem 1.25rem;
  }

  .quote-text {
    font-size: 1.05rem;
  }

  .section-contact {
    padding: 2rem 1rem 3rem;
  }

  .contact-inner {
    padding: 0 0.25rem;
  }

  .contact-heading {
    font-size: 1.2rem;
  }

  .contact-intro {
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
  }

  .contact-form {
    gap: 1rem;
  }

  .btn-submit {
    min-height: 44px;
    width: 100%;
    align-self: stretch;
  }

  .section-footer {
    padding: 2rem 1rem 2rem;
  }

  .footer-columns {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 0.75rem 1rem;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .sidebar-nav .nav-link {
    font-size: 0.7rem;
  }

  .welcome-block {
    padding: 1.5rem 1rem 2rem;
  }

  .welcome-title {
    font-size: 1.2rem;
  }

  .section-portfolio {
    padding: 1.25rem 0.75rem 2.5rem;
  }

  .section-contact {
    padding: 1.5rem 0.75rem 2.5rem;
  }

  .contact-inner {
    padding: 0;
  }

  .contact-heading {
    font-size: 1.1rem;
  }

  .footer-col {
    padding: 0 0.5rem;
  }
}
