/* ============================================
   gradiant.tech — Main Stylesheet
   ============================================ */

/* 1. Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* 2. CSS Variables / Design Tokens */
:root {
  /* Colors — Monochrome Tonal System */
  --color-bg:                  #ffffff;
  --color-text:                #0A0A0A;
  --color-surface:             #fcf8f8;
  --color-surface-container-low: #F7F7F5;
  --color-surface-container:   #f0edec;
  --color-surface-container-high: #ebe7e7;
  --color-surface-container-highest: #e5e2e1;
  --color-surface-variant:     #e5e2e1;
  --color-border:              #E8E8E4;
  --color-outline:             #777777;
  --color-outline-variant:     #c6c6c6;
  --color-muted:               #6b6b6b;
  --color-primary:             #000000;
  --color-on-primary:          #e5e2e1;
  --color-on-surface:          #0A0A0A;
  --color-on-surface-variant:  #474747;
  --color-inverse-surface:     #313030;
  --color-error:               #ba1a1a;

  /* Typography */
  --font-headline:'Inter', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-label:    'Inter', sans-serif;

  /* Spacing */
  --container-max: 1440px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --duration: 400ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
}

::selection {
  background-color: var(--color-primary);
  color: white;
}

/* 4. Typography */
.syne, .font-headline {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.font-body {
  font-family: 'Inter', sans-serif;
}

.font-label {
  font-family: 'Inter', sans-serif;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
}

/* 5. Layout Utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* 6. Components */

/* --- Slide Underline --- */
.slide-underline {
  position: relative;
}
.slide-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: currentColor;
  transition: width var(--duration) var(--ease-smooth);
}
.slide-underline:hover::after {
  width: 100%;
}

/* --- Project Card Hover --- */
.project-card:hover .project-reveal {
  opacity: 1;
  transform: translateY(0);
}
.project-card:hover .project-image {
  transform: translateY(-10px);
}

/* --- Floating Label (Contact Form) --- */
.floating-label-group {
  position: relative;
  margin-bottom: 2.5rem;
}
.floating-label-group input,
.floating-label-group textarea,
.floating-label-group select {
  border: none;
  border-bottom: 1px solid #E8E8E4;
  background: transparent;
  width: 100%;
  padding: 12px 0;
  outline: none;
  transition: border-color var(--duration);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
}
.floating-label-group select {
  appearance: none;
  -webkit-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='%23777' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  cursor: pointer;
}
.floating-label-group input:focus,
.floating-label-group textarea:focus,
.floating-label-group select:focus {
  border-bottom: 1px solid var(--color-text);
  box-shadow: none;
}
.floating-label-group label {
  position: absolute;
  left: 0;
  top: 12px;
  color: var(--color-outline);
  pointer-events: none;
  transition: all 0.3s ease;
  font-family: var(--font-label);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.floating-label-group input:focus ~ label,
.floating-label-group input:not(:placeholder-shown) ~ label,
.floating-label-group textarea:focus ~ label,
.floating-label-group textarea:not(:placeholder-shown) ~ label {
  top: -12px;
  font-size: 0.75rem;
  color: var(--color-text);
}

/* --- Form Success/Error --- */
.form-success {
  padding: 2rem;
  text-align: center;
  font-size: 1.125rem;
  color: var(--color-text);
  font-family: var(--font-headline);
  font-weight: 600;
}
.form-error {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* --- Mobile Navigation Overlay --- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-smooth);
}
.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-nav-overlay a {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  transition: opacity 0.3s;
}
.mobile-nav-overlay a:hover {
  opacity: 0.5;
}

/* --- Hamburger Button --- */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
  z-index: 60;
  position: relative;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Blog Content Prose --- */
.prose-custom h2 {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 3rem;
  text-transform: uppercase;
  color: #0a0a0a;
}
.prose-custom p {
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.8;
  color: #525252;
  margin-bottom: 2rem;
}
.prose-custom ul {
  list-style: none;
  padding: 0;
}
.prose-custom ul li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.8;
  color: #525252;
  margin-bottom: 1.5rem;
}
.prose-custom ul li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #0a0a0a;
  margin-top: 0.625rem;
  flex-shrink: 0;
}

/* --- Legal Drawer (Privacy / Terms) --- */
.legal-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-smooth);
}
.legal-drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.legal-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 101;
  background: #fff;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform var(--duration) var(--ease-smooth);
  overflow-y: auto;
}
.legal-drawer.open {
  transform: translateY(0);
}
.legal-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.legal-drawer-header h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}
.legal-drawer-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
  transition: opacity 0.3s;
}
.legal-drawer-close:hover {
  opacity: 0.5;
}
.legal-drawer-body {
  padding: 2.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-on-surface-variant);
}
.legal-drawer-body p {
  margin-bottom: 1rem;
}
.legal-drawer-body .legal-date {
  font-size: 0.875rem;
  color: var(--color-outline);
  margin-bottom: 2rem;
}

/* 8. Animations */

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in[data-delay="1"] { transition-delay: 0.1s; }
.fade-in[data-delay="2"] { transition-delay: 0.2s; }
.fade-in[data-delay="3"] { transition-delay: 0.3s; }
.fade-in[data-delay="4"] { transition-delay: 0.4s; }
.fade-in[data-delay="5"] { transition-delay: 0.5s; }

/* CTA Background Texture */
.cta-texture {
  background-image: repeating-linear-gradient(45deg, #fff 0, #fff 1px, transparent 0, transparent 50%);
  background-size: 10px 10px;
}

/* --- Active Filter Button --- */
.filter-btn.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

/* --- Active Nav Link --- */
.nav-link.active::after {
  width: 100%;
}
.nav-link.active {
  color: #0A0A0A;
  font-weight: 500;
}

/* 9. Responsive */

/* ─── Tablet ─────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 1.5rem; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid     { grid-template-columns: repeat(2, 1fr); }
  .about-grid    { grid-template-columns: repeat(2, 1fr); }
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .hero h1       { font-size: clamp(2.5rem, 5vw, 4rem); }
}

/* ─── Mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }

  /* Container */
  .container { padding: 0 1rem; }

  /* Typography — element selectors (non-Tailwind elements) */
  h1 { font-size: clamp(1.8rem, 5vw, 4.5rem); }
  h2 { font-size: clamp(1.4rem, 4vw, 3rem); }
  h3 { font-size: clamp(1.1rem, 3vw, 1.8rem); }

  /* Override Tailwind large text classes on mobile */
  .text-7xl { font-size: 2.5rem !important; }
  .text-6xl { font-size: 2rem !important; }
  .text-5xl { font-size: 1.75rem !important; }
  .text-4xl { font-size: 1.5rem !important; }
  .text-3xl { font-size: 1.25rem !important; }
  .text-2xl { font-size: 1.1rem !important; }

  /* Navbar */
  .nav__links { display: none; flex-direction: column; position: fixed;
    inset: 0; background: #fff; justify-content: center;
    align-items: center; gap: 2rem; z-index: 999; }
  .nav__links.open { display: flex; }
  .nav__hamburger  { display: flex; }
  .nav__link--cta  { margin-top: 1rem; }

  /* Hero */
  .hero { min-height: auto; padding: 6rem 0 3rem; text-align: left; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-decoration { display: none; }
  .hero-buttons { flex-direction: column; gap: 0.75rem; }
  .hero-buttons .btn { width: 100%; text-align: center; }

  /* Grids → single column */
  .services-grid,
  .projects-grid,
  .blog-grid     { grid-template-columns: 1fr; gap: 1.25rem; }

  /* About / stats */
  .about-grid  { grid-template-columns: 1fr; gap: 2rem; }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .stat-number { font-size: 2.5rem; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* CTA banner */
  .cta-banner { padding: 3rem 1rem; text-align: center; }
  .cta-banner h2 { font-size: 1.8rem; }

  /* Cards */
  .project-card,
  .blog-card,
  .service-card { width: 100%; }

  /* Blog detail */
  .blog-cover { height: 220px; }
  .blog-content { font-size: 16px; }

  /* Project detail */
  .project-meta { flex-wrap: wrap; gap: 0.5rem; }
  .project-logo-box { padding: 1.5rem; }

  /* Footer */
  .footer__inner { flex-direction: column; gap: 2rem; text-align: center; }
  .footer__nav   { flex-direction: column; gap: 0.75rem; align-items: center; }
}

/* ─── Small mobile ────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.9rem; }
}

/* ─── Global image safety ─────────────────────── */
img { max-width: 100%; height: auto; }

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
