/* amitch.design — shared site chrome: desktop nav hover, mobile menu, about sheet.
   Used by the home page (styles.css) and the project pages (project.css). */
/* Fonts (Amit, Oct 17): Inter for everything (Inter Display Bold for headings), Space Grotesk for the small caps labels and the clocks */
@font-face { font-family: "Inter Web"; src: url("assets/fonts/inter-light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Web"; src: url("assets/fonts/inter-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Web"; src: url("assets/fonts/inter-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Web"; src: url("assets/fonts/inter-display-bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk Web"; src: url("assets/fonts/space-grotesk-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk Web"; src: url("assets/fonts/space-grotesk-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk Web"; src: url("assets/fonts/space-grotesk-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  --font: "Inter Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-label: "Space Grotesk Web", "Space Grotesk", "Inter Web", Helvetica, Arial, sans-serif;
  --sh-px: calc(100vw / 1920);
  --sh-ease: cubic-bezier(.22,.61,.36,1);
}
/* the mobile menu is drawn in the opposite mode to the page */
.menu { --bg: var(--light); --fg: var(--dark); color-scheme: light; }
:root[data-mode="light"] .menu { --bg: var(--dark); --fg: #FFFFFF; color-scheme: dark; }

/* hover: a line through the middle of the word, running a little past both ends */
.site-nav a { position: relative; }
.site-nav a::after {
  content: "";
  position: absolute;
  left: -.08em;
  right: -.08em;
  top: var(--strike-y, calc(.575em - 1px));  /* the 2px line centred on the middle of the lowercase letters (x-height) */
  height: 2px;  /* Amit, Oct 19: back to 2px, just past the letters */
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s var(--sh-ease);
  pointer-events: none;
}
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }
/* pull the menu in so the end of the last word's line, not the word, sits on the content edge */
.site-nav a:last-child { margin-right: .08em; }

.menu-button { display: none; }
.menu {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 86svh;
  display: flex;
  flex-direction: column;
  padding: 0 16px 0;
  background: var(--bg);
  color: var(--fg);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .55s cubic-bezier(.65,0,.35,1), visibility 0s linear .55s;
}
.menu.is-open { transform: none; visibility: visible; transition: transform .55s cubic-bezier(.65,0,.35,1); }
.menu__top { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.menu__top .logo { font-size: 30px; }
.menu-close { width: 54px; height: 30px; padding: 4px 0; border: 0; background: none; color: inherit; cursor: pointer; }
.menu-close svg { width: 100%; height: 100%; overflow: visible; }
.menu-close path { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: butt; }
.menu__nav { display: flex; flex-direction: column; gap: 0; }
.menu__nav a {
  position: relative;
  align-self: flex-start;
  font-size: 41px;
  font-weight: 600;
  letter-spacing: -0.060em;
  line-height: 1.32;
  -webkit-tap-highlight-color: transparent;
}
/* tapped item: the same line through the middle of the word as the desktop hover */
.menu__nav a::after {
  content: "";
  position: absolute;
  left: -.15em;
  right: -.15em;
  top: 52%;
  height: 4px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--sh-ease);
  pointer-events: none;
}
.menu__nav a.is-pressed::after, .menu__nav a[aria-current]::after { transform: scaleX(1); }
.menu__clock {
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-bottom: 22px;
  font-size: 13px;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.menu-scrim { position: fixed; inset: 0; z-index: 29; display: none; }
.menu.is-open + .menu-scrim { display: block; }

/* ---------- About (glass sheet over the page) ---------- */
.about {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 92svh;
  color: var(--fg);
}
/* opacity lives on the glass itself: an ancestor with opacity would cut the backdrop blur off from the page */
.about__glass { opacity: 0; transition: opacity .5s var(--sh-ease); }
.about.is-open .about__glass { opacity: 1; }
/* the header steps away while the sheet is open, as in the reference */
.about-open .header, .about-open .site-header, .about-open .site-header.page-enter.is-in { opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.about__glass {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--glass-tint) var(--glass-mix), transparent);
  -webkit-backdrop-filter: blur(60px) saturate(1.3);
  backdrop-filter: blur(60px) saturate(1.3);
  --glass-tint: #464644;
  --glass-mix: 66%;
}
:root[data-mode="light"] .about__glass { --glass-tint: var(--light); --glass-mix: 70%; }
.about__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: max(calc(38 * var(--sh-px)), 20px) max(calc(45 * var(--sh-px)), 16px) max(calc(42 * var(--sh-px)), 24px);
}
.about__inner > * { transition: opacity .7s var(--sh-ease), transform .7s var(--sh-ease); }
.about:not(.is-open) .about__inner > * { opacity: 0; transform: translateY(16px); }
.about__name { margin: 0; font-size: max(calc(67 * var(--sh-px)), 30px); font-weight: 600; letter-spacing: -0.055em; line-height: 1; transition-delay: .08s; }
.about__bio {
  margin-top: max(calc(72 * var(--sh-px)), 28px);
  max-width: calc(1210 * var(--sh-px));
  font-size: max(calc(44 * var(--sh-px)), 22px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.12;
  transition-delay: .16s;
}
.about__bio p { margin: 0 0 .7em; }
.about__bio p:last-child { margin-bottom: 0; }
.about__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px calc(56 * var(--sh-px));
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  font-size: max(calc(29 * var(--sh-px)), 16px);
  font-weight: 600;
  letter-spacing: -0.045em;
  transition-delay: .24s;
}
.about__contact a { user-select: text; }
@media (hover: hover) { .about__contact a:hover { text-decoration: underline; text-underline-offset: .14em; } }
.about__close {
  position: absolute;
  top: max(calc(36 * var(--sh-px)), 18px);
  right: max(calc(30 * var(--sh-px)), 14px);
  width: max(calc(42 * var(--sh-px)), 26px);
  height: max(calc(42 * var(--sh-px)), 26px);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.about__close svg { width: 100%; height: 100%; }
.about__close path { fill: none; stroke: currentColor; stroke-width: 3.4; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .about__glass { background: color-mix(in srgb, var(--bg) 94%, var(--fg)); }
}

@media (max-width: 700px) {
  .site-nav { display: none; }
  .menu-button {
    display: grid;
    gap: 5px;
    width: 34px;
    padding: 8px 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .menu-button span { display: block; height: 2.5px; border-radius: 2px; background: var(--fg); }
  .about { height: 100svh; }
  .about__inner { padding: 22px 16px max(28px, env(safe-area-inset-bottom)); }
  .about__bio { margin-top: 34px; font-size: min(6.2vw, 26px); line-height: 1.15; max-width: none; }
  .about__contact { flex-direction: column; gap: 6px; font-size: 19px; }
}

/* contact card (desktop): opened from any mailto link, since a bare mailto does nothing without a mail app */
.contact-pop {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 14px 8px 8px;
  border-radius: 14px;
  background: var(--fg, #FFFFFF);
  color: var(--bg, #1E1D1C);
  font-family: var(--font);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}
.contact-pop__addr { padding: 0 10px 8px; font-size: 13px; font-weight: 400; opacity: .6; }
.contact-pop a, .contact-pop button {
  display: block;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: 500 17px/1.2 var(--font);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.contact-pop a:hover, .contact-pop button:hover, .contact-pop a:focus-visible, .contact-pop button:focus-visible {
  background: color-mix(in srgb, currentColor 10%, transparent);
  outline: none;
}
