@import url('https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&family=DM+Mono:wght@400;500&display=swap');

/* ==========================================================================
   MAIN.CSS — Global styles + homepage layout
   Ulises Arvizu Portfolio
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 · DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  --purple:  #8b44e8;
  --ink:     #f0f0ee;
  --muted:   #888;
  --muted2:  #E4E4E4;
  --border:  #252530;
  --borderscr:  #f1f1f1;
  --bg:      #12121a;
  --card:    #1a1a22;
  --card2:   #1e1e28;
  --hero-img-opacity: 0.5;
}

/* --------------------------------------------------------------------------
   02 · RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   03 · SCROLLBAR
   -------------------------------------------------------------------------- */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 2px; }

/* --------------------------------------------------------------------------
   04 · PROGRESS BAR
   -------------------------------------------------------------------------- */
#progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--purple);
  z-index: 300;
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   05 · NAVIGATION (shared between homepage + case studies)
   -------------------------------------------------------------------------- */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 1.25rem 2.5rem;
  display: flex; align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}

/* Homepage: nav-logo (appears on scroll past hero) */
.nav-logo {
  font-family: 'alegreya', monospace;
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--purple); text-decoration: none;
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
  margin-right: auto;
}
.nav-logo.visible { opacity: 1; pointer-events: auto; }

/* Case study: 3-group nav layout */
body:not(.page-home) .nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
}
body:not(.page-home) .nav-links {
  display: flex;
  align-items: center;
}
body:not(.page-home) .nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

/* Case study: nav-title (appears on scroll past hero) */
.nav-title {
  font-family: 'DM Mono', monospace;
  font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center;
  justify-self: center;
}
.nav-title.visible { opacity: 1; }

/* Homepage: nav links */
.nav-links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}
.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff !important;
  background: var(--purple);
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  text-decoration: none;
}
.nav-cta:hover { opacity: 0.85; }

/* --------------------------------------------------------------------------
   06 · HAMBURGER + MOBILE MENU
   -------------------------------------------------------------------------- */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 100%; height: 1.5px;
  background: var(--ink); border-radius: 2px;
}

.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 9999;
  flex-direction: column; justify-content: center;
  align-items: center; text-align: center;
  padding: 4rem 2rem;
}
.mobile-menu.open { display: flex; }
.mobile-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--ink); line-height: 1; padding: 0.5rem;
}
.mobile-theme-toggle {
  position: absolute; top: 1.25rem; left: 1.5rem;
}
.mobile-menu a {
  font-family: 'DM Mono', monospace;
  font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 400; line-height: 1.5;
  color: var(--ink); text-decoration: none;
  display: block; transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--purple); }
.mobile-menu .m-cta {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: var(--purple);
  padding: 0.75rem 1.5rem; border-radius: 4px;
  margin-top: 1.5rem; display: inline-block;
}
.mobile-footer {
  position: absolute; bottom: 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   07 · TICKER (shared)
   -------------------------------------------------------------------------- */
.ticker {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0; overflow: hidden; white-space: nowrap;
  background: rgba(8, 8, 8, .3);
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
}
.ticker-inner { display: inline-flex; animation: ticker 28s linear infinite; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
}
.ticker-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--purple); flex-shrink: 0;
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

hr.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* --------------------------------------------------------------------------
   08 · SECTION BASE + TYPOGRAPHY
   -------------------------------------------------------------------------- */
section { max-width: 1200px; margin: 0 auto; padding: 6rem clamp(1rem, 4vw, 2.5rem); }

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1rem;
}

h2 {
  font-family: 'Alegreya', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em; margin-bottom: 2rem;
}
h2 em { font-style: italic; color: var(--purple); }

h3 {
  font-family: 'Alegreya', serif;
  font-size: 1.4rem; font-weight: 700;
  line-height: 1.25; margin-bottom: 0.75rem;
}

p { margin-bottom: 1.4rem; max-width: 68ch; font-size: 1rem; line-height: 1.8; color: var(--ink); }
p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   09 · ANIMATIONS (shared)
   -------------------------------------------------------------------------- */
.fade-up {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

.hero-left, .cs-hero-anim {
  width: 100%;
  opacity: 0;
  animation: fadeUp 0.85s ease forwards 0.2s;
  position: relative; z-index: 2;
  margin-top: auto; margin-bottom: auto;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   10 · STATS ROW (shared by homepage About + case study Results)
   -------------------------------------------------------------------------- */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 4rem;
}
.stat-cell { background: var(--card); padding: 2rem 1.75rem; }
.stat-num {
  font-family: 'Alegreya', serif;
  font-size: 3rem; font-weight: 700;
  color: var(--purple); line-height: 1; margin-bottom: 0.5rem;
}
.stat-lbl {
  font-size: 0.78rem; color: var(--muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em; text-transform: uppercase;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   11 · QUOTE SECTION (shared)
   -------------------------------------------------------------------------- */
.quote-section {
 text-align: center;
  padding: 6rem 2.5rem;
}
.quote-inner { max-width: 780px; margin: 0 auto; }
.quote-text {
  font-family: 'Alegreya', serif; font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 700;
  line-height: 1.45; color: var(--ink); margin-bottom: 1.5rem;
}
.quote-text em { font-style: normal; color: var(--purple); }
.quote-author {
  font-family: 'DM Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   12 · FOOTER (shared)
   -------------------------------------------------------------------------- */
.footer-wrapper {
  background: #080808;
  border-top: 1px solid var(--border);
}
footer { 
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
  max-width: 1200px; margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 240px 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.footer-brand {
  font-family: 'Alegreya', serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700;
  line-height: 0.9;
  transition: color 0.3s; cursor: default;
}
.footer-brand:hover { color: var(--purple); }
.footer-brand span { color: var(--purple); }
.footer-tagline {
  font-size: 1rem; color: var(--ink);
  margin-top: 0.75rem; line-height: 1.6; max-width: 24ch;
  font-family: 'DM Sans', sans-serif;
}
.footer-col-title {
  font-family: 'DM Mono', monospace;
  font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 1rem;
}
.footer-link {
  display: block; font-size: 1rem;
  color: var(--muted); text-decoration: none;
  margin-bottom: 0.6rem; transition: color 0.2s;
}
.footer-link:hover { color: var(--purple); }
.footer-bottom {
  display: flex; justify-content: space-between;
  align-items: center; padding-top: 1.5rem;
}
.footer-copy {
  font-family: 'DM Sans', sans-serif; font-size:1rem;
  color: var(--ink); letter-spacing: 0.05em;
}
.footer-bottom .footer-copy { margin: 0; }
/* ==========================================================================
   HOMEPAGE-SPECIFIC STYLES
   ========================================================================== */

/* --------------------------------------------------------------------------
   13 · HERO (homepage)
   -------------------------------------------------------------------------- */
.hero-wrapper {
  position: relative;
}
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 80px clamp(1rem, 4vw, 2.5rem) 5rem;
  max-width: 1200px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.hero-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.hero-meta::before {
  content: ''; display: block;
  width: 2rem; height: 2px; background: var(--purple); flex-shrink: 0;
}
.hero h1 {
  font-family: 'Alegreya', serif;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 1.0; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 1.5rem;
}
.hero h1 .name { color: var(--purple); }
.hero-desc {
  font-size: 1rem; color: var(--ink);
  max-width: 52ch; line-height: 1.8; margin-bottom: 2rem;
  text-shadow: 0 1px 12px rgba(0,0,0,0.9);
}
.hero-desc strong { color: var(--ink); font-weight: 700; 
}
.hero-scroll-wrapper {
  position: absolute;
  bottom: 5rem;
  left: 0; right: 0;
  max-width: 1200px;
  margin: 0 auto;
  pointer-events: none;
  padding: 0 2.5rem;
  z-index: 2;
}
.hero-scroll {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
  width: 100%;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink);
  pointer-events: auto;
}
.scroll-line { width: 36px; height: 1px; background: var(--borderscr); }

/* --------------------------------------------------------------------------
   14 · ABOUT (homepage)
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 5rem; align-items: start;
}
.about-body {
  font-size: 1rem; line-height: 1.8;
  color: var(--ink); margin-bottom: 2rem;
}
.about-body strong { color: var(--ink); font-weight: 500; }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  padding: 0.4rem 0.8rem; border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--purple); color: var(--purple); }

/* --------------------------------------------------------------------------
   15 · PROJECTS LIST (homepage — single column)
   -------------------------------------------------------------------------- */
.projects-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 3rem;
}
.view-all {
  font-family: 'DM Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--purple); text-decoration: none;
  border-bottom: 1px solid var(--purple);
  padding-bottom: 2px; transition: opacity 0.2s;
}
.view-all:hover { opacity: 0.65; }

.projects-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.project-list-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas:
    "tag"
    "image"
    "title"
    "meta";
  background: var(--card);
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  transition: background 0.25s;
}
.project-list-card .project-tag {
  grid-area: tag;
  padding: 1.5rem 2rem 1rem;
}
.project-list-card .project-image {
  grid-area: image;
  padding: 0 2rem;
}
.project-list-card .project-image img {
  width: 100%;
  object-fit: cover; display: block;
  border-radius: 6px;
  background: var(--card2);
}
.project-list-card .project-info {
  grid-area: title;
  display: flex; flex-direction: column;
  padding: 1.25rem 2rem 0.5rem;
  gap: 0.6rem;
}
.project-list-card .project-meta {
  grid-area: meta;
  padding: 1rem 2rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.project-list-card:hover { background: #1a0a2e; }
.project-list-card:hover::before { transform: scaleX(1);
}
.project-tag {
  font-family: 'DM Mono', monospace; font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 0.75rem;
}
.project-title {
  font-family: 'Alegreya', serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1;
  color: var(--ink); margin-bottom: 1.5rem;
}
.project-image {
  width: 100%;
  overflow: hidden; margin-bottom: 1rem;
}
.project-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.project-desc {
  font-size: 1rem; line-height: 1.8;
  color: var(--ink); max-width: 72ch;
  margin-bottom: 2rem;
}
.project-meta {
  display: flex; align-items: center; justify-content: space-between;
}
.project-year {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  color: var(--ink); letter-spacing: 0.08em;
}
.project-arrow {
  width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.project-list-card:hover .project-arrow {
  border-color: var(--purple); background: var(--purple);
}
.project-list-card:hover .project-arrow svg path { stroke: #fff; }

/* --------------------------------------------------------------------------
   16 · NEWSLETTER (homepage)
   -------------------------------------------------------------------------- */
.newsletter-section {
  background: var(--card1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6rem 0;
}
.newsletter-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.newsletter-header { margin-bottom: 4rem; }
.newsletter-headline {
  font-family: 'Alegreya', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1; max-width: 680px; margin-bottom: 1rem;
}
.newsletter-headline em { font-style: italic; color: var(--purple); }
.newsletter-sub { font-size: 1rem; color: var(--ink); line-height: 1.8; }

.newsletter-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.newsletter-col { background: var(--card); padding: 2.5rem; }
.col-lang { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; }
.lang-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: var(--purple);
  padding: 0.3rem 0.65rem; border-radius: 4px;
}
.lang-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--muted);
}
.article-list { list-style: none; }
.article-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.1rem 0; border-bottom: 1px solid var(--border);
  gap: 1rem; cursor: pointer; transition: border-color 0.2s;
}
.article-item:last-child { border-bottom: none; }
.article-item:hover { border-color: var(--purple); }
.article-num {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  color: var(--ink); font-weight: 500;
  letter-spacing: 0.08em; flex-shrink: 0; margin-top: 3px;
}
.article-title {
  font-size: 0.9rem; line-height: 1.45;
  color: var(--ink); transition: color 0.2s;
}
.article-item:hover .article-title { color: var(--purple); }
.article-link {
  display: contents;
}
.article-titles {
  display: flex; flex-direction: column; gap: 0.15rem; flex: 1;
}
.article-subtitle {
  font-size: 0.78rem; color: var(--muted); line-height: 1.4;
}
.article-arrow {
  font-size: 1rem; color: var(--ink);
  flex-shrink: 0; margin-top: 2px;
  transition: color 0.2s, transform 0.2s;
}
.article-item:hover .article-arrow {
  color: var(--purple); transform: translateX(3px);
}
.col-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1.75rem;
  font-family: 'DM Mono', monospace; font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--purple); text-decoration: none;
  border-bottom: 1px solid var(--purple);
  padding-bottom: 2px; transition: opacity 0.2s;
}
.col-cta:hover { opacity: 0.65; }

/* --------------------------------------------------------------------------
   HERO IMAGE
   -------------------------------------------------------------------------- */
.hero-image {
  position: absolute;
  right: 0; bottom: 0;
  height: 100%;
  display: flex; align-items: flex-end;
  pointer-events: none;
  z-index: 1;
}
.hero-image img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: bottom;
  opacity: var(--hero-img-opacity);
}

/* --------------------------------------------------------------------------
   NEWSLETTER CARDS — artículos dinámicos desde Substack
   -------------------------------------------------------------------------- */
.article-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.article-card:last-child { border-bottom: none; }
.article-card:hover { background: #1a0a2e; }
.article-thumb {
  width: 56px; height: 44px; flex-shrink: 0;
  background: var(--card2); border-radius: 4px; overflow: hidden;
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.article-arrow-icon { flex-shrink: 0; margin-top: 2px; }


/* ==========================================================================
   CASE STUDY — New classes
   Added for Juum (and reusable across other case studies)
   ========================================================================== */

/* --------------------------------------------------------------------------
   CS · HERO
   -------------------------------------------------------------------------- */
.cs-hero {
  padding: 120px clamp(1rem, 4vw, 2.5rem) 3rem;
  max-width: 1200px; margin: 0 auto;
  position: relative;
}
.cs-hero-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.cs-hero-meta::before {
  content: ''; display: block;
  width: 2rem; height: 2px; background: var(--purple); flex-shrink: 0;
}
.cs-hero-anim h1 {
  font-family: 'Alegreya', serif;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.0; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 1.5rem;
}
.cs-hero-anim h1 em { font-style: italic; color: var(--purple); }
.cs-hero-sub {
  font-size: 1rem; color: var(--ink);
  max-width: 62ch; line-height: 1.8; margin-bottom: 3rem;
}
.cs-hero-sub strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   CS · META TABLE  (role / team / duration / platform)
   -------------------------------------------------------------------------- */
.meta-table {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 3rem;
}
.meta-cell {
  background: var(--card); padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.meta-cell:last-child { border-right: none; border-bottom: none; }
.meta-cell:empty { background: transparent; border: none; }
.meta-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.4rem;
}
.meta-value {
  font-size: 1rem; color: var(--ink);
  font-weight: 500; line-height: 1.4;
}

/* --------------------------------------------------------------------------
   CS · RESULTS TABLE  (shown early + repeated at end)
   -------------------------------------------------------------------------- */
.cs-results-wrap {
  margin: 2.5rem 0;
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.cs-results-table {
  width: 100%; border-collapse: collapse;
}
.cs-results-table thead tr {
  background: var(--card2);
}
.cs-results-table th {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); padding: 0.9rem 1.5rem;
  text-align: left; border-bottom: 1px solid var(--border);
  font-weight: 400;
}
.cs-results-table td {
  background: var(--card);
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem; line-height: 1.5;
  vertical-align: middle;
}
.cs-results-table tr:last-child td { border-bottom: none; }
.cs-results-table .col-metric {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); width: 36%;
}
.cs-results-table .col-value {
  font-family: 'Alegreya', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--purple); width: 22%;
}
.cs-results-table .col-context {
  font-size: 0.88rem; color: var(--muted);
  width: 42%;
}

/* --------------------------------------------------------------------------
   CS · SECTION  (case study body sections)
   -------------------------------------------------------------------------- */
.cs-section {
  max-width: 1200px; margin: 0 auto;
  padding: 6rem clamp(1rem, 4vw, 2.5rem);
}

/* --------------------------------------------------------------------------
   CS · HERO IMAGE FULL BLEED
   -------------------------------------------------------------------------- */
.cs-hero-image {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem;
  overflow: hidden;
}
.cs-hero-image img, .cs-hero-image svg { width: 100%; display: block; }

/* --------------------------------------------------------------------------
   CS · IMAGE HELPERS
   -------------------------------------------------------------------------- */
.img-full {
  width: 100%; margin: 3rem 0;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.img-placeholder {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-end;
  min-height: 320px; overflow: hidden;
}
.img-placeholder svg { display: block; width: 100%; }
.img-placeholder-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.80rem; letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--ink); padding: 0.75rem 1.5rem;
  background: var(--card2);
  border-top: 1px solid var(--border);
  text-align: left; width: 100%;
}
.img-half {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin: 3rem 0;
}

/* --------------------------------------------------------------------------
   CS · CALLOUT
   -------------------------------------------------------------------------- */
.callout {
  background: var(--card2);
  border-left: 3px solid var(--purple);
  border-radius: 0 8px 8px 0;
  padding: 1.75rem 2rem;
  margin: 2.5rem 0;
}
.callout p { max-width: none; font-size: 1rem; line-height: 1.8; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   CS · FLOW DIAGRAM  (Register → Profile → Record → Edit → Publish → Discover)
   -------------------------------------------------------------------------- */
.cs-flow {
  display: flex; align-items: stretch;
  margin: 2.5rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.cs-flow-step {
  flex: 1; padding: 1.5rem 0.75rem;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem;
  transition: background 0.2s;
}
.cs-flow-step:last-child { border-right: none; }
.cs-flow-step.active {
  background: rgba(139,68,232,0.1); color: var(--purple);
}
.cs-flow-step-num {
  font-size: 1.4rem; font-family: 'Alegreya', serif;
  font-weight: 700; color: var(--border); line-height: 1;
}
.cs-flow-step.active .cs-flow-step-num { color: var(--purple); opacity: 0.3; }

/* --------------------------------------------------------------------------
   CS · FRICTION / DETAIL CARDS  (3-up grid)
   -------------------------------------------------------------------------- */
.cs-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin: 2.5rem 0;
}
.cs-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 1.75rem;
}
.cs-card-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 0.75rem;
}
.cs-card h3 { margin-bottom: 0.5rem; }
.cs-card p,
.retro-card p {
  font-size: 1rem; color: var(--ink);
  line-height: 1.8; margin: 0; max-width: none;
}

/* --------------------------------------------------------------------------
   CS · TWO COLUMN (body content)
   -------------------------------------------------------------------------- */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: start;
}
.two-col-even {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: start;
}
.two-col p, .two-col-even p { max-width: none; }

/* --------------------------------------------------------------------------
   CS · RETROSPECTIVE
   -------------------------------------------------------------------------- */
.retro-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 3rem;
}
.retro-card {
  background: var(--card); padding: 2rem 1.75rem;
  transition: background 0.25s;
}
.retro-card:hover { background: #1a0a2e; }
.retro-card.full { grid-column: 1 / -1; }
.retro-card-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 0.75rem;
}
.retro-card h3 { margin-bottom: 0.75rem; }

/* --------------------------------------------------------------------------
   CS · NEXT PROJECT
   -------------------------------------------------------------------------- */
.next-project {
  border-top: 1px solid var(--border);
  padding: 4rem clamp(1rem, 4vw, 2.5rem);
  max-width: 1200px; margin: 0 auto;
}
.next-inner {
  display: flex; justify-content: space-between; align-items: center;
}
.next-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.5rem;
}
.next-title {
  font-family: 'Alegreya', serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700;
  line-height: 1.1;
}
.next-arrow-btn {
  width: 56px; height: 56px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.next-arrow-btn:hover { border-color: var(--purple); background: var(--purple); }
.next-arrow-btn:hover svg path { stroke: #fff; }

/* --------------------------------------------------------------------------
   CS · COMPACT FOOTER  (case study pages)
   -------------------------------------------------------------------------- */
.cs-footer-wrap {
  background: #080808;
  border-top: 1px solid var(--border);
}
.cs-footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3rem clamp(1rem, 4vw, 2.5rem);
  max-width: 1200px; margin: 0 auto;
}
.footer-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem;
}
.footer-email {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem; color: var(--muted);
  text-decoration: none; letter-spacing: 0.04em;
  transition: color 0.2s;
}
.footer-email:hover { color: var(--purple); }
.footer-links { display: flex; gap: 1.5rem; margin-top: 0.25rem; }
.footer-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--purple); }
.footer-copy-cs {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  letter-spacing: 0.08em; color: var(--muted);
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   CS · BLOCK WRAPPERS  (research / content sections)
   -------------------------------------------------------------------------- */
.cs-block       { margin-top: 3rem; }
.cs-block-sm    { margin-top: 2rem; }
.cs-block-lg    { margin-top: 4rem; }
.cs-block h3,
.cs-block-lg h3 { margin-bottom: 0.75rem; }

/* --------------------------------------------------------------------------
   CS · CALLOUT LARGE  (hardest decision, key insight)
   -------------------------------------------------------------------------- */
.callout-lg {
  margin-top: 3rem;
  padding: 2rem 2.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: 0 10px 10px 0;
}
.callout-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 0.75rem;
}
.callout-lg h3  { margin-bottom: 0.5rem; }
.callout-lg p   { max-width: none; font-size: 1rem; }

/* --------------------------------------------------------------------------
   CS · PRINCIPLES GRID  (P.01 / P.02 / P.03)
   -------------------------------------------------------------------------- */
.principles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 3rem;
}
.principle-cell {
  background: var(--card); padding: 2rem 1.75rem;
  transition: background 0.25s;
}
.principle-cell:hover { background: #1a0a2e; }
.principle-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; color: var(--purple);
  letter-spacing: 0.12em; margin-bottom: 1rem;
}
.principle-cell h3 { margin-bottom: 0.5rem; }
.principle-cell p  { font-size: 1rem; max-width: none; }

/* --------------------------------------------------------------------------
   CS · ANATOMY LIST  (numbered slots)
   -------------------------------------------------------------------------- */
.anatomy-list {
  margin-top: 3rem;
  display: flex; flex-direction: column;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.anatomy-item {
  background: var(--card); padding: 1.75rem 2rem;
  display: grid; grid-template-columns: 2.5rem 1fr;
  gap: 1.5rem; align-items: start;
  transition: background 0.25s;
}
.anatomy-item:hover { background: #1a0a2e; }
.anatomy-num {
  font-family: 'Alegreya', serif;
  font-size: 1.75rem; font-weight: 700;
  color: var(--purple); line-height: 1; padding-top: 0.2rem;
}
.anatomy-item h3 { margin-bottom: 0.3rem; }
.anatomy-item p  { font-size: 0.88rem; max-width: none; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   CS · FIVE PATTERNS  (interaction pattern row)
   -------------------------------------------------------------------------- */
.five-patterns {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 2rem;
}
.five-pattern-cell {
  background: var(--card); padding: 1.5rem 1.25rem;
  transition: background 0.25s;
}
.five-pattern-cell:hover { background: #1a0a2e; }
.five-pattern-cell h3 { margin-bottom: 0.35rem; }
.five-pattern-cell p  { font-size: 0.88rem; max-width: none; line-height: 1.6; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   CS · PATTERN GRID  (sub-patterns — vertical, full width)
   -------------------------------------------------------------------------- */
.pattern-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 2rem;
}
.pattern-card {
  background: var(--card); padding: 2rem 1.75rem;
  position: relative; overflow: hidden;
  transition: background 0.25s;
}
.pattern-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--purple);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s;
}
.pattern-card:hover { background: #1a0a2e; }
.pattern-card:hover::before { transform: scaleX(1); }
.pattern-tag {
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 1rem;
}
.pattern-card h3 { margin-bottom: 0.5rem; }
.pattern-card p  { font-size: 1rem; max-width: none; margin-bottom: 1rem; }
.pattern-uses {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem;
}
.use-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  padding: 0.3rem 0.65rem; border-radius: 4px;
}
.pattern-img {
  margin-top: 1.5rem;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border);
}
.pattern-img img {
  width: 100%; height: auto; display: block;
}

/* --------------------------------------------------------------------------
   CS · BREAKPOINTS ROW
   -------------------------------------------------------------------------- */
.breakpoints-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 3rem;
}
.bp-cell {
  background: var(--card); padding: 1.5rem 1.25rem;
  text-align: center; transition: background 0.25s;
}
.bp-cell:hover { background: #1a0a2e; }
.bp-size {
  font-family: 'Alegreya', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--purple); line-height: 1; margin-bottom: 0.4rem;
}
.bp-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); line-height: 1.5;
}

/* --------------------------------------------------------------------------
   CS · NAV LANGUAGE SWITCHER
   -------------------------------------------------------------------------- */
.nav-lang {
  font-family: 'DM Mono', monospace !important;
  font-size: 0.62rem !important; letter-spacing: 0.08em;
  color: var(--muted) !important;
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem; border-radius: 4px;
  text-decoration: none !important;
  transition: border-color 0.2s, color 0.2s;
}
.nav-lang:hover { border-color: var(--purple) !important; color: var(--purple) !important; }

/* --------------------------------------------------------------------------
   THEME TOGGLE BUTTON
   -------------------------------------------------------------------------- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 32px;
  padding: 0 0.65rem;
  cursor: pointer;
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--purple); }
.theme-toggle .icon-moon  { display: none; }
.theme-toggle .label-dark { display: none; }
[data-theme="light"] .theme-toggle .icon-sun   { display: none; }
[data-theme="light"] .theme-toggle .icon-moon  { display: block; }
[data-theme="light"] .theme-toggle .label-light { display: none; }
[data-theme="light"] .theme-toggle .label-dark  { display: inline; }

/* --------------------------------------------------------------------------
   LIGHT THEME
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --purple:    #7a36d4;
  --ink:       #111118;
  --muted:     #666666;
  --muted2:    #444444;
  --border:    #e0e0dc;
  --borderscr: #c8c8c4;
  --bg:        #f9f9f7;
  --card:      #ffffff;
  --card2:     #f2f2f0;
  --hero-img-opacity: 0.8;
}
[data-theme="light"] nav {
  background: rgba(249, 249, 247, 0.92);
}
[data-theme="light"] .ticker {
  background: rgba(249, 249, 247, 0.50);
}
[data-theme="light"] .footer-wrapper {
  background: #efefed;
}
[data-theme="light"] footer {
  background: #efefed;
}
[data-theme="light"] .project-list-card:hover,
[data-theme="light"] .article-card:hover,
[data-theme="light"] .retro-card:hover,
[data-theme="light"] .principle-cell:hover,
[data-theme="light"] .anatomy-item:hover,
[data-theme="light"] .five-pattern-cell:hover,
[data-theme="light"] .pattern-card:hover,
[data-theme="light"] .bp-cell:hover { background: #ede6fb; }
[data-theme="light"] .hero-desc { text-shadow: none; }
[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg); }

.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, opacity 0.4s ease !important;
}
