/* Jon Doretti — personal site */
:root {
  --bg: #0E1318;
  --surface: #151C22;
  --surface-2: #1C252D;
  --text: #EDE7DD;
  --muted: #98A3AD;
  --accent: #F2A541;
  --accent-rgb: 242, 165, 65;
  --accent-2: #86AFCF;
  --line: #26313A;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tshadow: 0 1px 2px rgba(5,5,10,.9), 0 3px 12px rgba(5,5,10,.7), 0 10px 44px rgba(5,5,10,.7);
  --wrap: 1180px;
  --pad: clamp(20px, 5vw, 56px);
  --radius: 18px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 600px at 85% -10%, rgba(var(--accent-rgb), .07), transparent 60%),
    radial-gradient(800px 700px at -10% 40%, rgba(134,175,207,.05), transparent 60%);
  background-repeat: no-repeat;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -.02em; }
h3 { font-size: 20px; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(14,19,24,.78);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav__mark { font-family: var(--font-head); font-weight: 600; font-size: 18px; text-decoration: none; letter-spacing: -.01em; min-height: 44px; display: inline-flex; align-items: center; }
.nav__links { display: flex; gap: 6px; align-items: center; }
.nav__links a {
  text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500;
  padding: 10px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links .nav__cta { color: var(--text); border: 1px solid var(--line); }
.nav__links .nav__cta:hover { border-color: rgba(var(--accent-rgb), .6); background: transparent; }
.nav__toggle { display: none; }

@media (max-width: 760px) {
  .nav__toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0 11px; background: transparent; border: 1px solid var(--line);
    border-radius: 12px; cursor: pointer; position: relative; z-index: 2;
  }
  .nav__toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease); }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 8px;
    background: rgba(14,19,24,.97); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav__links a { font-size: 24px; font-family: var(--font-head); color: var(--text); padding: 12px 24px; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
  text-shadow: none;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff 20%));
  color: var(--bg);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), .22);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(var(--accent-rgb), .34); }
.btn--ghost { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--accent-2); color: #fff; transform: translateY(-2px); }

/* ---------- Shared ---------- */
.section { max-width: var(--wrap); margin: 0 auto; padding: clamp(80px, 11vw, 140px) var(--pad) 0; }
.section__head { margin-bottom: clamp(36px, 5vw, 60px); max-width: 720px; }
.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section__note { margin-top: 14px; color: var(--muted); font-size: 15px; }
.section__note code { color: var(--accent-2); }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 13px; line-height: 1; padding: 8px 11px; border-radius: 999px;
  color: var(--accent-2); background: rgba(134,175,207,.08); border: 1px solid rgba(134,175,207,.16);
}
.tags--quiet li { color: var(--muted); background: transparent; border-color: var(--line); }
.hl { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(32px, 6vw, 88px);
  padding: 110px var(--pad) 60px;
}
.hero__copy { position: relative; }
.hero__copy::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; left: -120px; top: -80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .13), transparent 62%);
  animation: breathe 9s ease-in-out infinite; animation-delay: -3s;
}
@keyframes breathe { 0%,100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
.hero__title { font-size: clamp(56px, 9vw, 116px); letter-spacing: -.035em; line-height: .95; margin: 18px 0 26px; }
.hero__lede { font-size: clamp(21px, 2.3vw, 27px); line-height: 1.4; max-width: 30ch; color: var(--text); }
.hero__lede em { font-style: normal; color: var(--accent); }
.hero__sub { margin-top: 18px; color: var(--muted); max-width: 46ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero__photo { margin: 0; position: relative; justify-self: end; width: 100%; max-width: 440px; }
.hero__frame {
  aspect-ratio: 4 / 5; overflow: hidden; border-radius: 26px; border: 1px solid var(--line);
  box-shadow: 0 40px 100px rgba(0,0,0,.45), 0 0 0 8px rgba(255,255,255,.015);
  background: var(--surface);
}
.hero__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; transform-origin: 50% 35%; animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }
.chip {
  position: absolute; left: 16px; bottom: 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--text);
  background: rgba(8,8,15,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 8px 12px;
  display: flex; gap: 6px; align-items: center;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6FD08C; box-shadow: 0 0 0 3px rgba(111,208,140,.18); }
.chip strong { font-weight: 600; color: var(--accent); }

/* ---------- Trust line ---------- */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust__list {
  max-width: var(--wrap); margin: 0 auto; padding: 22px var(--pad);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px;
}
.trust__list li { font-family: var(--font-head); font-weight: 500; font-size: 15px; color: var(--muted); letter-spacing: .01em; white-space: nowrap; }

/* ---------- Focus cards ---------- */
.focus__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fcard {
  position: relative; overflow: hidden; padding: 30px 28px 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .3s, transform .3s var(--ease);
}
.fcard::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .12), transparent 65%);
  animation: breathe 11s ease-in-out infinite;
}
.fcard:nth-child(2)::after { animation-delay: -4s; }
.fcard:nth-child(3)::after { animation-delay: -8s; }
.fcard:hover { border-color: rgba(var(--accent-rgb), .35); transform: translateY(-3px); }
.fcard__num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.fcard h3 { font-size: 22px; }
.fcard p { color: var(--muted); flex: 1; }

/* ---------- Work rows ---------- */
.work__list { border-top: 1px solid var(--line); }
.wrow {
  display: grid; grid-template-columns: 260px 1fr; gap: 32px;
  padding: 34px 0; border-bottom: 1px solid var(--line); position: relative;
}
.wrow::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--accent);
  transition: width .6s var(--ease);
}
.wrow:hover::before { width: 100%; }
.wrow__meta { display: flex; flex-direction: column; gap: 6px; }
.wrow__num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.wrow__where { color: var(--muted); font-size: 15px; }
.wrow__body { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.wrow__body h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; letter-spacing: -.015em; }
.wrow__body p { color: var(--muted); }
@media (min-width: 900px) {
  .wrow:nth-child(even) { grid-template-columns: 1fr 260px; }
  .wrow:nth-child(even) .wrow__meta { order: 2; text-align: right; align-items: flex-end; }
  .wrow:nth-child(even) .wrow__body { justify-self: end; }
  .wrow:nth-child(even)::before { left: auto; right: 0; }
}

/* ---------- Log (signature) ---------- */
.log__list { position: relative; padding-left: 44px; }
.log__list::before {
  content: ""; position: absolute; left: 11px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(var(--accent-rgb), .25) 45%, var(--line));
  border-radius: 2px;
}
.commit { position: relative; padding: 0 0 52px; }
.commit:last-child { padding-bottom: 0; }
.commit::before {
  content: ""; position: absolute; left: -40px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.commit--head::before { background: var(--accent); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); animation: pulse 4s ease-out infinite; animation-delay: -1s; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .45); } 70%,100% { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }
.commit__line { font-family: var(--mono); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); }
.commit__hash { color: var(--accent); }
.commit__ref {
  color: var(--accent-2); border: 1px solid rgba(134,175,207,.28); border-radius: 6px; padding: 3px 8px; background: rgba(134,175,207,.06);
}
.commit--head .commit__ref { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.commit__title { font-size: clamp(22px, 2.6vw, 30px); margin-top: 14px; letter-spacing: -.015em; }
.commit__org { color: var(--muted); margin-top: 6px; }
.commit__body {
  margin-top: 18px; padding: 20px 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: 10px; max-width: 760px;
}
.commit__body li { position: relative; padding-left: 22px; color: #D3CDC3; font-size: 16px; }
.commit__body li::before { content: "+"; position: absolute; left: 0; top: 0; font-family: var(--mono); color: #6FD08C; }

/* ---------- Education ---------- */
.edu__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.degrees li { display: grid; grid-template-columns: 86px 1fr; gap: 20px; padding: 26px 0; border-top: 1px solid var(--line); }
.degrees li:last-child { border-bottom: 1px solid var(--line); }
.degrees__year { font-family: var(--mono); color: var(--accent); font-size: 15px; padding-top: 4px; }
.degrees h3 { font-size: 24px; }
.degrees p { color: var(--muted); margin-top: 6px; }
.edu__side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.edu__label { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 0 14px; }
.edu__label:first-child { margin-top: 0; }
.certs { display: grid; gap: 12px; }
.certs li { display: flex; flex-direction: column; gap: 2px; }
.certs strong { font-weight: 500; }
.certs span { color: var(--muted); font-size: 14px; font-family: var(--mono); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.about__photo { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 5; background: var(--surface); }
.about__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 30%; }
.about__copy { display: flex; flex-direction: column; gap: 18px; max-width: 600px; }
.about__copy h2 { margin-bottom: 6px; }
.about__copy p:not(.kicker) { color: #D3CDC3; }
.about__copy .kicker { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact__panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px);
  padding: clamp(28px, 5vw, 60px); border-radius: 28px; border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(var(--accent-rgb), .10), transparent 70%),
    var(--surface);
  position: relative; overflow: hidden;
}
.contact__intro { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.contact__intro .kicker { margin-bottom: 0; }
.contact__intro p:not(.kicker) { color: var(--muted); max-width: 40ch; }
.contact__intro .btn { margin-top: 8px; }
.form__fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 14px; color: var(--muted); }
.field input, .field textarea {
  font: 400 16px/1.5 var(--font); color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; min-height: 48px; width: 100%;
  transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.form .btn { align-self: flex-start; }
.form__error { color: #F08A7A; font-size: 14px; }
.form__done { padding: 26px; border-radius: 16px; border: 1px solid rgba(111,208,140,.35); background: rgba(111,208,140,.06); display: flex; flex-direction: column; gap: 10px; }
.form__done-title { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.form__done p:not(.form__done-title) { color: var(--muted); }
.link-btn { align-self: flex-start; background: none; border: 0; color: var(--accent); font: 500 15px var(--font); cursor: pointer; padding: 12px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--wrap); margin: clamp(80px, 11vw, 140px) auto 0; padding: 36px var(--pad) 44px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px 28px; align-items: center;
  color: var(--muted); font-size: 15px;
}
.footer__mark { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.footer__links { display: flex; gap: 6px; }
.footer__links a { text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.footer__links a:hover { color: var(--text); background: var(--surface-2); }
.footer__copy { font-family: var(--mono); font-size: 13px; }

/* ---------- Entrances ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .focus__grid .fcard.reveal:nth-child(2) { transition-delay: .1s; }
.js .focus__grid .fcard.reveal:nth-child(3) { transition-delay: .2s; }
.js .focus__grid .fcard.reveal.in.settled { transition-delay: 0s; }
.js .hero__copy > * { opacity: 0; transform: translateY(18px); animation: rise 1s var(--ease) forwards; }
.js .hero__copy > :nth-child(2) { animation-delay: .08s; }
.js .hero__copy > :nth-child(3) { animation-delay: .18s; }
.js .hero__copy > :nth-child(4) { animation-delay: .28s; }
.js .hero__copy > :nth-child(5) { animation-delay: .38s; }
.js .hero__photo { opacity: 0; transform: translateY(24px) scale(.98); animation: rise 1.2s var(--ease) .2s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .focus__grid { grid-template-columns: 1fr; }
  .wrow { grid-template-columns: 1fr; gap: 14px; }
  .wrow__meta { flex-direction: row; gap: 14px; align-items: baseline; }
  .edu__grid, .about, .contact__panel { grid-template-columns: 1fr; }
  .about__photo { max-width: 420px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 96px; gap: 36px; }
  .hero__photo { order: -1; justify-self: start; max-width: 100%; }
  .hero__frame { aspect-ratio: 5 / 4; }
  .hero__frame img { object-position: 50% 30%; }
  .trust__list { justify-content: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero__frame { aspect-ratio: 1 / 1; }
  .hero__ctas .btn { flex: 1 1 auto; }
  .log__list { padding-left: 34px; }
  .log__list::before { left: 7px; }
  .commit::before { left: -34px; }
  .commit__body { padding: 16px 16px; }
  .degrees li { grid-template-columns: 1fr; gap: 4px; }
  .footer { grid-template-columns: 1fr; }
  .trust__list li { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .hero__copy > *, .js .hero__photo { opacity: 1 !important; transform: none !important; }
}
