
:root {
  color-scheme: dark;
  --bg: #0b1119;
  --surface: #101a26;
  --raised: #142130;
  --text: #f3f9fc;
  --muted: #afbfcd;
  --line: #293747;
  --grid: rgba(151, 190, 201, .045);
  --accent: #e886b3;
  --accent-ink: #21111c;
  --pinkwash: #211723;
  --shadow: 0 20px 60px #0005;
  --max: 1160px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

body.light-theme {
  color-scheme: light;
  --bg: #edf3f6;
  --surface: #f8fbfc;
  --raised: #e3edf2;
  --text: #14202a;
  --muted: #4a5e6d;
  --line: #c3d2dc;
  --grid: rgba(35, 65, 85, .06);
  --accent: #a82d67;
  --accent-ink: #fff;
  --pinkwash: #f7e9f0;
  --shadow: 0 20px 60px #243b4a18;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

button,
a,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button,
select {
  color: var(--text);
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.12;
  overflow-wrap: anywhere;
}

dt {
  overflow-wrap: anywhere;
}

dd {
  margin: 0;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(var(--max), calc(100% - 80px));
  margin-inline: auto;
}

.mono {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .02em;
}

.pink {
  color: var(--accent);
}

.eyebrow {
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.navigation {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 78px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: 1;
}

.logo span {
  color: var(--accent);
}

.nav-note {
  padding-left: 24px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8125rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.nav-links a {
  padding: 12px 0;
  color: var(--muted);
  font-size: .875rem;
}

.nav-links a:hover,
.nav-links a[aria-current="location"],
.nav-links a[aria-current="page"] {
  color: var(--accent);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--accent);
  background: var(--raised);
}

.menu-button {
  display: none;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-size: .875rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: .875rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}

.button:hover {
  border-color: var(--accent);
  background: var(--raised);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button.primary:hover {
  filter: brightness(1.08);
}

.quiet-button {
  min-height: 32px;
  margin-top: 16px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.6;
}

.quiet-button:hover {
  color: var(--accent);
}

.inline-link {
  min-height: 32px;
  margin-top: 11px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  min-height: 660px;
  padding-top: 80px;
  padding-bottom: 30px;
}

.intro-copy {
  min-width: 0;
}

.greeting-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  height: 1.18em;
  margin-top: 25px;
  font-size: clamp(2.8rem, 4.2vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.greeting-line #typewriter {
  display: inline;
  min-width: 0;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

.greeting-line [lang="ar"],
.greeting-line #typewriter[lang="ar"] {
  letter-spacing: 0;
  line-height: 1.2;
}

.typing-cursor {
  color: var(--accent);
  font-weight: 300;
  white-space: nowrap;
  animation: blink 1s step-end infinite;
}

body.motion-paused .typing-cursor {
  animation: none;
}

.intro h1 {
  max-width: 100%;
  margin: 2px 0 24px;
  font-size: clamp(2.75rem, 4.3vw, 4.5rem);
  font-weight: 750;
  letter-spacing: -.05em;
  text-wrap: balance;
}

.intro h1.intro-title {
  margin: 24px 0;
  font-size: clamp(2.7rem, 4.6vw, 4.2rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.18;
  text-wrap: initial;
}

.intro-title .greeting-line {
  display: grid;
  gap: 0;
  height: auto;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  line-height: 1.18;
}

.greeting-reserve,
.greeting-actual {
  grid-area: 1 / 1;
  align-self: start;
  min-width: 0;
}

.greeting-reserve {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.greeting-reserve > span {
  grid-area: 1 / 1;
  overflow-wrap: anywhere;
}

.intro-lead {
  max-width: 490px;
  font-size: 1.25rem;
  font-weight: 450;
  line-height: 1.5;
}

.intro-description {
  max-width: 510px;
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-orbit {
  display: grid;
  place-items: center;
  gap: 26px;
  min-width: 0;
}

.home-orbit > p {
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}

.home-orbit-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(420px, 100%);
  min-height: min-content;
  aspect-ratio: 1;
  container-type: inline-size;
}

.section {
  padding-block: 84px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.section h2 {
  margin-top: 13px;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 650;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.section-heading > p {
  max-width: 330px;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.6;
}

.stacked-heading {
  display: block;
  margin-bottom: 24px;
}

.stacked-heading > p {
  max-width: none;
  margin-top: 15px;
}

.section-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.section-more .button {
  min-height: 40px;
  padding: 8px 16px;
  font-size: .8125rem;
}

.about-section .section-more {
  margin-top: 0;
}

.contact-section .section-more {
  margin-top: 20px;
}

.home-page .section-more {
  width: 100%;
  margin-top: 32px;
}

.home-page .section-more .button {
  gap: 16px;
  min-height: 52px;
  padding: 14px 24px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 5px 0 var(--pinkwash);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.home-page .section-more .button:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--pinkwash);
}

.home-page .section-more .button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 5px;
}

.home-page .section-more .button:active {
  transform: translateY(0);
  box-shadow: 0 3px 0 var(--pinkwash);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: .875rem;
  transition: background .15s;
}

.filter:hover {
  border-color: var(--accent);
}

.filter.active {
  border-color: var(--accent);
  background: var(--pinkwash);
  color: var(--accent);
}

.project-toolbar {
  margin-bottom: 26px;
}

.filter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}

.format-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .8125rem;
}

select {
  min-height: 40px;
  max-width: 100%;
  padding: 6px 30px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: .875rem;
}

.result-count {
  color: var(--muted);
  font-size: .75rem;
}

.filter-meta .result-count {
  max-width: 100%;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color .18s, transform .18s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.project-preview {
  position: relative;
  height: 140px;
  padding: 10px 16px 27px;
  border-bottom: 1px solid var(--line);
  background: #101a26;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-label {
  position: absolute;
  bottom: 9px;
  left: 17px;
  color: #aabacb;
  font-size: .75rem;
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 18px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  color: var(--muted);
  font-size: .75rem;
}

.card-meta > span {
  min-width: 0;
}

.status {
  color: var(--accent);
  font-size: .75rem;
  white-space: nowrap;
}

.status.completed {
  color: var(--muted);
}

.project-card h3 {
  min-height: 3.125rem;
  margin-top: 13px;
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.card-intro {
  min-height: 2.8125rem;
  margin-top: 8px;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
}

.project-facts {
  display: grid;
  gap: 9px;
  margin: 16px 0 14px;
}

.project-facts > div {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  font-size: .875rem;
  line-height: 1.5;
}

.project-facts dt {
  padding-top: 2px;
  color: var(--muted);
  font-size: .75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tags span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: .75rem;
}

.project-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  font-size: .875rem;
  font-weight: 550;
}

.project-button:hover {
  border-color: var(--accent);
  background: var(--pinkwash);
  color: var(--accent);
}

.empty-state {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
}

.empty-state p {
  margin: 12px 0 22px;
  color: var(--muted);
}

.no-script {
  margin-top: 20px;
  color: var(--muted);
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 74px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 20px;
  color: var(--muted);
}

.about-copy h2 {
  margin-bottom: 25px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.skills-panel {
  align-self: center;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.skills-panel > p {
  color: var(--accent);
}

.skills-panel dl {
  display: grid;
  gap: 20px;
  margin: 20px 0 0;
}

.skills-panel dt {
  font-size: .875rem;
  font-weight: 600;
}

.skills-panel dd {
  margin-top: 5px;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.65;
}

.personal-note {
  margin-top: 23px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.6;
}

.home-page #about {
  column-gap: 48px;
  row-gap: 24px;
  padding-bottom: 42px;
}

.home-page #about .skills-panel {
  align-self: center;
}

.home-page #about .section-more {
  margin-top: 0;
}

.home-page #experience {
  padding-top: 48px;
}

.experience-controls {
  margin-bottom: 16px;
}

#experience-count {
  margin-bottom: 20px;
}

.experience-list {
  border-top: 1px solid var(--line);
}

.experience-entry {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 34px;
  min-width: 0;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.experience-date {
  padding-top: 2px;
  color: var(--accent);
}

.experience-date span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .75rem;
}

.experience-kind {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .8125rem;
}

.experience-entry h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
}

.experience-entry p:not(.experience-kind) {
  max-width: 690px;
  margin-top: 11px;
  color: var(--muted);
  font-size: .9375rem;
}

.entry-tag {
  align-self: start;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: .75rem;
}

.contact-section {
  padding-top: 20px;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  padding: 42px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 16px;
  background: var(--pinkwash);
}

.contact-card > div {
  min-width: 0;
}

.contact-card h2 {
  margin-bottom: 16px;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.contact-card p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.contact-actions .button {
  min-height: 50px;
}

.email-address {
  display: block;
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: .875rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.email-address:hover {
  color: var(--accent);
}

.message-section {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 64px;
  padding-bottom: 84px;
}

.message-intro h2 {
  margin-top: 14px;
  font-size: clamp(1.65rem, 2.5vw, 2.1rem);
  letter-spacing: -.03em;
}

.message-intro > p:not(.eyebrow) {
  margin-top: 18px;
  color: var(--muted);
}

.privacy-note {
  font-size: .875rem;
}

.contact-form {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.contact-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: .875rem;
  font-weight: 550;
}

.contact-form .muted {
  display: inline;
  color: var(--muted);
  font-weight: 400;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form textarea::placeholder {
  color: var(--muted);
}

.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.form-submit {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.form-submit p {
  color: var(--accent);
  font-size: .875rem;
  line-height: 1.6;
}

.form-submit .form-error {
  color: var(--text);
}

.inbox-heading {
  margin-top: 32px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.04em;
}

.inbox-intro {
  margin-top: 16px;
  color: var(--muted);
}

.message-list {
  display: grid;
  gap: 20px;
  margin: 32px 0 60px;
}

.inbox-message {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.inbox-message h2 {
  font-size: 1.3rem;
}

.inbox-message .message-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.inbox-message .message-text {
  margin-top: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inbox-message .button {
  margin-top: 22px;
}

.inbox-pages {
  display: flex;
  gap: 14px;
  margin-bottom: 60px;
}

.page-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 34px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8125rem;
}

.page-crumb a:hover {
  color: var(--accent);
}

.detail-main {
  min-height: calc(100dvh - 200px);
}

.detail-section {
  padding-top: 40px;
  border-top: 0;
}

.detail-section h1 {
  margin-top: 13px;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1.15;
}

.detail-section.about-section {
  border-bottom: 0;
}

.detail-section.contact-section {
  padding-bottom: 40px;
}

.detail-section .contact-card h1 {
  margin-bottom: 16px;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.projects-main {
  min-height: calc(100dvh - 200px);
  padding-bottom: 80px;
}

.projects-heading,
.contact-heading {
  padding: 28px 0 24px;
}

.projects-heading h1,
.contact-heading h1 {
  margin: 14px 0 20px;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 650;
  letter-spacing: -.045em;
}

.projects-intro,
.contact-heading > p:not(.eyebrow) {
  max-width: 700px;
  color: var(--muted);
}

.skills-overview {
  margin-bottom: 20px;
}

.skills-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.skills-heading-row h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.skills-intro {
  margin-top: 6px;
  color: var(--muted);
  font-size: .875rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.skill-box {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.skill-box.active {
  border-color: var(--accent);
}

.category-filter {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}

.category-filter:hover,
.category-filter.active {
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.skill-filter {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.4;
  text-align: left;
}

.skill-filter:hover {
  border-color: var(--accent);
  color: var(--text);
}

.skill-filter.active {
  border-color: var(--accent);
  background: var(--pinkwash);
  color: var(--accent);
}

.skills-heading-row > .skill-filter {
  flex-shrink: 0;
}

.project-filter-status {
  margin-top: 12px;
  color: var(--muted);
}

.projects-page .project-media {
  height: 190px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}

.projects-page .project-image {
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
}

.project-image-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.projects-page .project-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 20px;
}

.project-context,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-context span,
.project-tags span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: .6875rem;
}

.project-context span {
  background: var(--pinkwash);
  color: var(--accent);
}

.project-date {
  margin-top: 12px;
  color: var(--muted);
  font-size: .8125rem;
}

.projects-page .project-info h2 {
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.project-description {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.65;
}

.projects-page .project-info .project-tags {
  margin-top: auto;
}

.project-open {
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: .875rem;
}

.project-open:hover {
  border-color: var(--accent);
  background: var(--pinkwash);
  color: var(--accent);
}

#project-dialog {
  width: min(800px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

#project-dialog::backdrop {
  background: rgba(3, 7, 12, .78);
  backdrop-filter: blur(5px);
}

.popup-content {
  padding: clamp(20px, 4vw, 38px);
}

.dialog-shell {
  padding: 0 clamp(22px, 4vw, 42px) 36px;
}

.popup-header,
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.popup-header {
  margin-bottom: 22px;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-bottom: 26px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dialog-header .eyebrow {
  font-size: .72rem;
  letter-spacing: .12em;
}

#dialog-close,
#popup-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
}

#dialog-close:hover,
#popup-close:hover {
  border-color: var(--accent);
  background: var(--pinkwash);
  color: var(--accent);
}

#popup-title {
  margin-top: 14px;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.popup-summary {
  margin-top: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.popup-image {
  width: 100%;
  max-height: 360px;
  margin-top: 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
  object-fit: contain;
}

.popup-case-study {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.popup-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.popup-section h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

.popup-section p {
  color: var(--muted);
  white-space: pre-line;
  line-height: 1.75;
}

.popup-section ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.75;
}

.popup-section li + li {
  margin-top: 10px;
}

.popup-section li > ul {
  margin-top: 10px;
}

.popup-section li::marker {
  color: var(--accent);
}

.popup-tags {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

#dialog-content > h2 {
  margin-bottom: 18px;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.dialog-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.dialog-metadata span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: .75rem;
}

.dialog-intro {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.8;
}

.dialog-image {
  width: 100%;
  max-height: 320px;
  margin-bottom: 26px;
  border-radius: 10px;
  object-fit: contain;
}

.dialog-details {
  display: grid;
  gap: 24px;
}

.dialog-details section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.dialog-details h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.dialog-details p,
.dialog-details li {
  color: var(--muted);
  line-height: 1.8;
}

.dialog-details ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.summary-content {
  display: grid;
  gap: 26px;
}

.summary-opening {
  display: grid;
  gap: 16px;
}

.summary-content h2 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1.15;
  text-wrap: balance;
}

.summary-content p,
.summary-content li {
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.8;
}

.summary-content .summary-intro {
  color: var(--text);
  font-size: 1.2rem;
}

.summary-content strong {
  color: var(--text);
  font-weight: 650;
}

.summary-content section {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.summary-content h3 {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
}

.summary-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-projects li {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.summary-projects li > strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.4;
}

.summary-projects li p {
  font-size: .9rem;
  line-height: 1.75;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.summary-actions .button {
  gap: 8px;
  min-height: 48px;
}

@keyframes blink {
50% { opacity: 0; }
}

@media (max-width: 960px) {
  .nav-note {
    display: none;
  }
  
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .intro {
    gap: 24px;
  }
  
  .about-section {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 32px);
  }
  
  .navigation {
    min-height: 68px;
    gap: 12px;
  }
  
  .navigation > .icon-button {
    margin-left: auto;
  }
  
  .menu-button {
    display: block;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  
  .nav-links a {
    padding: 12px;
  }
  
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .skills-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  
  .projects-heading,
.contact-heading {
    padding-top: 30px;
  }
  
  .projects-main {
    padding-bottom: 48px;
  }
  
  .intro,
  .about-section,
  .contact-card,
  .message-section {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .intro {
    padding-top: 48px;
  }
  
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  
  .section {
    padding-block: 48px;
  }
  
  .home-page #about {
    column-gap: 0;
    row-gap: 24px;
    padding-bottom: 32px;
  }
  
  .home-page #experience {
    padding-top: 36px;
  }
  
  .experience-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  
  .entry-tag {
    justify-self: start;
  }
  
  .contact-card {
    padding: 24px;
  }
  
  .contact-actions {
    justify-content: flex-start;
  }
  
  .form-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .home-page .section-more .button {
    width: 100%;
  }
  
  #project-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }
  
  .dialog-shell {
    padding-inline: 20px;
    padding-bottom: 24px;
  }
  
  .summary-content {
    gap: 22px;
  }
  
  .summary-projects {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .summary-projects li {
    padding: 16px;
  }
  
  .summary-actions .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .typing-cursor {
    animation: none;
  }
  
  .project-card,
  .home-page .section-more .button {
    transition: none;
  }
  
  .home-page .section-more .button:hover {
    transform: none;
  }
}

.portrait-orbit {
  gap: 0;
}

.portrait-circle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 68%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 16px 45px #0002;
}

.portrait-circle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portrait-ring {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}

.portrait-ring-inner {
  inset: 8%;
}

.portrait-satellite {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--bg);
  font-size: 25px;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(-20deg);
}

.portrait-ufo {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--bg);
  font-size: 27px;
  line-height: 1;
  transform: translate(50%, -50%) rotate(15deg);
}

/* Static outer portrait orbit. */
.portrait-ring-outer {
  inset: 0;
  opacity: 1;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
}

/* Footer: logo, centred copyright, social links and back-to-top. */
.footer.footer-refreshed {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 28px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
}
.footer-main, .footer-bottom {
  display: contents;
}
.footer .logo {
  grid-column: 1;
  grid-row: 1;
  color: var(--text);
  font-size: 1.65rem;
}
.footer-socials {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-self: end;
  gap: 20px;
}
.footer-socials a, .footer-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.footer-socials a {
  color: var(--text);
  font-size: .8125rem;
}
.footer-top {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  color: var(--muted);
  font-size: .75rem;
}
.footer a:hover {
  color: var(--accent);
}
.footer-bottom > span {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  font-size: .75rem;
  line-height: 1.5;
}
.footer-bottom > span:last-child {
  grid-column: 3 / 5;
  grid-row: 2;
  justify-self: end;
  font-size: .6875rem;
}
@media (max-width: 640px) {
  .footer.footer-refreshed {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 20px;
    padding-block: 18px;
  }
  .footer-bottom > span:first-child {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .footer-socials {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
  .footer-top {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  .footer-bottom > span:last-child {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: end;
  }
}

/* Intro location strip. */
.intro-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
}
.intro-footer a:hover { color: var(--accent); }
@media (max-width: 640px) {
  .intro-footer { align-items: flex-start; flex-direction: column; }
}