/* ============================================================
   Solvituria — portfolio styles
   Theme: deep navy + electric cyan. Dark default, light toggle.
   ============================================================ */

:root {
  /* Dark theme (default) */
  --bg: #070b18;
  --bg-2: #0b1226;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eaf0ff;
  --muted: #9aa8c7;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  --bg: #f4f7ff;
  --bg-2: #e9eefb;
  --surface: rgba(15, 23, 42, 0.03);
  --surface-2: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.1);
  --text: #0d1428;
  --muted: #4a5878;
  --accent: #0891b2;
  --accent-2: #4f46e5;
  --accent-soft: rgba(8, 145, 178, 0.1);
  --shadow: 0 20px 50px -24px rgba(30, 50, 120, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.muted { color: var(--muted); }
.grad-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.72rem;
  font-weight: 600; color: var(--accent); margin-bottom: 0.9rem;
}

/* ---------- Animated background ---------- */
.bg-aurora {
  position: fixed; inset: -20% -10% auto -10%; height: 120vh; z-index: -2;
  background:
    radial-gradient(40% 40% at 20% 20%, rgba(99, 102, 241, 0.35), transparent 70%),
    radial-gradient(38% 38% at 80% 25%, rgba(34, 211, 238, 0.28), transparent 70%),
    radial-gradient(45% 45% at 55% 75%, rgba(99, 102, 241, 0.22), transparent 70%);
  filter: blur(40px);
  animation: drift 22s ease-in-out infinite alternate;
}
:root[data-theme="light"] .bg-aurora { opacity: 0.55; }
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  opacity: 0.4;
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(-3%, 5%, 0) scale(1.04); }
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.1rem; }
.brand__mark { display: inline-flex; }
.nav__links { display: flex; gap: 1.6rem; font-size: 0.92rem; font-weight: 500; }
.nav__links a { color: var(--muted); transition: color 0.2s; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 0.7rem; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem;
  display: grid; place-items: center; position: relative; transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
.theme-toggle__icon { position: absolute; transition: opacity 0.3s, transform 0.3s; }
.theme-toggle__icon--sun { opacity: 0; transform: scale(0.5); }
.theme-toggle__icon--moon { opacity: 1; }
:root[data-theme="light"] .theme-toggle__icon--sun { opacity: 1; transform: scale(1); }
:root[data-theme="light"] .theme-toggle__icon--moon { opacity: 0; transform: scale(0.5); }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent; transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s;
}
.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.85rem; }
.btn--full { width: 100%; }
.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #061018; box-shadow: 0 10px 30px -10px var(--accent);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px var(--accent); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(4rem, 12vh, 9rem) 0 5rem; text-align: center; }
.hero__inner { display: flex; flex-direction: column; align-items: center; }
.hero__title { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; max-width: 16ch; }
.hero__title .grad-text { display: block; }
.hero__lede { margin-top: 1.4rem; max-width: 56ch; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.2rem); }
.hero__actions { margin-top: 2.2rem; display: flex; gap: 0.9rem; flex-wrap: wrap; justify-content: center; }
.hero__stats { margin-top: 3.5rem; display: flex; gap: clamp(1.5rem, 5vw, 4rem); flex-wrap: wrap; justify-content: center; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: "Sora", sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; color: var(--text); }
.stat__label { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }
.hero__scroll { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 999px; }
.hero__scroll span { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 4px; height: 8px; border-radius: 4px; background: var(--accent); animation: scrolldot 1.8s infinite; }
@keyframes scrolldot { 0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 80% { opacity: 0; top: 22px; } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 10vh, 7rem) 0; position: relative; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section__title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 700; }
.section__head { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.section__sub { margin-top: 0.9rem; }
.section__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.section__grid .muted { margin-top: 1.1rem; }

.checklist { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.7rem; }
.checklist li { padding-left: 1.9rem; position: relative; color: var(--text); }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 1.35rem; height: 1.35rem;
  display: grid; place-items: center; border-radius: 50%; font-size: 0.72rem; font-weight: 700;
  color: #061018; background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

/* About card */
.about__card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 2rem; overflow: hidden; }
.about__card-glow { position: absolute; inset: auto -30% -50% -30%; height: 60%; background: radial-gradient(50% 60% at 50% 100%, var(--accent-soft), transparent 70%); }
.about__stack { display: flex; flex-wrap: wrap; gap: 0.6rem; position: relative; }
.about__stack span { padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 0.85rem; font-weight: 500; }
.about__card-note { margin-top: 1.4rem; color: var(--muted); font-size: 0.9rem; position: relative; }

/* ---------- Cards (services) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.card {
  padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Work / portfolio ---------- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.4rem; }
.work {
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.work:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent); }
.work__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.work__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.work:hover .work__media img { transform: scale(1.06); }
.work__badge {
  position: absolute; top: 0.8rem; left: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--border); color: var(--accent);
}
.work__body { padding: 1.3rem 1.4rem 1.5rem; }
.work__body h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.work__body p { color: var(--muted); font-size: 0.92rem; }
.work__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.work__tags span { font-size: 0.74rem; padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.work { cursor: pointer; }
.work:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.work__cta { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 1.1rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.work__cta span { transition: transform 0.25s var(--ease); }
.work:hover .work__cta span { transform: translateX(4px); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 8, 20, 0.72); backdrop-filter: blur(6px); animation: fade 0.25s var(--ease); }
.modal__dialog {
  position: relative; z-index: 1; width: min(100% - 2rem, 720px); max-height: 90vh; overflow: auto;
  margin: 5vh auto 0; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--border);
  background: var(--bg-2); box-shadow: var(--shadow); animation: pop 0.3s var(--ease);
}
.modal__close {
  position: absolute; top: 0.8rem; right: 0.8rem; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text);
  font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: border-color 0.2s, transform 0.2s;
}
.modal__close:hover { border-color: var(--accent); transform: rotate(90deg); }
.modal__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; }
.modal__body { padding: 1.6rem clamp(1.4rem, 4vw, 2.2rem) 2rem; }
.modal__badge { position: static; display: inline-block; margin-bottom: 0.9rem; }
.modal__body h3 { font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 0.9rem; }
.modal__desc { color: var(--muted); display: grid; gap: 0.8rem; }
.modal__desc p { color: var(--muted); }
.modal #modalTags { margin-top: 1.3rem; }
.modal__links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.modal__links a {
  display: inline-flex; align-items: center; padding: 0.6rem 1.1rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: border-color 0.2s, transform 0.2s;
}
.modal__links a:hover { border-color: var(--accent); transform: translateY(-2px); }
.modal__links a:first-child { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #061018; border-color: transparent; }
body.modal-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Process ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; counter-reset: step; }
.step { padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); position: relative; }
.step__num { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.6rem; color: transparent; -webkit-text-stroke: 1.5px var(--accent); display: block; margin-bottom: 0.8rem; }
.step h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.step p { color: var(--muted); font-size: 0.92rem; }

/* ---------- CTA / contact ---------- */
.cta { position: relative; text-align: center; border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); background: var(--surface); padding: clamp(2.2rem, 6vw, 4rem); overflow: hidden; }
.cta__glow { position: absolute; inset: -40% 20% auto 20%; height: 60%; background: radial-gradient(50% 60% at 50% 0%, var(--accent-soft), transparent 70%); }
.cta__title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 0.4rem 0 0.7rem; position: relative; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 620px; margin: 2rem auto 0; text-align: left; position: relative; }
.field { position: relative; }
.field--full { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; padding: 1.1rem 1rem 0.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.95rem; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field label { position: absolute; left: 1rem; top: 0.9rem; color: var(--muted); font-size: 0.95rem; pointer-events: none; transition: transform 0.18s var(--ease), font-size 0.18s, color 0.18s; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-0.7rem); font-size: 0.72rem; color: var(--accent);
}
.form-note { grid-column: 1 / -1; margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--accent); min-height: 1.1rem; }
.cta__alt { margin-top: 1.6rem; color: var(--muted); position: relative; }
.cta__alt a { color: var(--accent); font-weight: 600; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.footer__brand .brand__name { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.2rem; }
.footer__links { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.footer__links a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--text); }
.footer__social { display: flex; gap: 0.6rem; }
.footer__social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; font-weight: 600; color: var(--muted); transition: color 0.2s, border-color 0.2s, transform 0.2s; }
.footer__social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer__bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.footer__bottom p { font-size: 0.85rem; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0; padding: 1rem 1.25rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent); border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform 0.35s var(--ease); backdrop-filter: blur(14px);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
  .nav__links a::after { display: none; }
  .nav__burger { display: flex; }
  .nav__cta { display: none; }
  .section__grid { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .bg-aurora { animation: none; }
}
