/* ─────────────────────────────────────────────
   nategagnon.com — portfolio26
   Mobile-first. Design source: /Desktop/portfolio26 comps.
   ───────────────────────────────────────────── */

/* ── Fonts ── */
@font-face {
  font-family: 'Scto Grotesk A';
  src: url('../fonts/SctoGroteskATRIAL-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Scto Grotesk A';
  src: url('../fonts/SctoGroteskATRIAL-Medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Scto Grotesk A';
  src: url('../fonts/SctoGroteskATRIAL-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

/* ── Tokens ── */
:root {
  --bg: #ECECEC;
  --card: #FFFBF8;
  --ink: #2D2D2D;
  --muted: #A6A4A1;
  --faint: #C9C7C4;
  --divider: rgba(45, 45, 45, 0.07);
  --tag-bg: #E9E7E4;
  --tag-ink: #8A8886;
  --btn-grey: #EDEAE7;
  --shadow-ink: rgba(20, 18, 14, 0.30);

  --sans: 'Scto Grotesk A', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', monospace;

  /* Emil-approved curves */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --page-pad: 28px;
  --card-radius: 32px;
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ─────────────────────────────────────────────
   TOP NAV (fixed) + blend gradient
   ───────────────────────────────────────────── */
.nav-blend {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 110px;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 58px, rgba(236,236,236,0) 100%);
  pointer-events: none;
  z-index: 90;
}

.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px var(--page-pad) 0;
  z-index: 100;
}

/* ── The bug (top-left ticker) ── */
.bug-dot {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  /* the gradient lives underneath… */
  background: linear-gradient(135deg, #FF8A5C 0%, #FF5C87 45%, #A06BFF 100%);
  animation: bug-pulse 2.8s ease-in-out infinite;
}
/* …an ink veil breathes open just enough to hint at it */
.bug-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ink);
  animation: bug-veil 2.8s ease-in-out infinite;
}
@keyframes bug-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.16); }
}
@keyframes bug-veil {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .bug-dot { animation: none; } /* no movement — the color breath still plays */
}

.bug {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink);
  user-select: none;
  min-width: 0;
}

.bug-glyph {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  width: 16px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-img { display: block; width: auto; }

/* ticker window */
.bug-ticker {
  position: relative;
  overflow: hidden;
  height: 16px;
  display: flex;
  align-items: center;
}

.bug-line {
  display: block;
  white-space: nowrap;
  line-height: 16px;
  transform: translateY(1px); /* optical: sit level with the circle */
  transition: opacity 260ms ease;
}

.bug-glyph .glyph-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* home-link variant of the bug (✖ home on subpages) */
.bug-home {
  cursor: pointer;
  border-radius: 6px;
}
@media (hover: hover) and (pointer: fine) {
  .bug-home:hover .bug-glyph { animation: spin-x 500ms var(--ease-in-out); }
}
@keyframes spin-x {
  from { transform: rotate(0deg); }
  to   { transform: rotate(90deg); }
}

/* ── contact pill ── */
.contact-pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 7px 14px 6px; /* text optically centered in the pill */
  border: 1px solid var(--ink);
  border-radius: 100px;
  background: transparent;
  transition: transform 160ms var(--ease-out), background 180ms ease, color 180ms ease;
}
.contact-pill:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .contact-pill:hover { background: var(--ink); color: var(--bg); }
}

/* ─────────────────────────────────────────────
   LAYOUT / VIEWS
   ───────────────────────────────────────────── */
.container {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

#view { position: relative; }

.view-panel { touch-action: pan-y; }

/* card rise-in on view enter */
.card-in {
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 380ms var(--ease-out) forwards;
  animation-delay: var(--cd, 60ms);
}
@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .card-in { animation-duration: 150ms; transform: none; }
}

/* view transition states */
.view-panel {
  transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-out), filter 220ms ease;
}
.view-panel.v-exit {
  opacity: 0;
  transform: translateY(6px);
  filter: blur(2px);
  transition-duration: 150ms;
}
.view-panel.v-enter {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(2px);
  transition: none;
}

/* horizontal slide (project → project) */
.view-panel { transform-origin: 50% 85%; }
.view-panel .hero-stage,
.view-panel .project-card {
  transition: transform 480ms cubic-bezier(0.23, 1, 0.32, 1);
}
.view-panel.h-exit-left   { opacity: 0; transform: translateX(-44px) rotate(-1deg); filter: blur(2px); transition-duration: 170ms; }
.view-panel.h-exit-right  { opacity: 0; transform: translateX(44px) rotate(1deg);  filter: blur(2px); transition-duration: 170ms; }
.view-panel.h-enter-left  { opacity: 0; transform: translateX(-48px) rotate(-1deg); filter: blur(2px); transition: none; }
.view-panel.h-enter-right { opacity: 0; transform: translateX(48px) rotate(1deg);  filter: blur(2px); transition: none; }
.view-panel.h-enter-left  .hero-stage   { transform: translateX(-22px); transition: none; }
.view-panel.h-enter-right .hero-stage   { transform: translateX(22px);  transition: none; }
.view-panel.h-enter-left  .project-card { transform: translateX(-72px) rotate(-0.8deg); transition: none; }
.view-panel.h-enter-right .project-card { transform: translateX(72px) rotate(0.8deg);  transition: none; }

/* ─────────────────────────────────────────────
   HERO (3D icon)
   ───────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 96px;
  padding: 18px 0 26px;
}

.hero.project { margin-top: 96px; }

.hero-stage {
  position: relative;
  width: min(188px, 50vw);
  aspect-ratio: 1 / 1;
}

.hero-shadow {
  position: absolute;
  left: 15%; right: 15%; bottom: -13%;
  height: 7%;
  /* faint chromatic cast — light bouncing off something colorful out of frame */
  background:
    radial-gradient(ellipse at 35% 50%, rgba(255, 122, 89, 0.34), rgba(255, 122, 89, 0) 64%),
    radial-gradient(ellipse at 68% 50%, rgba(150, 105, 255, 0.28), rgba(150, 105, 255, 0) 68%),
    radial-gradient(ellipse at center, var(--shadow-ink), rgba(20,18,14,0) 70%);
  filter: blur(5px);
}

.hero-stage glossy-icon {
  position: absolute;
  inset: 0;
}

/* prev/next chevrons */
.chev {
  position: fixed;
  transform: translateY(-50%);
  z-index: 80;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-radius: 50%;
  transition: transform 160ms var(--ease-out), background 180ms ease;
  z-index: 10;
}
.chev svg, .chev img { width: auto; }
.chev.prev { left: calc(var(--page-pad) - 12px); }
.chev.next { right: calc(var(--page-pad) - 12px); }
.chev:active { transform: translateY(-50%) scale(0.92); }
@media (hover: hover) and (pointer: fine) {
  .chev:hover { background: rgba(28,27,26,0.06); }
  .chev.prev:hover img { transform: translateX(-2px); }
  .chev.next:hover img { transform: translateX(2px); }
  .chev img { transition: transform 180ms var(--ease-out); }
}

/* ─────────────────────────────────────────────
   HOME — bio + list
   ───────────────────────────────────────────── */
.home-grid {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* hard break on mobile, absorbed into the flow on desktop
   (Chrome still breaks at <br display:none>, so a span it is) */
.mbr { display: block; }

.bio {
  text-align: center;
  /* fluid: tracks the longest hard-broken line so the rag is always 4 lines */
  font-size: clamp(13.5px, calc((100vw - 108px) / 18.4), 18px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  /* side padding aligns the copy with the card's inner content edge */
  padding: 46px 26px 46px;
  color: var(--ink);
}
.bio strong { font-weight: 700; color: var(--ink); }

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 0 2px 14px;
}

/* ── Card ── */
.card {
  background: var(--card);
  border-radius: var(--card-radius);
  padding: 10px 28px;
  box-shadow: 0 18px 40px -18px rgba(20,18,14,0.14);
  margin-bottom: 44px;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.row:last-child { border-bottom: none; }

.row-dot {
  flex-shrink: 0;
  width: 13px; height: 13px;
  margin-top: -2px; /* optically center against the text x-height */
  border-radius: 50%;
  background: var(--ink);
  transition: transform 200ms var(--ease-out), background 250ms ease;
}

.row-name {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-arrow {
  display: inline-flex;
  transition: transform 200ms var(--ease-out);
}
.row-arrow svg { width: 15px; height: 15px; }

.row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.soon-label { white-space: nowrap; }

.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 12px 6px;
  border-radius: 100px;
  background: var(--tag-bg);
  color: var(--tag-ink);
  transition: background 200ms ease, color 200ms ease;
}

.row:active .row-dot { transform: scale(0.8); }
@media (hover: hover) and (pointer: fine) {
  .row:hover .row-arrow, .contact-row:hover .row-arrow { transform: translateX(4px); }
  .row:hover .row-dot, .contact-row:hover .row-dot {
    transform: scale(1.25);
    background: linear-gradient(135deg, #FF8A5C 0%, #FF5C87 45%, #A06BFF 100%);
  }
  .row:hover .tag { background: var(--ink); color: var(--card); }
}

/* coming-soon rows */
.row.soon { cursor: default; }
.row.soon .row-dot  { background: var(--faint); }
.row.soon .row-name { color: var(--faint); font-size: 18px; }
.row.soon .tag      { background: #F0EEEB; color: var(--faint); }
.soon-label {
  font-family: var(--mono);
  font-style: italic;
  font-size: 11px;
  color: var(--faint);
}
@media (hover: hover) and (pointer: fine) {
  .row.soon:hover .row-dot { transform: none; }
  .row.soon:hover .tag     { background: #F0EEEB; color: var(--faint); }
}

/* row stagger-in */
.row.stagger {
  opacity: 0;
  transform: translateY(8px);
  animation: row-in 300ms var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes row-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────
   EARLY ACCESS
   ───────────────────────────────────────────── */
.early-card {
  background: var(--card);
  border-radius: var(--card-radius);
  padding: 30px 28px;
  box-shadow: 0 18px 40px -18px rgba(20,18,14,0.14);
  margin-bottom: 52px;
}

.early-copy {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin-bottom: 20px;
  color: var(--ink);
}

.email-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-input { flex: 1; min-width: 0; }

.email-go {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: transform 160ms var(--ease-out), background 180ms ease, color 180ms ease;
}
.email-go svg { width: 16px; height: 16px; }
.email-go:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) {
  .email-go:hover { background: var(--ink); color: var(--card); }
}

.email-input {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--ink);
  padding: 13px 16px 14px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  background: transparent;
  outline: none;
  transition: box-shadow 180ms ease, transform 160ms var(--ease-out);
}
.email-input::placeholder { color: var(--ink); opacity: 0.85; }
.email-input:focus { box-shadow: 0 0 0 3px rgba(28,27,26,0.08); }
.email-input:focus::placeholder { opacity: 0.3; }

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
.footer {
  margin-top: 84px;
  padding-bottom: 56px;
  text-align: center;
}

.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding-bottom: 44px;
}

.social-link {
  display: flex;
  align-items: center;
  color: var(--ink);
  transition: transform 180ms var(--ease-out), opacity 150ms ease;
}
.social-link:active { transform: scale(0.9); }
@media (hover: hover) and (pointer: fine) {
  .social-link:hover { transform: translateY(-2px); }
}

.copyright {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}


/* ─────────────────────────────────────────────
   PROJECT PAGE
   ───────────────────────────────────────────── */
.project-card {
  background: var(--card);
  border-radius: var(--card-radius);
  padding: 28px 26px 26px;
  box-shadow: 0 18px 40px -18px rgba(20,18,14,0.14);
  margin: 28px 0 48px;
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--divider);
}

.project-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.project-desc {
  padding: 18px 0 24px;
  font-size: 15.5px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.project-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

/* secondary (outline) action hugs the card's right content edge, like the tag */
.project-actions .btn-outline { margin-left: auto; }

.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 12px 13px 13px;
  border-radius: 13px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform 160ms var(--ease-out), background 180ms ease,
              color 180ms ease, border-color 180ms ease;
}
.btn:active { transform: scale(0.97); }

.btn-filled { background: var(--btn-grey); }
@media (hover: hover) and (pointer: fine) {
  .btn-filled:hover { background: var(--ink); color: var(--card); }
}

.btn-outline { border: 1px solid var(--ink); background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-outline:hover { background: var(--ink); color: var(--card); }
  .btn-outline:hover .btn-icon { filter: grayscale(1) brightness(2); }
}

.btn-icon { width: 17px; height: 17px; display: inline-flex; }
.btn-icon svg { width: 100%; height: 100%; }

/* ─────────────────────────────────────────────
   CONTACT PAGE
   ───────────────────────────────────────────── */
.contact-head { margin-bottom: 22px; }
.contact-head h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.contact-updated {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--muted);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
}
.contact-row:last-child { border-bottom: none; }

.contact-row .row-name { font-weight: 400; font-size: 20px; }

.contact-icon {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--ink);
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .contact-row:hover .contact-icon { transform: scale(1.12); }
}

/* ─────────────────────────────────────────────
   DESKTOP
   ───────────────────────────────────────────── */
/* contact layout: stacked on mobile, copy|cards split on desktop */
.contact-grid {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.contact-copy {
  padding: 128px 2px 40px;
  max-width: 400px;
}
.contact-copy p {
  font-size: 14.5px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 15px;
}
.contact-copy p:last-child { margin-bottom: 0; }

@media (min-width: 700px) {
  .chev.prev { left: max(24px, calc(50vw - 330px)); }
  .chev.next { right: max(24px, calc(50vw - 330px)); }
}

/* ── desktop (per 'quick desktop mock') ── */
@media (min-width: 1080px) {
  .top-nav { padding: 40px 56px 0; }
  .nav-blend {
    height: 130px;
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 76px, rgba(236,236,236,0) 100%);
  }

  .hero { margin-top: 68px; padding: 16px 0 24px; }
  .hero-stage { width: 252px; }

  /* bio wraps naturally into the mock's 3-line rag */
  .bio .mbr { display: inline; }
  .bio {
    font-size: 24px;
    line-height: 1.28;
    max-width: 640px;
    margin: 0 auto;
    padding: 44px 0 52px;
  }

  /* the latest + early access side by side */
  .home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(56px, 8vw, 140px);
    align-items: start;
    max-width: 1240px;
    padding: 0 56px;
  }
  .home-col { min-width: 0; }

  .container { max-width: 560px; }
  .bio-wrap { max-width: 780px; }
  /* contact: copy column left, cards column right */
  .contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(64px, 8vw, 150px);
    align-items: start;
    max-width: 1160px;
    padding: 0 56px;
    margin-top: 160px;
  }
  .contact-cards { min-width: 0; }
  .contact-copy {
    padding: 6px 0 0; /* first line optically level with the cards' label */
    max-width: 400px;
  }
  .contact-copy p { font-size: 16px; line-height: 1.5; margin-bottom: 18px; }
  .contact-cards .early-card { margin-bottom: 0; }
}

/* ─────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .view-panel,
  .bug-line,
  .bug-glyph .glyph-inner { transition-property: opacity; }
  .view-panel.v-exit, .view-panel.v-enter,
  .view-panel.h-exit-left, .view-panel.h-exit-right,
  .view-panel.h-enter-left, .view-panel.h-enter-right {
    transform: none;
    filter: none;
  }
  .row.stagger { animation-duration: 150ms; transform: none; }
}
