:root {
  --paper: #f6f3ea;
  --paper-deep: #ebe6da;
  --navy: #071a2b;
  --navy-soft: #294154;
  --cyan: #38c6e6;
  --cyan-deep: #087b99;
  --cyan-pale: #dff7fb;
  --line: rgba(7, 26, 43, 0.14);
  --shadow: 0 24px 80px rgba(7, 26, 43, 0.11);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: var(--paper);
  background-image: url("assets/patterns/so-white.png");
  overscroll-behavior-y: none;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: clip;
  overscroll-behavior-y: none;
  color: var(--navy);
  background:
    radial-gradient(circle at 8% 6%, rgba(56, 198, 230, 0.14), transparent 28rem),
    linear-gradient(135deg, rgba(246, 243, 234, 0.92) 0%, rgba(251, 250, 246, 0.86) 52%, rgba(241, 237, 227, 0.92) 100%),
    url("assets/patterns/so-white.png");
  background-color: var(--paper);
  background-blend-mode: normal, multiply, multiply;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  color: white;
  background: var(--navy);
}

.skip-link:focus {
  width: auto;
  height: auto;
  padding: 10px 14px;
  overflow: visible;
  clip: auto;
  clip-path: none;
}

.profile-shell {
  width: min(100% - 28px, 720px);
  margin: 0 auto;
  padding: 24px 0 16px;
}

.identity {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: rise-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cover {
  position: relative;
  overflow: hidden;
  height: clamp(112px, 25vw, 180px);
  background: var(--navy);
}

.cover::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7, 26, 43, 0.36));
  content: "";
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.identity:hover .cover img {
  transform: scale(1.025);
}

.cover-mark {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 1;
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.identity__body {
  position: relative;
  padding: 0 32px 32px;
}

.avatar {
  width: 132px;
  height: 132px;
  margin-top: -66px;
  border: 5px solid var(--paper);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(7, 26, 43, 0.18);
}

.identity__copy {
  max-width: 590px;
  padding-top: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--navy-soft);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Iowan Old Style", Baskerville, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.8rem, 10vw, 5.4rem);
  line-height: 0.9;
}

.role {
  margin: 18px 0 0;
  color: var(--navy-soft);
  font-size: 1rem;
  font-weight: 650;
}

.bio {
  max-width: 46ch;
  margin: 10px 0 0;
  color: var(--navy-soft);
  font-size: 1rem;
}

.primary-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button svg,
.contact-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.contact-link:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.button--primary {
  color: var(--paper);
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(7, 26, 43, 0.18);
}

.button--primary:hover {
  color: var(--navy);
  background: var(--cyan);
  box-shadow: 0 10px 24px rgba(56, 198, 230, 0.25);
}

.button--quiet {
  color: var(--navy);
  background: var(--cyan-pale);
  border-color: rgba(56, 198, 230, 0.5);
}

.platform-note {
  margin: 10px 2px 0;
  color: var(--navy-soft);
  font-size: 0.76rem;
}

.connections,
.projects {
  padding: 78px 4px 28px;
}

.projects {
  padding-top: 48px;
}

.projects .section-heading {
  margin-bottom: 18px;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  line-height: 0.94;
}

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

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

.contact-link {
  display: grid;
  width: 100%;
  grid-template-columns: 46px 1fr 26px;
  gap: 16px;
  align-items: center;
  min-height: 82px;
  padding: 14px 12px;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  animation: link-in 460ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(180ms + var(--index) * 55ms);
  transition: color 180ms ease, background 180ms ease, padding 180ms ease;
}

.contact-link:hover {
  padding-right: 18px;
  padding-left: 18px;
  color: var(--navy);
  background: var(--cyan-pale);
}

.contact-link__icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.contact-link__icon svg {
  width: 21px;
  height: 21px;
}

.contact-link__copy {
  display: grid;
  min-width: 0;
}

.contact-link__copy strong {
  font-size: 1rem;
}

.contact-link__copy span {
  overflow: hidden;
  color: var(--navy-soft);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-link__arrow {
  transition: transform 180ms ease;
}

/*
 * Give project arrows explicit dimensions. WebKit otherwise uses an SVG's
 * intrinsic size when calculating this grid row, which can make each project
 * hundreds of pixels tall on iPhone even when Chromium emulation looks fine.
 */
.project-link > .contact-link__arrow {
  display: block;
  width: 22px;
  height: 22px;
  align-self: center;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-link:hover .contact-link__arrow {
  transform: translateX(4px);
}

.project-link {
  display: grid;
  grid-template-columns: 32px 1fr 22px;
  gap: 12px;
  align-items: start;
  padding: 14px 8px;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  opacity: 0;
  animation: link-in 460ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(220ms + var(--index) * 70ms);
  transition: background 180ms ease, padding 180ms ease;
}

.project-link__number {
  padding-top: 3px;
  color: var(--navy-soft);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.project-link__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.project-link__copy strong {
  font-family: "Iowan Old Style", Baskerville, "Times New Roman", serif;
  font-size: clamp(1.4rem, 4.5vw, 1.95rem);
  line-height: 1;
}

.project-link__copy span {
  color: var(--navy-soft);
  font-size: 0.82rem;
  line-height: 1.35;
}

.project-link__copy small {
  color: var(--navy-soft);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 34px 12px 0;
  color: var(--navy-soft);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-dialog {
  width: min(100% - 28px, 520px);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 34px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid white;
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(7, 26, 43, 0.36);
}

/* Keep closed top-layer UI from contributing intrinsic scroll height in WebKit. */
.contact-dialog:not([open]) {
  display: none !important;
}

.contact-dialog[open] {
  animation: dialog-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.contact-dialog::backdrop {
  background: rgba(7, 26, 43, 0.62);
  backdrop-filter: blur(6px);
}

.contact-dialog h2 {
  max-width: 9ch;
  font-size: 2.8rem;
  line-height: 0.95;
}

.contact-dialog p:not(.eyebrow) {
  margin: 18px 0 24px;
  color: var(--navy-soft);
}

.contact-dialog .button {
  width: 100%;
}

.ios-contact-tip {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.ios-contact-tip__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  color: var(--cyan-deep);
  background: var(--cyan-pale);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ios-contact-tip__label::before {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  content: "";
}

.ios-contact-tip h3 {
  margin: 12px 0 16px;
  font-family: var(--sans);
  font-size: clamp(1.2rem, 5vw, 1.55rem);
  line-height: 1.15;
}

.ios-contact-tip h3 strong {
  color: var(--cyan-deep);
}

.ios-contact-tip img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.turnstile-container:empty {
  display: none;
}

.turnstile-container {
  margin: 18px 0;
  overflow: hidden;
}

.verification-status {
  min-height: 1.5em;
  margin: 14px 0 18px !important;
  font-size: 0.86rem;
}

[hidden] {
  display: none !important;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.dialog-handle {
  display: none;
}

.toast {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  padding: 12px 16px;
  color: var(--paper);
  background: var(--navy);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast--visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

noscript {
  display: block;
  padding: 20px;
  text-align: center;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes link-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 680px) {
  .profile-shell {
    padding-top: 48px;
  }

  .identity__body {
    padding-right: 44px;
    padding-bottom: 42px;
    padding-left: 44px;
  }

  .avatar {
    width: 148px;
    height: 148px;
    margin-top: -74px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .project-link:hover {
    padding-right: 12px;
    padding-left: 12px;
    background: var(--cyan-pale);
  }

  .project-link:hover .contact-link__arrow {
    transform: translateX(4px);
  }
}

@media (max-width: 520px) {
  .profile-shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .identity {
    border-radius: 22px;
  }

  .identity__body {
    padding: 0 20px 24px;
  }

  .avatar {
    width: 96px;
    height: 96px;
    margin-top: -48px;
    border-width: 4px;
  }

  .cover-mark {
    top: 16px;
    right: 16px;
  }

  .identity__copy {
    padding-top: 16px;
  }

  h1 {
    font-size: clamp(2.7rem, 16vw, 4.2rem);
  }

  .primary-actions {
    grid-template-columns: 1fr;
  }

  .connections {
    padding-top: 58px;
  }

  .projects {
    padding-top: 38px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-link {
    min-height: 78px;
  }

  .contact-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 34px 22px 24px;
    border-radius: 24px 24px 0 0;
  }

  .dialog-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: -20px auto 24px;
    background: var(--line);
    border-radius: 999px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
