*{ box-sizing: border-box; }
html, body{ height: 100%; }

:root{
  --bg: #ece9e4;          
  --text: #111111;
  --muted: rgba(17,17,17,0.62);

  --accent: #6b4eff;
  --accent-soft: rgba(107,78,255,0.14);

  --glass-fill: rgba(255,255,255,0.14);
  --glass-border: rgba(255,255,255,0.68);
  --shadow: 0 18px 46px rgba(17,17,17,0.10);
}

::selection{ background: var(--accent-soft); }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 75% 25%, rgba(107,78,255,0.035), transparent 60%),
    radial-gradient(700px 420px at 20% 80%, rgba(255,120,120,0.035), transparent 55%),
    var(--bg);
}

/* ==============================
   TOPBAR
================================ */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 22px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;

  border-bottom: 1px solid rgba(17,17,17,0.12);
  padding-bottom: 20px;
}

.topbar-left h3{
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.6px;
  opacity: 0.88;
}

.topbar-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.topbar-right a{
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  font-weight: 520;
  opacity: 0.9;
}

.topbar-right a:hover{
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: var(--accent);
}


.logo-link{
  text-decoration: none;
  color: inherit;
  display: inline-block;
}


/* ==============================
   HERO + GRID
================================ */
.hero{
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 56px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-grid{
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(320px, 420px);
  grid-template-rows: minmax(190px, 240px) minmax(190px, 240px);
  gap: clamp(12px, 2vw, 18px);
  align-items: stretch;
  transform: translateY(-12px);
}

.artist{ grid-column: 1; grid-row: 1; }
.art-link{ grid-column: 2; grid-row: 1; }
.coder{ grid-column: 2; grid-row: 2; }
.code-link{ grid-column: 1; grid-row: 2; }

/* ==============================
   GLASS CARD
================================ */
.cell{
  position: relative;
  overflow: hidden;

  background: var(--glass-fill);
  background-image:
    linear-gradient(135deg,
      rgba(255,255,255,0.72) 0%,
      rgba(255,255,255,0.20) 45%,
      rgba(255,255,255,0.06) 100%
    );

  backdrop-filter: blur(34px) saturate(185%);
  -webkit-backdrop-filter: blur(34px) saturate(185%);

  border-radius: 22px;
  border: 1px solid var(--glass-border);
  border-bottom: 1px solid rgba(17,17,17,0.10);

  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255,255,255,0.70),
    inset 0 -1px 0 rgba(17,17,17,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.18);

  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    border-bottom-color 0.35s ease,
    background 0.35s ease;
}

.cell::before{
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background:
    radial-gradient(900px 320px at 12% 8%, rgba(255,255,255,0.72), transparent 55%),
    radial-gradient(700px 260px at 92% 0%, rgba(255,255,255,0.26), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.16), transparent 42%);
  opacity: 0.95;
}

.cell::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.05) 0px,
      rgba(255,255,255,0.05) 2px,
      rgba(255,255,255,0.00) 6px,
      rgba(255,255,255,0.00) 12px
    );
  opacity: 0.18;
  mix-blend-mode: overlay;
}

.cell:hover{
  border-color: rgba(255,255,255,0.88);
  border-bottom-color: rgba(17,17,17,0.16);
  transform: translateY(-4px) scale(1.03);
}

.cell:focus-visible{
  outline: 2px solid rgba(107,78,255,0.45);
  outline-offset: 3px;
}

/* ==============================
   TEXT CELLS
================================ */
.artist, .coder{
  font-size: clamp(64px, 9vw, 120px);
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 0.95;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 26px 30px;

  text-shadow:
    0 1px 0 rgba(255,255,255,0.35),
    0 10px 30px rgba(17,17,17,0.12);
}

.art-link, .code-link{
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  opacity: 0.72;
  color: rgba(17,17,17,0.72);

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;

  text-align: left;
  padding: 20px 22px 22px;
  padding-left: 26px;

  text-decoration: none !important;
}

.art-link:link,
.art-link:visited,
.code-link:link,
.code-link:visited{ text-decoration: none !important; }

.art-link a,
.code-link a{ text-decoration: none !important; color: inherit; }

.art-link:hover,
.code-link:hover{
  opacity: 1;
  color: var(--text);
}

/* ==============================
   FULL-PAGE OVERLAYS
================================ */
.overlay{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.overlay::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.topbar, .hero, .site-footer{ position: relative; z-index: 2; }

/* ART */
.overlay-art{
  background:
    radial-gradient(900px 520px at 25% 30%, rgba(255,255,255,0.20), transparent 60%),
    radial-gradient(700px 420px at 75% 80%, rgba(107,78,255,0.10), transparent 55%);
}

.overlay-art::after{
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/artist-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.28;
  filter: blur(0.8px) saturate(1.25) contrast(1.05);
  transform: scale(1.02);
  will-change: transform, opacity;
  transition: opacity 220ms ease;
}

/* breathing */
.overlay-art.is-active::after{ animation: art-breathe 7s ease-in-out infinite; }

@keyframes art-breathe{
  0%   { transform: scale(1.02); opacity: 0.28; }
  50%  { transform: scale(1.07); opacity: 0.38; }
  100% { transform: scale(1.02); opacity: 0.28; }
}

@media (prefers-reduced-motion: reduce){
  .overlay-art.is-active::after{ animation: none; }
}

/* CODE */
.overlay-code{
  background:
    radial-gradient(900px 520px at 65% 20%, rgba(107,78,255,0.20), transparent 60%),
    radial-gradient(700px 420px at 20% 85%, rgba(255,120,120,0.16), transparent 55%),
    rgba(16, 18, 38, 0.20);
}

.code-bg{
  position: absolute;
  inset: 0;
  padding: 48px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.86);
  white-space: pre-wrap;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

/* Matrix canvas (if you use it) */
#matrix-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}

#overlay-code.is-active #matrix-canvas{ opacity: 0.85; }

#overlay-code .code-bg{ position: relative; z-index: 2; }

.overlay.is-active{ opacity: 1; }

/* ==============================
   FOOTER
================================ */
.site-footer{
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 48px 40px;
  color: rgba(17,17,17,0.65);
}

.footer-divider{
  height: 1px;
  width: 100%;
  background: rgba(17,17,17,0.12);
  margin-bottom: 16px;
}

.footer-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.footer-list li{
  flex: 1;
  font-size: 13.5px;
  line-height: 1.6;
  letter-spacing: 0.2px;
  color: rgba(17,17,17,0.65);
}

.footer-list li:nth-child(1){ text-align: left; }
.footer-list li:nth-child(2){ text-align: center; }
.footer-list li:nth-child(3){ text-align: right; }

/* ==============================
   RESPONSIVE
================================ */
@media (max-width: 1024px){
  .topbar{ padding: 18px 28px; padding-bottom: 16px; }

  .hero{
    min-height: calc(100vh - 140px);
    padding: clamp(28px, 3.6vw, 56px);
  }

  .hero-grid{
    grid-template-columns: minmax(280px, 380px) minmax(280px, 380px);
    grid-template-rows: minmax(170px, 220px) minmax(170px, 220px);
    gap: 14px;
    transform: translateY(-8px);
  }

  .artist, .coder{
    font-size: clamp(54px, 8vw, 96px);
    padding: 22px 24px;
  }

  .art-link, .code-link{
    font-size: 14px;
    padding: 18px 18px 20px;
    padding-left: 22px;
  }

  .code-bg{ padding: 36px; font-size: 14px; line-height: 1.55; }

  .site-footer{ padding: 20px 28px 36px; }
}

@media (max-width: 860px){
  .topbar{ padding: 14px 16px; gap: 12px; padding-bottom: 14px; }

  .topbar-left h3{
    font-size: 14px;
    letter-spacing: 0.4px;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-right{ gap: 10px; flex-wrap: nowrap; white-space: nowrap; }
  .topbar-right a{ font-size: 13px; }

  .hero{
    min-height: auto;
    align-items: flex-start;
    padding: 72px 12px 36px; /* more breathing room from the top on phone/tablet */
  }

  .hero-grid{
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    transform: none;
    margin-top: 32px;
  }

  .artist, .art-link, .coder, .code-link{ grid-column: auto; grid-row: auto; }
  .cell{ width: 100%; border-radius: 18px; }

  .artist{ order: 1; }
  .art-link{ order: 2; }
  .coder{ order: 3; }
  .code-link{ order: 4; }

  .artist, .coder{ min-height: 120px; font-size: clamp(44px, 12vw, 64px); line-height: 1; padding: 18px; }
  .art-link, .code-link{ min-height: 92px; font-size: 13.5px; line-height: 1.45; padding: 16px 16px 18px; padding-left: 18px; }

  .code-bg{ padding: 18px; font-size: 12.5px; line-height: 1.5; }

  .site-footer{ padding: 18px 16px 30px; }
  .footer-list{ gap: 12px; }
  .footer-list li{ font-size: 13px; }
}

@media (max-width: 600px){
  .topbar{ padding: 12px 14px; padding-bottom: 12px; }
  .topbar-right{ gap: 10px; }
  .topbar-right a{ font-size: 12px; }

  .hero{ padding: 64px 12px 28px; }
  .hero-grid{ max-width: 480px; }

  .footer-list{ justify-content: flex-start; }
  .footer-list li{ text-align: left !important; flex: 0 0 auto; }
}

@media (max-width: 380px){
  .topbar-right{ gap: 8px; }
  .topbar-right a{ font-size: 11.5px; }
}

/* ==============================
   PAGES (About / Works / Contact)
================================ */
.page{
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 34px 48px 16px;
}

.page-header{
  margin-bottom: 18px;
}

.page-header h1{
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lead{
  margin: 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(17,17,17,0.70);
  max-width: 64ch;
}

.panel{
  margin-top: 16px;
  padding: 22px 22px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.65);
  border-bottom-color: rgba(17,17,17,0.10);
  background: rgba(255,255,255,0.10);
  background-image:
    linear-gradient(135deg,
      rgba(255,255,255,0.60) 0%,
      rgba(255,255,255,0.18) 45%,
      rgba(255,255,255,0.06) 100%
    );
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  box-shadow: 0 16px 40px rgba(17,17,17,0.08);
}

.panel h2{
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0.2px;
  opacity: 0.90;
}

.panel p{
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(17,17,17,0.72);
  max-width: 78ch;
}

.muted{
  color: rgba(17,17,17,0.62);
}

.list{
  margin: 8px 0 0;
  padding-left: 18px;
  color: rgba(17,17,17,0.72);
  font-size: 14.5px;
  line-height: 1.75;
}

/* Responsive pages (shared) */
@media (max-width: 1024px){
  .page{ padding: 28px 28px 12px; }
}

@media (max-width: 860px){
  .page{ padding: 22px 16px 10px; }
}

@media (max-width: 600px){
  .page-header h1{ font-size: clamp(30px, 9vw, 40px); }
}