/* ═══════════════════════════════════════════════════════════
   loriel.software/work — Case Study Stylesheet
   3D · Glassmorphism · Modern aesthetic
   Inherits CSS variables from main site theme
   ═══════════════════════════════════════════════════════════ */

/* ── THEME VARIABLES (standalone — matches main site) ──────── */
:root,
[data-theme="cream"] {
  --bg:          #F5F0E8;
  --bg-alt:      #EDE7D9;
  --fg:          #0D0D0D;
  --fg-mid:      #2A2A2A;
  --fg-soft:     #6B6B6B;
  --fg-faint:    #ADADAD;
  --accent:      #C8FF00;
  --accent-dim:  rgba(200,255,0,0.12);
  --rule:        rgba(13,13,13,0.12);
  --header-bg:   rgba(245,240,232,0.88);
  --card-bg:     #0D0D0D;
  --card-fg:     #F5F0E8;
  --tag-bg:      rgba(13,13,13,0.06);
  --tag-fg:      #2A2A2A;
  --serif:       'Cormorant Garamond', Georgia, serif;
  --mono:        'DM Mono', 'Courier New', monospace;
  --sans:        'Instrument Sans', system-ui, sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ── CURSOR ─────────────────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: multiply;
}
.cursor--hover {
  width: 32px; height: 32px;
  opacity: 0.6;
}
@media (hover: none) { .cursor { display: none; } body { cursor: auto; } }

/* ── NAV ────────────────────────────────────────────────────── */
.work-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--rule);
}
.work-nav__back {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--fg-soft);
  transition: color 0.2s;
}
.work-nav__back:hover { color: var(--fg); }
.work-nav__right { display: flex; align-items: center; gap: 1.25rem; }
.work-nav__label {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--fg-faint); letter-spacing: 0.05em;
}
.work-nav__live {
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.3rem 0.75rem; border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.work-nav__live:hover {
  background: var(--accent); color: #0D0D0D;
}

/* ── HERO ───────────────────────────────────────────────────── */
.cs-hero {
  min-height: 100svh;
  padding-top: 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* Background orbs + grid */
.cs-hero__bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
}
.cs-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orb-float 8s ease-in-out infinite alternate;
}
.cs-hero__orb--1 {
  width: 500px; height: 500px;
  top: -100px; right: -100px;
  background: radial-gradient(circle, rgba(200,255,0,0.15), transparent 70%);
}
.cs-hero__orb--2 {
  width: 400px; height: 400px;
  bottom: 10%; left: -80px;
  background: radial-gradient(circle, rgba(200,255,0,0.07), transparent 70%);
  animation-delay: -4s;
}
.cs-hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 100%);
  opacity: 0.5;
}

@keyframes orb-float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, -20px) scale(1.1); }
}

.cs-hero__content {
  padding-block: 4rem 3rem;
  animation: fade-up 0.8s ease both;
}
.cs-hero__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.cs-hero__title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.cs-hero__title em {
  font-style: italic;
  color: var(--fg-soft);
}
.cs-hero__sub {
  font-size: 1.05rem;
  color: var(--fg-soft);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.cs-hero__stack {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}

/* ── 3D DEVICE MOCKUP ───────────────────────────────────────── */
.cs-hero__device-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding-block: 3rem;
  animation: fade-up 0.8s 0.2s ease both;
}
.cs-device {
  position: relative;
  width: 480px;
  border-radius: 20px;
  background: #0D0D0D;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 20px 60px rgba(0,0,0,0.35),
    0 4px 12px rgba(0,0,0,0.2);
  transform: perspective(1000px) rotateY(-8deg) rotateX(3deg);
  transform-origin: center center;
  transition: transform 0.6s ease;
  will-change: transform;
}
.cs-device:hover {
  transform: perspective(1000px) rotateY(-2deg) rotateX(1deg) translateY(-8px);
}
.cs-device__screen {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/10;
}
.cs-device__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cs-device__notch {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
.cs-device__shine {
  position: absolute; inset: 0;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.08) 0%,
    transparent 50%,
    rgba(0,0,0,0.05) 100%
  );
  pointer-events: none;
}
.cs-device__shadow {
  position: absolute;
  bottom: -30px; left: 10%; right: 10%;
  height: 40px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.25), transparent 70%);
  filter: blur(20px);
}

/* ── TAGS ───────────────────────────────────────────────────── */
.cs-tag {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  background: var(--tag-bg); color: var(--fg-soft);
  border: 1px solid var(--rule);
}
.cs-tag--live {
  background: rgba(34,197,94,0.1); color: #22c55e;
  border-color: rgba(34,197,94,0.25);
}
.project-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 0.72rem;
  padding: 0.25rem 0.65rem; border-radius: 4px;
  background: var(--tag-bg); color: var(--tag-fg);
  border: 1px solid var(--rule);
}

/* ── STATS ──────────────────────────────────────────────────── */
.cs-stats {
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-alt);
}
.cs-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
.cs-stats__num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--fg);
}
.cs-stats__label {
  display: block;
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--fg-soft); letter-spacing: 0.05em;
  margin-top: 0.5rem;
  text-transform: uppercase;
}

/* ── BROWSER MOCKUP / LIVE PREVIEW ─────────────────────────── */
.cs-preview {
  padding: clamp(4rem, 8vw, 7rem) 0;
}
.cs-browser {
  margin-top: 2.5rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--rule),
    0 24px 80px rgba(0,0,0,0.15),
    0 4px 12px rgba(0,0,0,0.08);
  background: var(--card-bg);
  transform: perspective(2000px) rotateX(2deg);
  transition: transform 0.4s ease;
}
.cs-browser:hover {
  transform: perspective(2000px) rotateX(0deg);
}
.cs-browser__bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cs-browser__dots {
  display: flex; gap: 6px;
}
.cs-browser__dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.cs-browser__dots span:nth-child(1) { background: #ff5f57; }
.cs-browser__dots span:nth-child(2) { background: #febc2e; }
.cs-browser__dots span:nth-child(3) { background: #28c840; }
.cs-browser__url {
  flex: 1;
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
  padding: 0.3rem 0.75rem; border-radius: 6px;
}
.cs-browser__open {
  display: flex; align-items: center;
  color: rgba(255,255,255,0.3);
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.cs-browser__open:hover { color: var(--accent); background: rgba(200,255,0,0.08); }
.cs-browser__viewport {
  position: relative;
  height: 600px;
  overflow: hidden;
}
.cs-browser__iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}
.cs-browser__fallback {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(13,13,13,0.95);
  text-align: center;
}
.cs-browser__fallback.visible {
  display: flex;
}
.cs-browser__fallback-inner { padding: 2rem; }
.cs-fallback-icon { font-size: 3rem; margin-bottom: 1rem; }
.cs-browser__fallback p {
  color: rgba(255,255,255,0.5); margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ── SECTIONS ───────────────────────────────────────────────── */
.cs-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}
.cs-section--alt {
  background: var(--bg-alt);
}
.cs-section-label {
  font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 1rem;
}
.cs-section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  font-weight: 300; line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.cs-section-sub {
  font-size: 1rem; color: var(--fg-soft);
  max-width: 560px; line-height: 1.7;
  margin-bottom: 2rem;
}

/* Two column layout */
.cs-two-col {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  align-items: start;
}
.cs-col-label { padding-top: 0.25rem; }

/* ── CARD ───────────────────────────────────────────────────── */
.cs-card {
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 2rem;
  border: 1px solid var(--rule);
}
.cs-card--highlight {
  background: var(--card-bg);
  color: var(--card-fg);
  border-color: transparent;
}
.cs-card h3 {
  font-family: var(--serif); font-size: 1.2rem;
  font-weight: 400; margin-bottom: 1rem;
  color: inherit;
}
.cs-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.6rem;
}
.cs-list li {
  display: flex; gap: 0.75rem; font-size: 0.9rem; line-height: 1.5;
  color: rgba(245,240,232,0.8);
}
.cs-list li::before {
  content: '→';
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* ── FEATURE GRID ───────────────────────────────────────────── */
.cs-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.cs-feature {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--bg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cs-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
.cs-feature__icon {
  font-size: 1.5rem; margin-bottom: 0.75rem;
}
.cs-feature h4 {
  font-family: var(--sans); font-size: 0.9rem;
  font-weight: 600; margin-bottom: 0.5rem;
}
.cs-feature p {
  font-size: 0.85rem; color: var(--fg-soft); line-height: 1.6;
}

/* ── STACK GRID ─────────────────────────────────────────────── */
.cs-stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.cs-stack-item {
  padding: 1.5rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.cs-stack-item:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
}
.cs-stack-item__icon {
  font-family: var(--mono); font-size: 1.1rem;
  color: var(--accent); margin-bottom: 0.75rem;
  font-weight: 600;
}
.cs-stack-item__name {
  font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem;
}
.cs-stack-item__role {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--fg-soft);
}

/* ── CTA ────────────────────────────────────────────────────── */
.cs-cta {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--card-bg);
  color: var(--card-fg);
}
.cs-cta__inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
}
.cs-cta__orb {
  position: absolute;
  width: 400px; height: 400px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(200,255,0,0.12), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.cs-cta__title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300; margin-bottom: 1rem;
  position: relative;
}
.cs-cta__sub {
  font-size: 1rem;
  color: rgba(245,240,232,0.65);
  max-width: 440px; margin: 0 auto 2.5rem;
  line-height: 1.7;
  position: relative;
}
.cs-cta__actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  position: relative;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.cs-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.03em;
  padding: 0.75rem 1.5rem; border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.cs-btn--primary {
  background: var(--accent); color: #0D0D0D;
  border-color: var(--accent);
}
.cs-btn--primary:hover {
  background: #d4ff1a; transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,255,0,0.3);
}
.cs-btn--ghost {
  background: transparent;
  color: var(--card-fg);
  border-color: rgba(245,240,232,0.2);
}
.cs-btn--ghost:hover {
  border-color: rgba(245,240,232,0.5);
  background: rgba(245,240,232,0.05);
}

/* ── MORE WORK ──────────────────────────────────────────────── */
.cs-more {
  padding: clamp(4rem, 8vw, 7rem) 0;
}
.cs-more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.cs-more-card {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.cs-more-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
.cs-more-card__img {
  width: 80px; height: 56px;
  object-fit: cover; border-radius: 8px;
  flex-shrink: 0;
}
.cs-more-card__body { flex: 1; min-width: 0; }
.cs-more-card__body h3 {
  font-size: 0.9rem; font-weight: 600;
  margin: 0.35rem 0 0.25rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cs-more-card__body p {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--fg-soft);
}
.cs-more-card__arrow {
  color: var(--fg-faint); font-size: 1.1rem;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}
.cs-more-card:hover .cs-more-card__arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.cs-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
}
.cs-footer .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.cs-footer span, .cs-footer a {
  font-family: var(--mono); font-size: 0.8rem; color: var(--fg-soft);
}
.cs-footer a { transition: color 0.2s; }
.cs-footer a:hover { color: var(--accent); }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cs-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 6rem;
    gap: 2rem;
  }
  .cs-hero__device-wrap {
    order: -1;
    padding-block: 1rem;
  }
  .cs-device {
    width: 100%;
    max-width: 480px;
    transform: none;
  }
  .cs-device:hover { transform: none; }
  .cs-two-col { grid-template-columns: 1fr; gap: 1.5rem; }
  .cs-col-label { display: none; }
  .cs-stats__grid { grid-template-columns: repeat(2, 1fr); }
  .cs-feature-grid { grid-template-columns: 1fr; }
  .cs-more-grid { grid-template-columns: 1fr; }
  .cs-browser { transform: none; }
  .cs-browser__viewport { height: 400px; }
}
@media (max-width: 480px) {
  .cs-stats__grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .cs-browser__viewport { height: 300px; }
  .cs-stack-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-more-card { flex-direction: column; align-items: flex-start; }
  .cs-more-card__img { width: 100%; height: 100px; }
}
