@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Sora:wght@300;400;500;600&display=swap");

:root {
  --sand: #f5f1e8;
  --paper: #fcfaf6;
  --ink: #141414;
  --muted: #5b5b5b;
  --accent: #ff6b4a;
  --accent-soft: #ffe2d9;
  --teal: #0f766e;
  --border: #e3dccf;
  --shadow: 0 18px 40px rgba(20, 20, 20, 0.12);
  --shadow-soft: 0 8px 24px rgba(20, 20, 20, 0.08);
  --bg-gradient-1: #fff4ef;
  --bg-gradient-2: #e7f4f1;
  --error: #e25555;
  --header-bg: rgba(252, 250, 246, 0.9);
  --header-bg-scrolled: rgba(252, 250, 246, 0.96);
  --content-max: 1280px;
  --avatar-border: #ff6b4a;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
  --font-body: "Sora", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Times New Roman", serif;
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(
      circle at 10% 20%,
      var(--bg-gradient-1) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 90% 10%,
      var(--bg-gradient-2) 0%,
      transparent 50%
    ),
    var(--sand);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body[data-theme="system-light"] {
  --sand: #f5f1e8;
  --paper: #fcfaf6;
  --ink: #141414;
  --muted: #5b5b5b;
  --accent: #ff6b4a;
  --accent-soft: #ffe2d9;
  --teal: #0f766e;
  --border: #e3dccf;
  --bg-gradient-1: #fff4ef;
  --bg-gradient-2: #e7f4f1;
  --header-bg: rgba(252, 250, 246, 0.9);
  --header-bg-scrolled: rgba(252, 250, 246, 0.96);
  --avatar-border: #ff6b4a;
  color-scheme: light;
}

body[data-theme="system-dark"] {
  --sand: #121317;
  --paper: #1a1d24;
  --ink: #f2f4f7;
  --muted: #a0a4b0;
  --accent: #66d0ff;
  --accent-soft: #223248;
  --teal: #7bd389;
  --border: #2c313d;
  --shadow: 0 18px 40px rgba(5, 8, 14, 0.45);
  --shadow-soft: 0 8px 24px rgba(5, 8, 14, 0.3);
  --bg-gradient-1: #1a2230;
  --bg-gradient-2: #1d1a2a;
  --header-bg: rgba(26, 29, 36, 0.9);
  --header-bg-scrolled: rgba(26, 29, 36, 0.96);
  --avatar-border: #66d0ff;
  color-scheme: dark;
}

body[data-theme="ocean"] {
  --sand: #e8f4f6;
  --paper: #f5fbfc;
  --ink: #0b2d3a;
  --muted: #3b5a66;
  --accent: #1d8faf;
  --accent-soft: #cfeaf2;
  --teal: #0f6c8d;
  --border: #cfe3e9;
  --bg-gradient-1: #d9f1f6;
  --bg-gradient-2: #e3f6ff;
  --header-bg: rgba(245, 251, 252, 0.9);
  --header-bg-scrolled: rgba(245, 251, 252, 0.96);
  --avatar-border: #1d8faf;
}

body[data-theme="forest"] {
  --sand: #edf3ea;
  --paper: #f8fcf6;
  --ink: #1f2f22;
  --muted: #4b5b4e;
  --accent: #2f7f55;
  --accent-soft: #d6efe1;
  --teal: #246b4b;
  --border: #d6e2d5;
  --bg-gradient-1: #e5f2e4;
  --bg-gradient-2: #f0f6e8;
  --header-bg: rgba(248, 252, 246, 0.9);
  --header-bg-scrolled: rgba(248, 252, 246, 0.96);
  --avatar-border: #2f7f55;
}

body[data-theme="dusk"] {
  --sand: #f2ecf3;
  --paper: #fbf7fc;
  --ink: #2e1f3b;
  --muted: #5c4a66;
  --accent: #9d4edd;
  --accent-soft: #eedaf8;
  --teal: #6b21a8;
  --border: #e3d6ee;
  --bg-gradient-1: #f2e7fb;
  --bg-gradient-2: #efe2f3;
  --header-bg: rgba(251, 247, 252, 0.9);
  --header-bg-scrolled: rgba(251, 247, 252, 0.96);
  --avatar-border: #9d4edd;
}

body[data-theme="mono"] {
  --sand: #f2f2f2;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #555555;
  --accent: #222222;
  --accent-soft: #e6e6e6;
  --teal: #222222;
  --border: #d9d9d9;
  --bg-gradient-1: #f0f0f0;
  --bg-gradient-2: #fafafa;
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-bg-scrolled: rgba(255, 255, 255, 0.96);
  --avatar-border: #111111;
}

body[data-theme="retro"] {
  --sand: #fff2d8;
  --paper: #fff8e8;
  --ink: #3a2f1a;
  --muted: #6a4f2c;
  --accent: #d9522c;
  --accent-soft: #ffd6a6;
  --teal: #2d7f7a;
  --border: #e2c59a;
  --bg-gradient-1: #ffe7bd;
  --bg-gradient-2: #ffe4d1;
  --header-bg: rgba(255, 248, 232, 0.9);
  --header-bg-scrolled: rgba(255, 248, 232, 0.96);
  --avatar-border: #d9522c;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  margin-top: 88px;
}

section {
  padding: var(--space-24) var(--space-6);
}

.section-header {
  max-width: 720px;
  margin-bottom: var(--space-12);
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.btn-secondary:hover {
  transform: translateY(-2px);
}

.text-link {
  color: var(--teal);
  font-weight: 600;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.nav-menu {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.nav-menu a {
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
}

.nav-menu a.active,
.nav-menu a:hover {
  color: var(--ink);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  transform: scaleX(1);
}

.hamburger {
  display: none;
  border: 1px solid var(--border);
  padding: var(--space-2);
  background: var(--paper);
  border-radius: var(--radius-sm);
  color: var(--ink);
}

.hamburger__icon {
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-select {
  position: relative;
}

.theme-select__button {
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.theme-select__current {
  white-space: nowrap;
}

.theme-select__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: none;
  padding: var(--space-2);
  gap: var(--space-1);
  min-width: 180px;
  z-index: 10;
}

.theme-select.is-open .theme-select__menu {
  display: grid;
}

.theme-select__option {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-select__option[aria-selected="true"],
.theme-select__option:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.hero-section {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space-20) var(--space-6) var(--space-16);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
  justify-content: center;
}

.hero-content {
  position: relative;
  max-width: 720px;
  padding: var(--space-12) var(--space-6);
}

.hero-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--avatar-border);
  box-shadow: var(--shadow-soft);
  margin: 0 auto var(--space-6);
}

.projects-section,
.blog-section,
.contact-section {
  max-width: var(--content-max);
  margin: 0 auto;
}

.services-section,
.testimonials-section,
.clients-section,
.newsletter-section {
  max-width: var(--content-max);
  margin: 0 auto;
}

.projects-grid,
.blog-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card,
.blog-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.project-card:hover,
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.project-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--teal);
}

.project-title,
.blog-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.project-description,
.blog-excerpt {
  color: var(--muted);
  line-height: 1.6;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}

.project-footer {
  margin-top: auto;
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.services-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.service-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: grid;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
}

.service-card img {
  height: 180px;
  width: 100%;
  object-fit: cover;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  padding: 0 var(--space-6);
}

.service-card p {
  color: var(--muted);
  line-height: 1.6;
  padding: 0 var(--space-6);
}

.testimonials-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.testimonial-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--space-6);
}

.testimonial-card p {
  color: var(--muted);
  line-height: 1.7;
}

.testimonial-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-footer img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-footer h4 {
  font-size: 1rem;
}

.testimonial-footer span {
  font-size: 0.85rem;
  color: var(--muted);
}

.clients-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.client-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  background: var(--paper);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: grid;
  gap: var(--space-3);
  justify-items: center;
}

.client-card img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.newsletter-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: var(--space-10);
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
}

.newsletter-form {
  display: grid;
  gap: var(--space-4);
}

.contact-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: var(--space-10);
}

.contact-info {
  display: grid;
  gap: var(--space-4);
}

.contact-card {
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.contact-card h3,
.contact-card h4 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.contact-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-card h3,
.contact-card h4 {
  margin-bottom: var(--space-2);
}

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

.contact-form {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-soft);
}

.form-group {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.form-input,
.form-textarea {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  background: #fff;
}

.form-input:focus,
.form-textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.error-message {
  color: var(--error);
  font-size: 0.8rem;
  min-height: 1rem;
  display: block;
}

.form-input.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-success {
  background: #e9f6f4;
  border: 1px solid #b8e4de;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  color: var(--teal);
}

.site-footer {
  margin-top: var(--space-24);
  border-top: 1px solid var(--border);
  background: var(--paper);
}

.footer-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-8);
}

.footer-info p {
  color: var(--muted);
  margin-top: var(--space-3);
}

.footer-links {
  display: grid;
  gap: var(--space-2);
}

.footer-links a {
  color: var(--muted);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-social img {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  text-align: center;
  padding: var(--space-6);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--paper);
  border-left: 1px solid var(--border);
  transition: right var(--transition);
  z-index: 1001;
}

.sidebar.active {
  right: 0;
}

.sidebar-menu {
  padding: var(--space-10) var(--space-6);
}

.close-btn {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  border: 1px solid var(--border);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

.sidebar ul {
  list-style: none;
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.sidebar a {
  color: var(--muted);
  font-size: 1.1rem;
}

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-input.error,
.form-textarea.error {
  border-color: #ffb4a4;
}

header.scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 1024px) {
  .hamburger {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .newsletter-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  section {
    padding: var(--space-20) var(--space-5);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-content {
    padding: var(--space-10) var(--space-4);
  }
}
