/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --card-bg: #f9f9f9;
  --card-border: #e9e9e9;
  --card-hover: #efefef;
  --tag-bg: #eeeeee;
  --tag-text: #535353;
  --text: #000000;
  --text-muted: #6a6a6a;
  --text-faint: #717171;
  --footer-text: #939393;
  --dark-card: #191919;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  font-family: var(--font-display);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Layout ===== */
.layout {
  display: flex;
  align-items: flex-start;
  max-width: 1440px;
  margin: 0 auto;
}

/* ===== Aside ===== */
.aside {
  position: sticky;
  top: 0;
  width: 368px;
  max-height: 100vh;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 24px 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
}
.aside::-webkit-scrollbar { display: none; }

.explore-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 163px;
  background: var(--dark-card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}
.explore-card:hover { transform: scale(0.99); }

.explore-card__text { max-width: 258px; display: flex; flex-direction: column; gap: 4px; }

.explore-card h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.24px;
  line-height: 1.44;
  color: #fff;
}

.explore-card p {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.15px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== Project cards ===== */
.project-list { display: flex; flex-direction: column; gap: 4px; }

.project-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  height: 111px;
  padding: 8.5px 12.5px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.project-card:hover { background: var(--card-hover); }
.project-card.is-active { background: var(--card-border); }

.project-card__icon {
  width: 48px;
  height: 48px;
  margin-top: 4px;
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
}

.project-card__body {
  min-width: 0;
  padding-top: 3.25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card__title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.17px;
  line-height: 20.4px;
  color: var(--text);
}

.project-card__desc {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.42px;
  line-height: 16.8px;
  color: var(--text-faint);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__tags { display: flex; flex-wrap: wrap; gap: 0 4px; height: 22px; overflow: hidden; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 8.5px 3.5px;
  background: var(--tag-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  font-size: 11.4px;
  font-weight: 500;
  letter-spacing: 0.36px;
  line-height: 16.8px;
  color: var(--tag-text);
  white-space: nowrap;
}

/* ===== Content column ===== */
.content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.main { padding: 24px; }

/* ===== Home view ===== */
.home__heading {
  font-size: 48px;
  font-weight: 600;
  text-transform: lowercase;
  line-height: 1.9;
  max-width: 600px;
}

.home__bio {
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 40px;
  font-size: 20px;
  font-weight: 500;
  text-transform: lowercase;
  line-height: 33.6px;
  color: var(--text-muted);
}

.home__bio strong { font-weight: 600; }

.home__contact { margin-top: 40px; display: flex; flex-direction: column; gap: 15.9px; }

.home__email {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-body);
  font-size: 29.1px;
  text-transform: lowercase;
  line-height: 44.8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--text);
  color: var(--text);
}

.home__contact-note {
  font-family: var(--font-body);
  font-size: 16.2px;
  letter-spacing: 0.18px;
  text-transform: lowercase;
  line-height: 28.8px;
}

/* ===== Work view ===== */
.work__heading {
  font-size: 48px;
  font-weight: 600;
  text-transform: lowercase;
  line-height: 1.4;
}

.work__subtitle {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 500;
  text-transform: lowercase;
  line-height: 33.6px;
  color: var(--text-muted);
}

.work__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 24px; }

.work__tags .tag { font-size: 13px; padding: 4px 12px 6px; }

.work__case {
  position: relative;
  margin-top: 32px;
  width: 100%;
  max-width: 1024px;
}

.work__frame {
  position: absolute;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.work__frame.is-visible { opacity: 1; transform: none; }

.work__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

/* ===== Live HTML frames ===== */
.work__frame--html {
  border-radius: 16px;
  overflow: hidden;
  container-type: inline-size;
}

/* NotchCast hero — live version of the notchcast.com landing, sized with
   container-query units so it scales with the frame (100cqw = frame width). */
.nc-hero {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #09090b;
  color: #f4f4f5;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Segoe UI', sans-serif;
}
.nc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(62cqw 41cqw at 50% 18%, rgba(217, 126, 86, 0.13), transparent 70%);
}
.nc-hero > * { position: relative; }

.nc-hero__brand {
  display: inline-flex;
  align-items: center;
  gap: 1cqw;
  font-weight: 650;
  font-size: 1.7cqw;
  color: #f4f4f5;
}
.nc-hero__brand span { color: #d97e56; font-size: 2cqw; }

.nc-hero__title {
  margin-top: 2.2cqw;
  font-size: 4.3cqw;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nc-hero__title em {
  font-style: normal;
  background: linear-gradient(92deg, #d97e56, #f2b48c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nc-hero__sub {
  margin-top: 1.2cqw;
  max-width: 46cqw;
  color: #a1a1aa;
  font-size: 1.55cqw;
  line-height: 1.6;
}

.nc-hero__frame {
  margin-top: 3.5cqw;
  padding: 0.9cqw;
  border-radius: 2cqw;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4cqw 11cqw rgba(217, 126, 86, 0.12), 0 2.8cqw 7cqw rgba(0, 0, 0, 0.55);
}
.nc-hero__frame img { display: block; width: 53cqw; border-radius: 1.3cqw; }

.nc-hero__install {
  margin-top: 3.5cqw;
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  background: #101012;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.4cqw;
  padding: 1.4cqw 1.8cqw;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 1.25cqw;
  color: #d4d4d8;
  box-shadow: 0 0 0 1px rgba(217, 126, 86, 0.08), 0 1.8cqw 5cqw rgba(0, 0, 0, 0.45);
}
.nc-hero__dollar { color: #d97e56; }

.nc-hero__meta { margin-top: 1.4cqw; color: #71717a; font-size: 1.25cqw; }
.nc-hero__meta code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; color: #d4d4d8; }
.nc-hero__meta--dots span + span::before { content: "·"; margin: 0 0.8cqw; color: #3f3f46; }

/* ===== Footer ===== */
.footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 29.5px 24px;
  font-family: var(--font-body);
  color: var(--footer-text);
}

.footer__left { display: flex; align-items: center; gap: 32px; }

.footer__item { display: inline-flex; align-items: center; gap: 4px; }
a.footer__item:hover .footer__label { color: var(--text); }
a.footer__item:hover .footer__icon { background-color: var(--text); }

.footer__icon {
  width: 16px;
  height: 16px;
  background-color: var(--footer-text);
  -webkit-mask-size: 16px 16px;
  mask-size: 16px 16px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: background-color 0.15s ease;
}
.footer__icon--globe { -webkit-mask-image: url('assets/icons/globe.svg'); mask-image: url('assets/icons/globe.svg'); }
.footer__icon--arrow { -webkit-mask-image: url('assets/icons/arrow.svg'); mask-image: url('assets/icons/arrow.svg'); }

.footer__label { font-size: 14.3px; letter-spacing: 0.3px; line-height: 21px; transition: color 0.15s ease; }
.footer__label--upper { text-transform: uppercase; }
.footer__label--lower { text-transform: lowercase; font-size: 13.7px; }

.footer__right { font-size: 13.5px; letter-spacing: 0.3px; }

/* ===== View transition ===== */
.main > .view { animation: fade-in 0.35s ease; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ===== Mobile nav (sticky back header, shown only on mobile work view) ===== */
.mobile-nav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--card-border);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.mobile-nav__back { font-size: 18px; line-height: 1; }
.mobile-nav__back-label { flex-shrink: 0; }
.mobile-nav__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
  text-transform: lowercase;
  white-space: nowrap;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-nav__spacer { flex: 1; }

@media (max-width: 768px) {
  body[data-view="work"] .mobile-nav { display: flex; }
}

/* ===== Tablet ===== */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .aside {
    position: static;
    width: 100%;
    max-height: none;
    padding: 16px;
  }
  .home__heading, .work__heading { font-size: 36px; line-height: 1.4; }
  .home__bio { font-size: 17px; line-height: 1.6; }
  .home__email { font-size: 22px; }
}

/* ===== Mobile (main breakpoint) ===== */
@media (max-width: 768px) {
  .main { padding: 20px 16px; }

  /* --- Home view: compact sidebar cards --- */
  .aside {
    padding: 12px;
    gap: 8px;
  }

  /* Keep desktop's poster-card gimmick on mobile: tall black card with text
     anchored to the bottom via justify-content: flex-end (inherited). */
  .explore-card {
    min-height: 160px;
    padding: 16px;
    margin-bottom: 4px;
  }
  .explore-card h2 { font-size: 18px; }
  .explore-card p { font-size: 12px; }
  .explore-card__text { max-width: 100%; }

  .project-list { gap: 8px; }

  /* Compact project card: smaller icon, no description, tags inline */
  .project-card {
    height: auto;
    min-height: 68px;
    padding: 10px 12px;
    gap: 12px;
    align-items: center;
  }
  .project-card__icon {
    width: 40px;
    height: 40px;
    margin-top: 0;
    border-radius: 10px;
  }
  .project-card__body {
    padding-top: 0;
    gap: 6px;
    flex: 1;
  }
  .project-card__title { font-size: 15px; line-height: 1.2; }
  .project-card__desc { display: none; }
  .project-card__tags { height: 20px; }
  .project-card .tag {
    font-size: 10.5px;
    padding: 1px 7px 2px;
    line-height: 15px;
  }

  /* --- Home main content --- */
  .home__heading {
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }
  .home__bio {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 28px;
    gap: 14px;
  }
  .home__contact { margin-top: 32px; gap: 10px; }
  .home__email {
    font-size: 24px;
    line-height: 1.3;
    padding-bottom: 6px;
    max-width: 100%;
    word-break: break-word;
  }
  .home__contact-note { font-size: 14px; line-height: 1.6; }

  /* --- Work view: hide sidebar, stack frames --- */
  body[data-view="work"] .aside { display: none; }

  .work__heading { font-size: 34px; line-height: 1.15; margin-top: 8px; }
  .work__subtitle { font-size: 16px; line-height: 1.5; margin-top: 6px; }
  .work__tags { margin-top: 18px; }
  .work__tags .tag { font-size: 12px; padding: 3px 10px 4px; }

  /* Frames stack vertically at full width, natural aspect ratio */
  .work__case {
    aspect-ratio: auto !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
  }
  .work__frame {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    transform: translateY(16px);
  }
  .work__frame img {
    height: auto;
    object-fit: contain;
    border-radius: 12px;
  }

  /* Live HTML frames stack naturally; let content flow at natural height */
  .work__frame--html { border-radius: 12px; }
  .work__frame[data-frame="2"].work__frame--html {
    aspect-ratio: auto;
  }

  /* NotchCast hero — mobile rebuilt with fixed sizes (not cqw) so text is
     always readable and content flows naturally at any width. Install command
     wraps to multiple lines instead of overflowing. */
  .nc-hero {
    padding: 32px 20px 36px;
    justify-content: flex-start;
    gap: 0;
  }
  .nc-hero::before {
    background: radial-gradient(70% 42% at 50% 12%, rgba(217, 126, 86, 0.18), transparent 70%);
  }

  .nc-hero__brand { font-size: 11px; gap: 5px; }
  .nc-hero__brand span { font-size: 12px; }

  .nc-hero__title {
    font-size: 20px;
    margin-top: 8px;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }
  .nc-hero__sub {
    font-size: 10px;
    max-width: 100%;
    margin-top: 6px;
    line-height: 1.5;
  }

  .nc-hero__frame {
    margin-top: 24px;
    padding: 6px;
    border-radius: 14px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 20px 50px rgba(217, 126, 86, 0.14),
                0 12px 32px rgba(0, 0, 0, 0.55);
  }
  .nc-hero__frame img { width: 100%; border-radius: 9px; }

  .nc-hero__install {
    margin-top: 20px;
    padding: 8px 10px;
    font-size: 8.5px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
  }
  .nc-hero__install code {
    display: block;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    color: #d4d4d8;
  }

  .nc-hero__meta {
    font-size: 9px;
    margin-top: 8px;
    line-height: 1.5;
  }
  .nc-hero__meta code {
    word-break: break-word;
    font-size: 9px;
  }
  .nc-hero__meta--dots { margin-top: 5px; font-size: 8.5px; }
  .nc-hero__meta--dots span + span::before { margin: 0 4px; }

  /* --- Footer stacks vertically --- */
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 16px 40px;
  }
  .footer__left {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .footer__right { font-size: 13px; }
}

/* ===== Very small screens ===== */
@media (max-width: 400px) {
  .home__heading { font-size: 34px; }
  .home__email { font-size: 22px; }
  .work__heading { font-size: 28px; }
  .project-card__tags { display: none; }
}
