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

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f7f7;
  --color-border: #e2e2e2;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-accent: #1a1a1a;
  --color-accent-hover: #444;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

/* === Navbar === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--color-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* === Hero === */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  background: linear-gradient(135deg, #f7f7f7 0%, #ffffff 100%);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

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

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.hero p {
  color: #ddd;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn:hover { background: var(--color-accent-hover); color: #fff; }

/* === Sections === */
.about {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.about > p {
  color: var(--color-muted);
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

.services {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--color-border);
}

.card {
  background: var(--color-surface);
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  padding: 2rem;
  text-align: left;
}

.card:last-child {
  border-bottom: none;
}

.card-with-image {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.card-text {
  flex: 1;
}

.card-image {
  width: 300px;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

@media (max-width: 700px) {
  .card-with-image {
    flex-direction: column;
  }
  .card-image {
    width: 100%;
    height: 200px;
  }
}

.card h3 {
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.card-link:hover {
  background: #efefef;
  color: inherit;
}

.card p { color: var(--color-muted); }

/* === Page Hero Banner === */
.page-hero {
  width: 100%;
  height: 350px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.page-hero-overlay h1 {
  color: #fff;
  font-size: 2.5rem;
  text-align: center;
  max-width: 800px;
}

/* === Page Content === */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  flex: 1;
}

.page-content h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--color-muted);
  margin-bottom: 2rem;
}

/* === Video Grid === */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.video-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.video-wrapper {
  position: relative;
  padding-top: 56.25%;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.video-card h3,
.video-card p {
  padding: 0 1rem;
}

.video-card h3 { margin-top: 1rem; }
.video-card p { color: var(--color-muted); padding-bottom: 1rem; }

.self-hosted {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
}

.self-hosted h2 { margin-bottom: 0.5rem; }
.self-hosted p { color: var(--color-muted); margin-bottom: 1rem; }
.self-hosted pre {
  background: var(--color-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
}

/* === TikTok Grid === */
.tiktok-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(325px, 1fr));
  gap: 1.5rem;
  justify-items: center;
}

.tiktok-embed-wrapper {
  width: 100%;
  max-width: 605px;
}

/* === Calculator / Spreadsheet === */
.spreadsheet-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.spreadsheet-toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.spreadsheet-toolbar button {
  padding: 0.4rem 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.spreadsheet-toolbar button:hover {
  background: var(--color-border);
}

.table-scroll { overflow-x: auto; }

#calcTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

#calcTable th,
#calcTable td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

#calcTable th {
  background: var(--color-bg);
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.row-num {
  width: 40px;
  text-align: center;
  color: var(--color-muted);
  background: var(--color-bg);
}

.cell-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text);
  font-family: var(--font);
  font-size: 0.95rem;
  border-radius: 3px;
}

.cell-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg);
}

select.cell-input { cursor: pointer; }

.row-total {
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.grand-label {
  text-align: right;
  font-weight: 700;
  font-size: 1rem;
}

.grand-total {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

/* === Contact Form === */
.contact-form {
  max-width: 550px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-group textarea {
  resize: vertical;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  margin-top: auto;
}

/* === Responsive === */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--color-surface);
    padding: 1rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border);
  }
  .menu-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
}
