/* ===========================================
   TOKENS
=========================================== */
:root {
  --bg-deep: #0a141c;
  --bg-panel: #101f2b;
  --bg-panel-2: #142838;
  --accent-teal: #5a95ab;
  --accent-teal-deep: #274a5c;
  --accent-violet: #7b5fe6;
  --accent-gold: #f2b84b;
  --text-hi: #eaf1f5;
  --text-mid: #9fb4c2;
  --text-low: #5f7686;
  --line: rgba(234, 241, 245, 0.12);

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --cut: 16px;
  --max-w: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-hi);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ===========================================
   SIGNATURE A — ambient wind glow wash
=========================================== */
.wind-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 15% 0%, rgba(90, 149, 171, 0.18), transparent 60%),
    radial-gradient(50% 40% at 88% 10%, rgba(123, 95, 230, 0.12), transparent 62%),
    radial-gradient(60% 50% at 50% 105%, rgba(242, 184, 75, 0.10), transparent 70%);
}

.wind-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===========================================
   NAV
=========================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 20, 32, 0.55);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-mark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-hi);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-mid);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--accent-teal); }

.nav-discord {
  display: flex;
  align-items: center;
  color: var(--text-mid);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-discord:hover,
.nav-discord:focus-visible {
  color: var(--accent-teal);
  transform: translateY(-1px);
}

.discord-icon {
  width: 22px;
  height: 17px;
}

.nav-x {
  display: flex;
  align-items: center;
  color: var(--text-mid);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-x:hover,
.nav-x:focus-visible {
  color: var(--accent-teal);
  transform: translateY(-1px);
}

.x-icon {
  width: 17px;
  height: 17px;
}

/* ===========================================
   SHARED — eyebrow ditches the mono/uppercase
   tag cliche for an italic serif mark instead
=========================================== */
.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent-teal);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent-teal);
  opacity: 0.7;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 560;
  color: var(--text-hi);
}

.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold) 15%, var(--accent-teal) 45%, var(--accent-violet) 75%, transparent 95%);
  opacity: 0.28;
  filter: blur(0.5px);
}

/* Buttons — angular, bracket-cornered, tied to a
   world-editor's selection handles rather than a
   generic gradient pill */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn::before, .btn::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--accent-gold);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn::before { top: -4px; left: -4px; border-top: 1.5px solid; border-left: 1.5px solid; }
.btn::after { bottom: -4px; right: -4px; border-bottom: 1.5px solid; border-right: 1.5px solid; }
.btn:hover::before, .btn:hover::after,
.btn:focus-visible::before, .btn:focus-visible::after { opacity: 1; }
.btn:hover::before, .btn:focus-visible::before { transform: translate(-2px, -2px); }
.btn:hover::after, .btn:focus-visible::after { transform: translate(2px, 2px); }

.btn-primary {
  background: var(--accent-teal);
  color: #05141b;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--accent-teal-deep);
  color: var(--text-hi);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text-hi);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 3px;
}

section { position: relative; z-index: 1; }

/* Shared clipped-corner card language — echoes a
   viewport panel with one corner folded back, used
   consistently across cards instead of uniform
   rounded rectangles */
.cut-corner {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  border-radius: 2px;
}

/* ===========================================
   HERO
=========================================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 168px 28px 100px;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(10, 20, 28, 0.55) 0%, rgba(10, 20, 28, 0.75) 60%, var(--bg-deep) 100%),
    url("files/hero/hero-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-vista {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(50% 50% at 30% 20%, rgba(90, 149, 171, 0.22), transparent 65%),
    radial-gradient(45% 45% at 75% 10%, rgba(123, 95, 230, 0.16), transparent 65%);
  filter: blur(10px);
}

.hero-title {
  font-size: clamp(2.5rem, 4.6vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.hero-title .ink {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-teal) 55%, var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

.hero-sub {
  color: var(--text-mid);
  font-size: 1.08rem;
  font-style: italic;
  max-width: 46ch;
  margin-bottom: 34px;
  opacity: 0.85;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Feature panel — a layered, angle-cut card offset
   by a floating outline frame behind it, like a
   painted panel set slightly askew on a board */
.hero-feature {
  position: relative;
  margin-left: 26px;
}

.hero-feature::before {
  content: '';
  position: absolute;
  inset: 22px -22px -22px 22px;
  border: 1.5px solid var(--accent-teal);
  opacity: 0.4;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
  z-index: -1;
}

.feature-frame {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.feature-placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(90, 149, 171, 0.18), rgba(39, 74, 92, 0.18));
  color: var(--text-low);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.feature-caption { padding: 22px 24px 30px; }

.feature-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.feature-name { font-size: 1.3rem; margin-bottom: 8px; }

.feature-desc { color: var(--text-mid); font-size: 0.95rem; }

/* ===========================================
   STATS STRIP
=========================================== */
.stats { padding: 64px 28px; }

.stats-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat {
  text-align: center;
  padding: 30px 12px;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(242, 184, 75, 0.05), transparent 60%),
    var(--bg-panel);
  border: 1px solid var(--line);
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-teal), transparent);
  opacity: 0.6;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 2.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-teal) 55%, var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-mid);
  letter-spacing: 0.02em;
}

/* ===========================================
   WORK
=========================================== */
.work { padding: 90px 28px; max-width: var(--max-w); margin: 0 auto; }

.section-head { margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(90, 149, 171, 0.4);
}

.project-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(39, 74, 92, 0.18), rgba(90, 149, 171, 0.16));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-low);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.project-body { padding: 22px 24px 24px; }

.project-body h3 { font-size: 1.1rem; margin-bottom: 8px; font-style: italic; }

.project-body p { color: var(--text-mid); font-size: 0.92rem; margin-bottom: 18px; }

.project-stats {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-low);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.project-stats strong { color: var(--accent-teal); font-weight: 600; }

/* ===========================================
   GALLERY TRIGGERS (clickable thumbs -> lightbox)
=========================================== */
.gallery-trigger {
  cursor: pointer;
  position: relative;
}

.gallery-trigger:hover .project-thumb-inner,
.gallery-trigger:focus-visible .project-thumb-inner,
.gallery-trigger:hover .feature-placeholder,
.gallery-trigger:focus-visible .feature-placeholder {
  transform: scale(1.04);
}

.project-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.gallery-trigger .feature-placeholder {
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
  background-size: cover;
  background-position: center;
}

.gallery-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 120px at var(--mx, 50%) var(--my, 50%), rgba(234, 241, 245, 0.10), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-trigger:hover::after,
.gallery-trigger:focus-visible::after { opacity: 1; }

.thumb-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 32, 0.55);
  border: 1px solid rgba(234, 241, 245, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  pointer-events: none;
}

.thumb-play-icon::before {
  content: '';
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent var(--text-hi);
  margin-left: 3px;
}

/* ===========================================
   LIGHTBOX
=========================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 12, 18, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  width: min(84vw, 1100px);
  height: min(78vh, 760px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.lightbox-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateX(24px) scale(0.98);
  transition: opacity 0.32s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.32s cubic-bezier(0.2, 0.6, 0.2, 1);
  position: absolute;
  display: none;
}

.lightbox-media.is-active { display: block; }

.lightbox-media.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.lightbox-media.is-leaving-left {
  opacity: 0;
  transform: translateX(-24px) scale(0.98);
}

.lightbox-media.is-leaving-right {
  opacity: 0;
  transform: translateX(24px) scale(0.98);
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-hi);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover, .lightbox-close:focus-visible {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-hi);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  z-index: 2;
}

.lightbox-prev { left: 14px; transform: translateY(-50%); }
.lightbox-next { right: 14px; transform: translateY(-50%); }

.lightbox-nav:hover, .lightbox-nav:focus-visible {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.lightbox-prev:hover, .lightbox-prev:focus-visible { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover, .lightbox-next:focus-visible { transform: translateY(-50%) translateX(3px); }

.lightbox-meta {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-mid);
}

#lightboxTitle {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-hi);
  font-size: 1rem;
}

@media (max-width: 700px) {
  .lightbox-stage { width: 94vw; height: 56vh; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.3rem; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-close { top: 14px; right: 16px; width: 38px; height: 38px; font-size: 1.4rem; }
  .lightbox-meta { bottom: 14px; font-size: 0.72rem; gap: 8px; flex-direction: column; text-align: center; }
}

/* ===========================================
   SCROLL REVEAL
=========================================== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

.project-grid .project-card.reveal:nth-child(1) { transition-delay: 0.05s; }
.project-grid .project-card.reveal:nth-child(2) { transition-delay: 0.15s; }
.project-grid .project-card.reveal:nth-child(3) { transition-delay: 0.25s; }
.project-grid .project-card.reveal:nth-child(4) { transition-delay: 0.35s; }

.stats-inner .stat.reveal:nth-child(1) { transition-delay: 0.05s; }
.stats-inner .stat.reveal:nth-child(2) { transition-delay: 0.15s; }
.stats-inner .stat.reveal:nth-child(3) { transition-delay: 0.25s; }
.stats-inner .stat.reveal:nth-child(4) { transition-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===========================================
   ABOUT
=========================================== */
.about { padding: 90px 28px; }

.about-panel {
  max-width: 780px;
  margin: 0 auto;
  padding: 46px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  position: relative;
}

.about-panel::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 22px;
  height: 22px;
  border-top: 1.5px solid var(--accent-gold);
  border-left: 1.5px solid var(--accent-gold);
  opacity: 0.7;
}

.about-panel::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 22px;
  height: 22px;
  border-bottom: 1.5px solid var(--accent-teal);
  border-right: 1.5px solid var(--accent-teal);
  opacity: 0.7;
}

.about-panel h2 { font-size: clamp(1.9rem, 3vw, 2.3rem); margin-bottom: 20px; font-style: italic; }

.about-text { color: var(--text-mid); font-size: 1.02rem; max-width: 60ch; margin-bottom: 18px; }
.about-text:last-of-type { margin-bottom: 0; }

.about-tools { display: flex; flex-wrap: wrap; gap: 10px; }

.tool-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--text-mid);
}

/* ===========================================
   CONTACT
=========================================== */
.contact {
  padding: 110px 28px;
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}

.contact h2 { font-size: clamp(2.1rem, 4vw, 2.9rem); margin-bottom: 14px; font-style: italic; }

.contact-sub { color: var(--text-mid); margin-bottom: 34px; }

.contact-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ===========================================
   FOOTER
=========================================== */
.site-footer {
  padding: 32px 28px 44px;
  text-align: center;
  color: var(--text-low);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ===========================================
   RESPONSIVE
=========================================== */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 140px; }
  .hero-feature { margin-left: 0; margin-top: 20px; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 20px; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 14px 18px; }
  .hero { padding: 120px 18px 70px; }
  .about-panel { padding: 30px; }
}
