:root {
  /* dark theme: everything below the first page */
  --bg: #121212;
  --block: #8a8a8e;          /* the flat grey rectangle behind the photo */
  --block-soft: #262626;     /* grey block behind each section */
  --line: rgba(236, 236, 236, 0.12);
  --text: #ececec;
  --body: #c9c9c9;
  --muted: #8f8f8f;

  /* glass panels: low transparency + blur */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-blur: blur(14px) saturate(120%);

  --display: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

html { background: #060606; } /* area outside the phone-width column */

body {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Shared bits ---------- */
.label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.tiny {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 0;
  border-radius: 2px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0; left: 50%;
  width: 100%; max-width: 430px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 20px;
  mix-blend-mode: difference; /* dark on the light hero, light on the dark sections */
}

/* two thin lines, the lower one shorter; they cross into an X when the menu is open */
.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  width: 32px;
  padding: 10px 0;
  background: none; border: 0; cursor: pointer;
}
.menu-btn i {
  display: block;
  width: 30px; height: 1.5px;
  background: var(--text);
  transition: transform .35s ease, width .35s ease;
}
.menu-btn i:last-child { width: 18px; }
.menu-btn:hover i:last-child { width: 30px; }
.menu-open .menu-btn i:first-child { transform: translateY(4.25px) rotate(45deg); }
.menu-open .menu-btn i:last-child  { width: 30px; transform: translateY(-4.25px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 15;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  gap: 6px; padding: 0 max(20px, calc((100vw - 430px) / 2 + 20px));
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.menu a { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -0.04em; text-transform: uppercase; }
.menu a:hover { color: var(--muted); }
.menu-open .menu { opacity: 1; pointer-events: auto; }
.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  /* the first page keeps the light, greyish look */
  --bg: #d8d8d5;
  --text: #0d0d0d;
  --ph: 58%;  /* reference height used to place the role text */
  --img: 70%; /* actual photo height; it grows downward so the head stays put */
  --muted: #4f4f54;

  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

.hero-text,
.hero-role {
  transform: translateY(calc(var(--hp, 0) * -0.22px));
  opacity: calc(1 - var(--hpn, 0));
  will-change: transform, opacity;
}
.hero-text {
  position: absolute;
  top: 64px; left: 20px; right: 20px;
  z-index: 1;
}

/* lettering: Inter, capitals, tight spacing. Everything shares one left edge (20px);
   the small negative margin cancels each glyph's built-in side bearing. */
.giant-name,
.role-a,
.role-b {
  font-family: 'Inter', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: var(--text);
  white-space: nowrap;
  margin-left: -0.04em;
}

.giant-name {
  display: block;
  width: max-content;
  font-size: 22vw; /* JS refines this to fit the width */
  font-weight: 800;
  line-height: 1;
}

/* small spaced caption with a short rule */
.hero-tag {
  max-width: 52%;
  text-wrap: balance;
  margin-top: 16px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-tag::after {
  content: '';
  display: block;
  width: 28px; height: 1px;
  margin-top: 12px;
  background: var(--text);
}

/* role: one tight block. SOFTWARE is light, DEVELOPER. is extra bold.
   The block sits just behind the top of the photo. */
.hero-role {
  position: absolute;
  z-index: 1;
  left: 20px;
  top: calc(100% - var(--ph) * 1.16 - 24px);
  line-height: .95;
}
.role-a,
.role-b {
  display: block;
  font-size: min(13vw, 56px); /* capped to the phone column */
}
.role-a { font-weight: 300; }
.role-b { font-weight: 800; }

.hero-photo {
  position: absolute;
  left: calc(50% + 16px); bottom: calc(var(--ph) - var(--img));
  transform: translateX(-50%) translateY(calc(var(--hp, 0) * 0.12px)) rotate(-4deg); /* straightens the lean to the right; drifts down slightly on scroll */
  will-change: transform;
  transform-origin: 50% 100%;
  z-index: 2;
  height: var(--img);
  max-width: none;
  filter: grayscale(1) contrast(1.05) drop-shadow(0 8px 14px rgba(0, 0, 0, .18));
}
/* fade the cropped legs into the page so the bottom bar sits on clean grey */
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 15%;
  z-index: 2;
  background: linear-gradient(to top, var(--bg) 4%, transparent);
  pointer-events: none;
}
@media (max-height: 720px) {
  .hero { --ph: 50%; --img: 60%; }
}

.hero-socials,
.hero-contact {
  position: absolute;
  bottom: 24px;
  z-index: 3;
  height: 40px;
  display: flex;
  align-items: center;
}
.hero-socials { left: 20px; gap: 18px; }
.hero-socials svg { display: block; width: 22px; height: 22px; }

.hero-contact {
  right: 20px;
  gap: 8px;
  padding: 0 18px;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hero-contact svg { width: 16px; height: 16px; }

/* ---------- Ticker under the hero ---------- */
.marquee {
  overflow: hidden;
  background: #d8d8d5;
  color: #0d0d0d;
  border-top: 1px solid rgba(13, 13, 13, .18);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee span {
  padding: 14px 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee span:nth-child(even) { font-weight: 300; }
.marquee span::after { content: '—'; margin: 0 18px; font-weight: 300; opacity: .5; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: 56px 20px 44px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
/* grey block behind each section so the glass panels have something to blur */
.section::before {
  content: '';
  position: absolute;
  top: 150px; right: 0;
  width: 62%; height: 42%;
  background: var(--block-soft);
  z-index: -1;
}
.section:nth-of-type(odd)::before { right: auto; left: 0; }

/* two-weight headings, same idea as SOFTWARE / DEVELOPER */
.section-title,
.project h3,
.edu h3 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: .95;
}
.section-title { margin: 0 0 32px; font-size: min(13vw, 56px); }
.section-title .l, .project h3 .l, .edu h3 .l { display: block; font-weight: 300; }
.section-title .b, .project h3 .b, .edu h3 .b { display: block; font-weight: 800; }

/* fade-in on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

.card { padding: 22px 20px; font-size: 14px; line-height: 1.6; }

/* ---------- About ---------- */
.lead {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.lead strong { font-weight: 800; }
.body-text { margin-top: 16px; font-size: 14.5px; line-height: 1.65; color: var(--muted); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips li {
  padding: 5px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
}

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  padding-left: 30px;
  --p: 0px; /* pointer position, eased by JS while scrolling */
}
/* faint rail, and a bright trail that grows behind the pointer */
.timeline::before,
.tl-fill {
  content: '';
  position: absolute;
  left: 7px; top: 0;
  width: 2px;
  border-radius: 2px;
}
.timeline::before { bottom: 0; background: var(--line); }
.tl-fill {
  height: var(--p);
  background: linear-gradient(to bottom, rgba(236, 236, 236, 0), var(--text));
}
.tl-pointer {
  position: absolute;
  left: 3px; top: var(--p);
  width: 10px; height: 10px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 14px 2px rgba(236, 236, 236, .45);
  z-index: 2;
}

.exp { position: relative; }
.exp + .exp { margin-top: 14px; }
/* ring on the rail; it fills in and the card brightens once the pointer arrives */
.exp::before {
  content: '';
  position: absolute;
  left: -28px; top: 24px;
  width: 12px; height: 12px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--muted);
  transition: background .4s ease, border-color .4s ease, transform .4s ease;
}
.exp.reached::before { background: var(--text); border-color: var(--text); transform: scale(1.15); }
.exp > * { transition: opacity .5s ease; }
.exp:not(.reached) > * { opacity: .4; }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.job-head h3 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.company { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* ---------- Projects / Education ---------- */
.project h3, .edu h3 { margin: 14px 0 16px; font-size: 32px; }
.project h3 { margin: 30px 0 14px; font-size: 36px; }
.project .body-text { margin-top: 0; font-size: 15px; color: var(--body); }
.proj-top { display: flex; justify-content: space-between; align-items: flex-start; }
.proj-num {
  font-size: 44px;
  font-weight: 800;
  line-height: .8;
  letter-spacing: -0.04em;
  color: rgba(236, 236, 236, .14);
}

/* numbered rows with hairlines */
.rows { list-style: none; counter-reset: row; margin-top: 22px; border-top: 1px solid var(--line); }
.rows li {
  counter-increment: row;
  position: relative;
  padding: 16px 0 16px 38px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--body);
}
.rows li::before {
  content: counter(row, decimal-leading-zero);
  position: absolute;
  left: 0; top: 17px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
}
.project .chips { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.edu .body-text { margin-top: 12px; }
.awards { margin-top: 28px; }

/* ---------- Skills accordion ---------- */
.acc { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-head {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto 22px;
  align-items: center;
  gap: 8px;
  padding: 22px 0;
  background: none; border: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.acc-idx { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.acc-title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  transition: font-weight .3s ease;
}
.acc-item.open .acc-title { font-weight: 800; }
.acc-count { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--muted); }
/* plus that turns into a minus */
.acc-icon { position: relative; width: 14px; height: 14px; justify-self: end; }
.acc-icon::before, .acc-icon::after {
  content: '';
  position: absolute;
  left: 0; top: 6.25px;
  width: 14px; height: 1.5px;
  background: var(--text);
  transition: transform .35s ease;
}
.acc-icon::after { transform: rotate(90deg); }
.acc-item.open .acc-icon::after { transform: rotate(0deg); }

/* smooth height animation */
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s ease;
}
.acc-item.open .acc-panel { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; min-height: 0; }
.acc-inner .chips { margin: 0; padding: 0 0 24px 42px; gap: 8px; }
.acc-inner .chips li { padding: 7px 14px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .acc-panel, .acc-icon::before, .acc-icon::after { transition: none; } }

/* ---------- Contact ---------- */
.mail {
  display: inline-block;
  margin-top: 20px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.mail span { color: var(--muted); }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pill {
  padding: 11px 18px;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 36px;
  padding: 24px 20px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .18em;
}
.contact-form input,
.contact-form textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  text-transform: none;
  letter-spacing: normal;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-bottom-color: var(--text); }
.contact-form .btn { width: 100%; justify-content: space-between; }
.form-status { font-size: 14px; min-height: 20px; }
.form-status.ok { color: #9be3b0; }
.form-status.error { color: #f2a0a0; }

/* ---------- Footer ---------- */
.footer { padding: 40px 20px 24px; border-top: 1px solid var(--line); }
.footer-name {
  width: max-content;
  font-size: 22vw; /* JS fits it to the width */
  font-weight: 800;
  line-height: .9;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: -0.04em;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Scroll effects ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 50%;
  width: 100%; max-width: 430px;
  height: 2px;
  transform: translateX(-50%);
  z-index: 30;
  pointer-events: none;
  mix-blend-mode: difference; /* readable over both the light first page and the dark sections */
}
.scroll-progress::after {
  content: '';
  display: block;
  height: 100%;
  background: #ececec;
  transform: scaleX(var(--prog, 0));
  transform-origin: left;
}

/* headings: each word slides up in turn */
.js .section-title span {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
.js .section-title.in span { opacity: 1; transform: none; }
.js .section-title.in .b { transition-delay: .12s; }

/* lists, tags and pills stagger in */
.js .awards li,
.js .project .chips li,
.js .pills .pill {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .awards.in li,
.js .project.in .chips li,
.js .pills.in .pill { opacity: 1; transform: none; }
.awards.in li:nth-child(2), .project.in .chips li:nth-child(2), .pills.in .pill:nth-child(2) { transition-delay: .1s; }
.awards.in li:nth-child(3), .project.in .chips li:nth-child(3), .pills.in .pill:nth-child(3) { transition-delay: .2s; }
.project.in .chips li:nth-child(4) { transition-delay: .3s; }
.project.in .chips li:nth-child(5) { transition-delay: .4s; }

/* hover states */
.pill, .hero-contact { transition: background .3s ease, color .3s ease; }
.pill:hover, .hero-contact:hover { background: var(--text); color: var(--bg); }
.btn { transition: transform .3s ease, opacity .3s ease; }
.btn:hover { transform: translateY(-2px); }
.mail { transition: border-color .3s ease; }
.mail:hover { border-bottom-color: var(--text); }

/* the grey block behind each section drifts as it passes (where the browser supports it) */
@keyframes drift { from { transform: translateY(-36px); } to { transform: translateY(36px); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section::before { animation: drift linear both; animation-timeline: view(); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .section-title span,
  .js .awards li,
  .js .project .chips li,
  .js .pills .pill { opacity: 1; transform: none; transition: none; }
}
