@import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");

/* Base */
:root {
  --radius: 14px;
  --container: 1120px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  --transition: all 0.25s ease;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
}

[data-theme="light"] {
  --bg: #ffffff;
  --fg: #111418;
  --muted: #6b7280;
  --accent: #ffb400;
  --surface: #f7f7fb;
  --theme-toggle-bg: #2a2a2a;
  --theme-toggle-fg: #ffffff;
}

[data-theme="dark"] {
  --bg: #141210;
  --fg: #ffffff;
  --muted: #6b7280;
  --accent: #ffb400;
  --surface: #1c1b1b;
  --theme-toggle-bg: #2a2a2a;
  --theme-toggle-fg: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  transition: background 0.2s, color 0.2s;
}

html, body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  touch-action: manipulation;
  height: 100%;
  overflow-y: scroll;
  overscroll-behavior-y: none;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }

.lead {
  color: var(--muted);
  font-weight: 400;
  max-width: 720px;
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section {
  padding: 4.5rem 0;
}
.section.alt {
  background: var(--surface);
}
.grid {
  display: grid;
  gap: 1.25rem;
}
.cards,
.portfolio,
.pricing {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  margin-top: 2rem;
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  box-shadow: var(--shadow);
  z-index: 999;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  position: relative;
  padding-left: 70px;
}
.logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
  margin-left: 3rem;
}
.logo span { color: var(--accent); }

.nav {
  display: flex;
  gap: 0.75rem;
}
.nav a {
  text-decoration: none;
  color: var(--fg);
  font-weight: 500;
  padding-left: 1.25rem;
  display: flex;
  align-items: center;
  height: 64px;
}
.nav a:hover { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--fg);
}

.theme-toggle {
  font-family: "Montserrat", sans-serif;
  display: flex;
  align-items: center;
  height: 100%;
  margin-right: 1.5rem;
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1000;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid #363636;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav.open { max-height: 260px; }
}

/* Hero */
.hero {
  margin-top: 0;
  padding: 1rem 0 4rem;
  position: relative;
  background-color: var(--bg);
}
.hero .accent { color: var(--accent); }
.hero .hero-cta {
  margin: 1.5rem 0 2.5rem;
  display: flex;
  gap: 0.75rem;
}
.hero-flex {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 2rem;
}
.hero-content {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero-img {
  max-width: 360px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-flex { flex-direction: column; }
  .hero-img {
    margin-top: 2rem;
    align-self: stretch;
    width: 100%;
  }
}
.hero-bg {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100vw;
  z-index: -1;
  overflow: hidden;
}
.hero-bg video {
  width: 150vw;
  object-fit: cover;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
}

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 0 1.25rem;
}
.media-item img,
.media-item video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  display: block;
}
@media (max-width: 1024px) {
  .media-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .media-grid { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  color: #000;
}
.btn.primary:hover { filter: brightness(0.95); }
.btn.ghost {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
.btn.ghost:hover {
  background: var(--accent);
  color: #000;
}
#more-work-btn { margin-top: 2rem; }

/* Cards */
.card {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h4 { margin-bottom: 0.4rem; }

/* Portfolio */
.portfolio-item {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.portfolio-item span { display: block; padding: 1rem; }

/* Footer */
.site-footer {
  background: var(--bg);
  color: var(--fg);
  padding: 2rem 0;
  text-align: center;
}

/* Theme toggle */
.checkbox {
  opacity: 0;
  position: absolute;
}
.checkbox-label {
  background-color: var(--theme-toggle-bg);
  width: 50px;
  height: 26px;
  border-radius: 50px;
  position: relative;
  padding: 5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fa-moon,
.fa-sun {
  color: var(--accent);
}
.checkbox-label .ball {
  background-color: var(--theme-toggle-fg);
  width: 22px;
  height: 22px;
  position: absolute;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  transition: transform 0.2s linear;
}
.checkbox:checked + .checkbox-label .ball {
  transform: translateX(24px);
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
}
.carousel-slide {
  min-width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
}
.carousel-slide.active { display: flex; }
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.carousel-prev:hover,
.carousel-next:hover {
  background: var(--accent);
  color: #000;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

/* Icons */
.material-icons {
  font-size: 1.7rem;
  vertical-align: middle;
  pointer-events: none;
}
.nav-toggle .material-icons { font-size: 2rem; }
.carousel-prev .material-icons,
.carousel-next .material-icons {
  font-size: 1.5rem;
}