/* Sam Valberg — samvalberg.com
   Rebuilt from the approved Design canvas mockups:
   phones = "Mobile v4", wider screens = "Desktop 4 v2d".
   Every size, color and spacing value below is copied from those mockups.
   Change text and links in content.json, not here. */

/* Inter, self-hosted: the same file Google Fonts serves the mockups. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
}

/* Sam Valberg design tokens (dark) */
.sv {
  --page: #0B0B0B; --surface: #191919; --line: #333331; --line-strong: #6F6E6A;
  --ink: #FFFFFF; --ink-muted: #A3A29E; --dot: rgba(255,255,255,0.22);
  --sky: #3AADFF; --on-sky: #00172b; --bubblegum: #FF57A8; --on-bubblegum: #26000f;
  --sunshine: #FFD60A; --mint: #14D39A; --on-mint: #002418; --grape: #8448FF;
  --tangerine: #FF9419; --lime: #8FE024; --link: #7CC8FF; --focus-ring: #3AADFF;
}

html { background: #0B0B0B; color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: #0B0B0B; }
[hidden] { display: none !important; }

/* ---------- Falling shapes ---------- */
/* Phones use Mobile v4's own 14-shape layer (falls to 1000px); wider
   screens use the design system's 36-shape layer (falls to 2100px). */
@keyframes mfallA { 0% { transform: translateY(-160px) rotate(0deg) } 100% { transform: translateY(1000px) rotate(220deg) } }
@keyframes mfallB { 0% { transform: translateY(-160px) rotate(0deg) } 100% { transform: translateY(1000px) rotate(-180deg) } }
@keyframes mfallC { 0% { transform: translateY(-160px) rotate(0deg) } 100% { transform: translateY(1000px) rotate(120deg) } }
@keyframes fallA { 0% { transform: translateY(-160px) rotate(0deg) } 100% { transform: translateY(2100px) rotate(220deg) } }
@keyframes fallB { 0% { transform: translateY(-160px) rotate(0deg) } 100% { transform: translateY(2100px) rotate(-180deg) } }
@keyframes fallC { 0% { transform: translateY(-160px) rotate(0deg) } 100% { transform: translateY(2100px) rotate(120deg) } }
.fall { position: absolute; top: 0; animation-timing-function: linear; animation-iteration-count: infinite; will-change: transform; }
/* !important is needed: each shape sets its animation inline, and inline
   styles beat a normal stylesheet rule. Shapes then rest at their inline
   starting positions, spread down the page. */
@media (prefers-reduced-motion: reduce) { .fall { animation: none !important; } }
.fall-desktop { display: none; }

/* ---------- Page ---------- */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--page);
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.7px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
}
.fall-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

/* ---------- Mobile v4 (default) ---------- */
.content {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: calc(40px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
}
.main { display: flex; flex-direction: column; }
.identity { display: flex; flex-direction: column; }

.cluster-box { position: relative; width: 216px; height: 172px; flex: 0 0 auto; }
.cluster { position: absolute; left: 0; top: 0; width: 392px; height: 312px; transform: scale(0.55); transform-origin: 0 0; }

.name { margin: 20px 0 14px; font-size: 46px; font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }

/* About me */
.about-btn {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -10px 0 -10px -2px;
  padding: 0 2px;
  box-sizing: border-box;
  background: none;
  border: 0;
  color: var(--link);
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.about-btn::-webkit-details-marker { display: none; }
.about-btn::marker { content: ''; }
.chev { display: flex; transition: transform .2s; transform: rotate(0deg); }
.about[open] .chev { transform: rotate(180deg); }
.chev svg { width: 18px; height: 18px; }
.about-text { margin: 12px 0 0; font-size: 17px; line-height: 1.55; color: var(--ink-muted); max-width: 342px; }

/* Buttons */
.links { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  box-sizing: border-box;
  width: 100%;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-resume { background: var(--sky); color: var(--on-sky); }
.btn-instagram { background: #D62976; color: #FFFFFF; }
.btn-linkedin { background: #FFFFFF; color: #0A66C2; }
.btn-github { background: #24292F; color: #FFFFFF; border: 1.5px solid var(--line-strong); }
.btn-email { background: var(--mint); color: var(--on-mint); border: 0; cursor: pointer; font-family: 'Inter', sans-serif; }
.btn-email .state-idle { display: contents; }
.btn-email .state-done { display: none; }
.btn-email.copied .state-idle { display: none; }
.btn-email.copied .state-done { display: contents; }
.b:focus-visible { outline: 2px solid #3AADFF; outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.email-fallback { margin: 12px 0 0; font-size: 16px; font-weight: 600; color: var(--ink); -webkit-user-select: all; user-select: all; }

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink-muted);
}
.markers { display: flex; gap: 10px; align-items: center; }
.mk { display: inline-block; }
.mk-square { background: var(--sky); width: 10px; height: 10px; border-radius: 2px; }
.mk-circle { background: var(--bubblegum); width: 10px; height: 10px; border-radius: 50%; }
.mk-triangle { background: var(--sunshine); width: 11px; height: 10px; clip-path: polygon(50% 0,100% 100%,0 100%); }
.mk-pill { background: var(--mint); width: 16px; height: 6px; border-radius: 999px; }

/* Between phone and tablet widths (and phones turned sideways), keep the
   phone layout as a centered column instead of stretching it. */
.content { width: 100%; max-width: 440px; margin: 0 auto; }

/* ---------- Desktop 4 v2d ----------
   Tablets, laptops and desktops: 720px and wider, at least 500px tall.
   (Chosen by eye: on an iPad the desktop layout looks best; the buttons
   wrap to a second centered line when the screen is too narrow for one.) */
@media (min-width: 720px) and (min-height: 500px) {
  .content { max-width: none; margin: 0; }
  .fall-mobile { display: none; }
  .fall-desktop { display: block; }

  .content { flex: 1; padding: 0; }
  .main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 72px 48px;
    box-sizing: border-box;
    justify-content: center;
  }
  .identity { align-items: center; text-align: center; }
  .cluster-box { width: 392px; height: 312px; }
  .cluster { transform: none; }
  .name { margin: 22px 0 0; font-size: 78px; text-align: center; }

  /* About me: small link in the top-left corner; the bio opens in a
     floating card, so nothing else on the page moves. */
  .about { position: absolute; z-index: 3; top: 40px; left: max(48px, calc((100% - 1200px) / 2 + 48px)); }
  .about-btn { margin: 0; font-size: 15px; }
  .chev svg { width: 16px; height: 16px; }
  .about-text {
    margin: 6px 0 0;
    width: 360px;
    max-width: none;
    box-sizing: border-box;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 16px;
    line-height: 1.55;
  }

  .links { margin-top: 40px; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .btn { width: auto; }
  .email-fallback { text-align: center; }

  .site-footer {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 48px 40px;
    flex-wrap: wrap;
    gap: 16px;
    box-sizing: border-box;
    font-size: 15px;
  }
  .markers { gap: 12px; }
  .mk-square { width: 12px; height: 12px; }
  .mk-circle { width: 12px; height: 12px; }
  .mk-triangle { width: 13px; height: 12px; }
  .mk-pill { width: 19px; height: 7px; }
}

/* ---------- Short screens (adjusted by eye, not in the mockups) ----------
   Small phones like the iPhone SE (667px tall): trim vertical spacing so all
   five buttons fit on the first screen. Taller phones keep Mobile v4 exactly. */
@media (max-height: 700px) and (max-width: 719px), (max-height: 700px) and (max-height: 499px) {
  .content { padding-top: calc(24px + env(safe-area-inset-top)); }
  .name { margin-top: 14px; }
  .links { margin-top: 24px; }
}
/* Short laptop screens (under 800px tall): less padding around the centered
   content so the footer stays on screen. 1440 x 900 keeps the mockup exactly. */
@media (min-width: 720px) and (min-height: 500px) and (max-height: 799px) {
  .main { padding-top: 48px; padding-bottom: 48px; }
}
