/* ==========================================================================
   uriel ("uriellite") — portfolio
   aesthetic: minimalistic, artistic, lazy-like, book-like, all lowercase
   typography: instrument serif + inter tight + jetbrains mono
   procedural motion & lenis smooth scroll integration
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (Paper & Ink Modes)
   -------------------------------------------------------------------------- */
:root {
  /* Paper Mode (Default Warm Editorial) */
  --bg-page: #fbfaf6;
  --bg-surface: #f3f1eb;
  --bg-hover: #ece9e0;
  
  --text-main: #191918;
  --text-muted: #6b6963;
  --text-dim: #94928b;
  
  --border-hairline: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.16);

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1060px;
  --gutter: 24px;
  --header-h: 68px;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition: 0.28s var(--ease-spring);
}

/* Ink Mode (Dark Bookish Slate) */
[data-theme="ink"] {
  --bg-page: #121211;
  --bg-surface: #1a1a18;
  --bg-hover: #22221f;

  --text-main: #edebe4;
  --text-muted: #8e8c84;
  --text-dim: #61605a;

  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
}

/* --------------------------------------------------------------------------
   2. Lenis Smooth Scroll Essential Rules
   -------------------------------------------------------------------------- */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

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

html {
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  text-transform: lowercase; /* strict all lowercases rule */
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
  text-transform: lowercase;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Top subtle reading progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1.5px;
  width: 0%;
  background: var(--text-main);
  z-index: 9999;
  opacity: 0.55;
  transition: width 0.08s linear;
}

/* --------------------------------------------------------------------------
   4. Procedural Animations (Hero & Scroll-Triggered)
   -------------------------------------------------------------------------- */
/* Hero initial pop & glide */
.reveal-hero {
  opacity: 0;
  transform: translateY(22px);
  animation: heroGlide 0.9s var(--ease-spring) forwards;
  animation-delay: var(--hero-delay, 0ms);
  will-change: opacity, transform, filter;
}

@keyframes heroGlide {
  0% {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Scroll-triggered procedural elements */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(4px);
  transition: opacity 0.85s var(--ease-spring),
              transform 0.85s var(--ease-spring),
              filter 0.85s var(--ease-spring);
  transition-delay: var(--stagger-delay, 0ms);
  will-change: opacity, transform, filter;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Variant: Pop & Scale Up */
.reveal-on-scroll.reveal-pop {
  transform: translateY(22px) scale(0.96);
}

.reveal-on-scroll.reveal-pop.is-revealed {
  transform: translateY(0) scale(1);
}

/* Variant: Slide Up */
.reveal-on-scroll.reveal-slide-up {
  transform: translateY(34px);
}

.reveal-on-scroll.reveal-slide-up.is-revealed {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. Header & Minimal Nav
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 1000;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-hairline);
  transition: border-color var(--transition), background-color var(--transition);
}

.site-header.scrolled {
  border-bottom-color: var(--border-medium);
}

.nav-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  color: var(--text-dim);
  transition: all var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
}

.nav-cta-link {
  font-size: 0.85rem;
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-cta-link:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: calc(var(--header-h) + 64px);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border-hairline);
}

.hero-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 12px;
}

.hero-main-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 56px;
  align-items: start;
  margin-bottom: 56px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-main);
}

.serif-title {
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 16px;
  max-width: 620px;
  font-weight: 400;
}

.hero-bio {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 600px;
}

/* Book Photo Frame with User's Uploaded Character Avatar */
.hero-photo-col {
  display: flex;
  justify-content: flex-end;
}

.book-photo-frame {
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.45s var(--ease-spring);
}

.book-photo-frame:hover {
  transform: translateY(-4px) rotate(1deg);
}

.photo-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.hero-avatar-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  transition: transform 0.5s var(--ease-spring);
}

.book-photo-frame:hover .hero-avatar-img {
  transform: scale(1.08);
}

.photo-caption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Minimal Skill Pills */
.hero-skills-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
}

.skills-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  transition: all var(--transition);
}

.skill-tag:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

/* Quiet Ticker Strip */
.quiet-ticker-strip {
  margin-top: 56px;
  border-top: 1px solid var(--border-hairline);
  padding: 14px 0;
  overflow: hidden;
  user-select: none;
  background: var(--bg-surface);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-loop 28s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-text {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-right: 24px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ticker-dot {
  color: var(--text-dim);
}

@keyframes ticker-loop {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   7. General Section Editorial Layout
   -------------------------------------------------------------------------- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.section-heading-block {
  margin-bottom: 56px;
  max-width: 620px;
}

.section-chapter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.section-title-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-main);
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   8. 01 Selected Work Grid (Real YouTube Projects)
   -------------------------------------------------------------------------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 32px;
}

.work-card {
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.work-card:hover {
  transform: translateY(-3px);
}

@media (min-width: 861px) {
  .work-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 32px;
    align-items: center;
  }

  .work-card:last-child:nth-child(odd) .work-media-link {
    margin-bottom: 0;
  }
}

.work-media-link {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  position: relative;
  border-radius: 3px;
  margin-bottom: 16px;
}

.work-media-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.work-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-spring), filter 0.5s var(--ease-spring);
  display: block;
}

.work-media-link:hover .work-thumb {
  transform: scale(1.035);
  filter: contrast(1.04);
}

.work-play-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(18, 18, 17, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  opacity: 0;
  transform: translateY(4px);
  transition: all var(--transition);
}

.work-media-link:hover .work-play-overlay {
  opacity: 1;
  transform: translateY(0);
}

.play-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.work-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.work-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.work-tags {
  display: flex;
  gap: 6px;
}

.work-tags span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.work-tags span::before {
  content: '#';
  opacity: 0.6;
}

.work-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 8px;
}

.work-title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.work-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.works-channel-link {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.works-channel-link a {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   9. 02 Specialties (Book Table Layout)
   -------------------------------------------------------------------------- */
.specialties-table {
  border-top: 1px solid var(--border-hairline);
}

.spec-row {
  display: grid;
  grid-template-columns: 48px 240px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-hairline);
  transition: background var(--transition), padding var(--transition);
}

.spec-row:hover {
  background: var(--bg-surface);
  padding-left: 10px;
  padding-right: 10px;
}

.spec-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.spec-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-main);
}

.spec-info {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   10. 03 Process (Methodology)
   -------------------------------------------------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-card {
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.step-card:hover {
  transform: translateY(-2px);
}

.step-header {
  margin-bottom: 12px;
}

.step-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.step-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--text-main);
}

.step-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   11. 04 Contact & Minimal Footer
   -------------------------------------------------------------------------- */
.contact-section {
  padding: 110px 0 80px;
}

.contact-box {
  max-width: 680px;
}

.contact-title-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.contact-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.65;
}

.discord-clean-card {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 16px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  margin-bottom: 48px;
  transition: transform var(--transition), border-color var(--transition);
}

.discord-clean-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.discord-tag-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.discord-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.discord-val code {
  font-size: 1.15rem;
  background: none;
  border: none;
  padding: 0;
  font-weight: 500;
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 3px;
  border: 1px solid var(--border-medium);
  background: var(--bg-page);
  color: var(--text-main);
  transition: all var(--transition);
}

.copy-btn:hover {
  background: var(--text-main);
  color: var(--bg-page);
}

.contact-channels-row {
  display: flex;
  gap: 48px;
  border-top: 1px solid var(--border-hairline);
  padding-top: 24px;
  flex-wrap: wrap;
}

.channel-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.ch-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.channel-item a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Site Footer */
.site-footer {
  padding: 32px 0 48px;
  font-size: 0.82rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-hairline);
}

.footer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
}

.footer-clock {
  color: var(--text-muted);
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   12. Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-main-row {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-photo-col {
    justify-content: flex-start;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .spec-row {
    grid-template-columns: 36px 1fr;
    gap: 8px;
  }

  .spec-info {
    grid-column: 2 / -1;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .nav-links {
    display: none;
  }
}
