/* Codelence.site - Premium Front‑End Portfolio Styles */

/* Root theme tokens */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #0f172a;        /* slate-900 */
  --muted: #475569;       /* slate-600 */
  --border: #e2e8f0;      /* slate-200 */
  --accent: #d4af37;      /* luxury gold */
  --accent-2: #0ea5b7;    /* modern teal accent for subtle highlights */
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --ring: 0 0 0 1.5px rgba(212,175,55,0.25);
}

/* Dark theme overrides */
body.theme-dark {
  --bg: #0b1220;
  --surface: #0f1629;
  --text: #e6eaf2;
  --muted: #9aa7bd;
  --border: #1f2937;
  --accent: #d4af37;
  --accent-2: #22d3ee;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

/* Base reset */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Containers */
.container {
  width: 100%;
  max-width: 1200px;
  padding: 0 24px;
  margin: 0 auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(130%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    radial-gradient(120px 60px at 0% 0%, rgba(212,175,55,0.35), transparent 60%),
    radial-gradient(80px 40px at 100% 100%, rgba(14,165,183,0.35), transparent 60%),
    linear-gradient(135deg, #0f1629 0%, #12203f 100%);
  box-shadow: 0 10px 20px rgba(14, 165, 183, 0.15), inset 0 0 0 1px rgba(212,175,55,0.35);
  position: relative;
}
.brand-logo::after{
  content: "C";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.nav a:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  transform: translateY(-1px);
}

.nav a.active {
  color: var(--text);
  box-shadow: var(--ring);
  background: color-mix(in oklab, var(--surface) 85%, transparent);
}

.nav .hire {
  color: #0b1220;
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in oklab, var(--accent), #fff 12%) 100%);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(212,175,55,0.35);
}
body.theme-dark .nav .hire { color: #0b1220; }

/* Theme toggle */
.theme-toggle {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.theme-toggle:hover { background: color-mix(in oklab, var(--surface) 85%, transparent); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 40px;
  background:
    radial-gradient(1200px 400px at 10% -20%, rgba(212,175,55,0.12), transparent 50%),
    radial-gradient(900px 420px at 90% 0%, rgba(14,165,183,0.12), transparent 52%);
}

.hero .title {
  font-size: clamp(2.2rem, 5.8vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 10px;
}

.hero .subtitle {
  color: var(--muted);
  max-width: 740px;
  margin: 0 0 26px;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  color: #0b1220;
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in oklab, var(--accent), #fff 12%) 100%);
  box-shadow: 0 14px 28px rgba(212,175,55,0.35);
}
body.theme-dark .btn-primary { color: #0b1220; }

.btn-outline {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Sections */
.section {
  padding: 56px 0;
  position: relative;
}
.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.section-title {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0;
}
.section-desc {
  color: var(--muted);
  max-width: 760px;
}

/* Grid and cards */
.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-1 { grid-template-columns: 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border-color: color-mix(in oklab, var(--border), var(--accent) 25%);
}

/* Services */
.service {
  padding: 18px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
}
.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--surface), var(--accent) 14%), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.service h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.service p {
  margin: 0;
  color: var(--muted);
}

/* Projects */
.project-cover {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #111, #333);
  display: block;
}
.project-body {
  padding: 18px;
}
.project-title {
  margin: 0 0 6px;
  font-size: 1.12rem;
}
.project-desc {
  margin: 0 0 14px;
  color: var(--muted);
}
.project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Contact */
.contact-list {
  display: grid;
  gap: 12px;
}
.contact-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
}
.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
}
.contact-item a {
  color: var(--text);
  text-decoration: none;
}
.contact-item a:hover {
  text-decoration: underline;
}

/* CTA banner */
.cta {
  margin-top: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(800px 280px at 20% 0%, rgba(212,175,55,0.12), transparent 62%),
    radial-gradient(800px 280px at 80% 0%, rgba(14,165,183,0.12), transparent 62%),
    var(--surface);
  padding: 22px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 24px;
}
.footer .container {
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer small { color: var(--muted); }

/* Back-to-top */
#backToTop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform .24s ease, opacity .24s ease;
}
#backToTop.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
#backToTop .btn {
  border-radius: 999px;
  padding: 10px 14px;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Media queries */
@media (max-width: 960px) {
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .cta { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .nav { flex-wrap: wrap; }
  .grid.cols-3,
  .grid.cols-2 { grid-template-columns: 1fr; }
  .actions { flex-wrap: wrap; }
  .brand-name { font-size: 0.98rem; }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}