:root {
  --background: #ffffff;
  --card-background: #f2f2f2;
  --primary-text: #1a1a1a;
  --secondary-text: #666666;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --radius: 16px;
  --content-width: 1340px;
  /* iOS system UI sans (San Francisco on Apple devices); matches how native list UIs look on iPhone. */
  --font-ios-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Single editorial serif sitewide (Instrument Serif loads from Google Fonts in index.html). */
  --font-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  /* Keeps layout width stable when vertical scrollbar appears/disappears between tabs. */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  background: var(--background);
  color: var(--primary-text);
}

.site-shell {
  max-width: var(--content-width);
  margin: 20px auto 48px;
  padding: 0 16px;
}

.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  width: min(100%, 560px);
  margin: 0 auto 24px;
  padding: 6px 8px;
  gap: 4px;
  background: #ffffff;
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.tab-button {
  border: 0;
  background: transparent;
  color: #6f6f6f;
  font-family: var(--font-ios-ui);
  font-size: 15px;
  /* Same weight active/inactive so label width does not shift the pill between tabs. */
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  min-width: 0;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab-button:not(.is-active):hover {
  color: #1a1a1a;
}

.tab-button.is-active {
  background: #f0f0f0;
  color: #1a1a1a;
}

.tab-button.is-active:hover {
  background: #e8e8e8;
  color: #1a1a1a;
}

.tab-button:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.tab-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tab-panel.is-active {
  display: block;
  opacity: 1;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  text-align: center;
  margin: 6px 0 24px;
  letter-spacing: -0.01em;
}

.quote-author {
  text-align: center;
  color: var(--secondary-text);
  margin-top: -10px;
  margin-bottom: 24px;
}

.william-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.about-card h3,
.work-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.work-card h3 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--primary-text);
}

.about-panel {
  min-height: 100%;
}

.about-row {
  padding: 14px 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.about-row:first-of-type {
  border-top: 0;
}

.about-card p,
.work-card p {
  margin: 0;
  color: var(--secondary-text);
  line-height: 1.6;
}

.work-card-items {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.work-card-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-card-link:hover {
  color: #000000;
}

.work-card-item-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--secondary-text);
  line-height: 1.55;
}

/* --- Work tab: logos, rich copy, quote callouts, link buttons */
.work-card-logo-row {
  margin: 0 0 14px;
}

.work-card-logo {
  display: block;
  max-height: 40px;
  width: auto;
}

.work-card-rich {
  margin-top: 4px;
}

.work-card-rich > *:first-child {
  margin-top: 0;
}

.work-card-subheading {
  margin: 20px 0 10px;
  font-size: calc(15px + 1pt);
  font-weight: 600;
  color: var(--primary-text);
}

.work-card-subheading:first-child {
  margin-top: 0;
}

.work-card-items-heading {
  margin-top: 22px;
}

.work-card-rich + .work-card-subheading.work-card-items-heading,
.work-card-rich + .work-card-items {
  margin-top: 20px;
}

.work-card-rich-p {
  margin: 0 0 14px;
  color: var(--secondary-text);
  line-height: 1.6;
  white-space: pre-line;
}

.work-card-rich-p--section-start {
  margin-top: 0;
  padding-top: 32px;
}

.work-inline-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-inline-link:hover {
  color: #000000;
}

.work-link-button {
  display: inline-block;
  margin: 6px 8px 0 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--primary-text);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.work-link-button:hover {
  border-color: rgba(26, 26, 26, 0.22);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.work-quote-callout {
  margin: 14px 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: #e4e4e4;
  color: #3a3a3a;
}

.work-quote-callout--hero {
  margin: 0 0 20px;
}

.work-quote-callout--nested {
  margin: 10px 0 0;
}

.work-quote-callout-text {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.work-quote-callout-attribution {
  margin: 10px 0 0;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  color: #555555;
}

.work-rich-list {
  margin: 0 0 14px;
  padding-left: 1.25rem;
  color: var(--secondary-text);
  line-height: 1.55;
}

.work-rich-list--nested {
  margin: 8px 0 4px;
}

.work-rich-li {
  margin: 0 0 8px;
}

.work-rich-li--quote {
  list-style: none;
  margin-left: -1.25rem;
}

.work-rich-li--button-row {
  list-style: none;
}

.work-rich-list--nested > .work-rich-li--button-row {
  margin-left: -1.25rem;
  padding-left: 0;
}

.about-row h3 {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #6f6f6f;
}

.about-row p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-line;
}

.stack {
  display: grid;
  gap: 16px;
}

.image-card {
  padding: 0;
  overflow: hidden;
  position: relative;
}

.headshot-slider {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.headshot-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.8s ease;
}

.image-card.no-slide-transition .headshot-frame {
  transition: none;
}

.headshot-current {
  opacity: 1;
}

.headshot-next {
  opacity: 0;
}

.image-card.is-sliding .headshot-current {
  opacity: 0;
}

.image-card.is-sliding .headshot-next {
  opacity: 1;
}

.headshot-app-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  aspect-ratio: auto;
  object-fit: cover;
  box-shadow: var(--shadow);
  z-index: 2;
}

.right-column {
  display: grid;
  gap: 16px;
}

.square-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.media-card {
  display: grid;
  min-height: 360px;
  grid-template-rows: auto 1fr;
  position: relative;
  font-family: var(--font-ios-ui);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.015em;
}

.media-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.media-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.media-row-app-icon-only {
  justify-content: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}

.media-app-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.media-heading-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-text);
}

.media-pane {
  margin-top: 12px;
  border-radius: 12px;
  overflow: auto;
  min-height: 250px;
  max-height: 250px;
  padding: 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.media-pane::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.media-card-spotify .media-pane {
  background: #121212;
}

.spotify-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  padding: 6px 0;
  min-height: 56px;
  contain: layout style;
}

.spotify-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.spotify-item img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.spotify-item > div:not(.spotify-thumb) {
  min-width: 0;
}

.spotify-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate3d(-50%, -50%, 0);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(110, 110, 110, 0.9);
  color: #f1f1f1;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  will-change: opacity;
}

.spotify-play-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#d6d6d6 var(--play-progress, 0%), rgba(200, 200, 200, 0.25) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
  pointer-events: none;
}

.spotify-play-icon {
  position: absolute;
  z-index: 1;
  width: 12px;
  height: 12px;
  display: block;
  pointer-events: none;
}

.spotify-icon-play,
.spotify-icon-pause {
  position: absolute;
  inset: 0;
}

.spotify-icon-play {
  width: 0;
  height: 0;
  top: 1px;
  left: 3px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #f1f1f1;
}

.spotify-icon-pause {
  opacity: 0;
  background: linear-gradient(
    to right,
    #f1f1f1 0 3px,
    transparent 3px 6px,
    #f1f1f1 6px 9px,
    transparent 9px 12px
  );
}

.spotify-item.has-preview:hover .spotify-play-badge,
.spotify-item.has-preview:focus-visible .spotify-play-badge,
.spotify-item.is-preview-playing .spotify-play-badge,
.spotify-item.is-preview-paused .spotify-play-badge {
  opacity: 1;
}

.spotify-item.is-preview-playing .spotify-icon-play,
.spotify-item.is-preview-paused .spotify-icon-play {
  opacity: 0;
}

.spotify-item.is-preview-playing .spotify-icon-pause,
.spotify-item.is-preview-paused .spotify-icon-pause {
  opacity: 1;
}

.spotify-title {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}

.spotify-artist {
  margin: 2px 0 0;
  color: #b3b3b3;
  font-size: 13px;
}

.media-card-beli .media-pane {
  background: #ffffff;
}

.beli-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--primary-text);
  padding: 8px 0;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.beli-item:last-child {
  border-bottom: 0;
}

.beli-item img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.beli-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.beli-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: #666666;
}

.beli-score {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #d9dfd9;
  color: #14916a;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.media-card-goodreads .media-pane {
  background: #f8f7f2;
}

.goodreads-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--primary-text);
  padding: 8px 0;
  border-bottom: 1px solid rgba(85, 59, 8, 0.15);
}

.goodreads-item:last-child {
  border-bottom: 0;
}

.goodreads-item img {
  width: 40px;
  height: 56px;
  object-fit: cover;
}

.goodreads-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.goodreads-author {
  margin: 2px 0 0;
  color: #6c6c6c;
  font-size: 13px;
}

.media-card-letterboxd .media-pane {
  background: #1b2632;
  max-height: 285px;
  min-height: 285px;
}

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

.letterboxd-item img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.work-layout {
  display: grid;
  gap: 16px;
}

.adventure-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.adventure-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  min-height: 210px;
  background: #d7d7d7;
}

.adventure-card img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.adventure-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.adventure-card:hover .adventure-overlay {
  opacity: 1;
}

.adventure-title {
  margin: 0 0 10px;
  max-width: 100%;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  /* Twice the former 14px overlay title; same scale as `.quote` on the adventures tab */
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.adventure-subtext {
  margin: 0;
  max-width: 32em;
  font-family: "DM Sans", sans-serif;
  font-size: 12pt;
  line-height: 1.45;
  font-weight: 400;
}

.contact-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 920px);
  height: min(620px, calc(100vh - 100px));
  margin: 0 auto;
  padding: 12px 18px 18px;
  background: #fbfbfde0;
  border-radius: 34px;
}

.contact-phone-header {
  flex-shrink: 0;
  font-family: var(--font-ios-ui);
  -webkit-font-smoothing: antialiased;
}

.contact-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #000000;
  letter-spacing: -0.02em;
}

.contact-status-time {
  font-variant-numeric: tabular-nums;
}

.contact-status-indicators {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-signal-bars {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 3px;
  height: 12px;
}

.contact-signal-bar {
  width: 3px;
  border-radius: 1px;
  background: #1a1a1a;
}

.contact-signal-bar:nth-child(1) {
  height: 4px;
}

.contact-signal-bar:nth-child(2) {
  height: 6px;
}

.contact-signal-bar:nth-child(3) {
  height: 9px;
}

.contact-signal-bar:nth-child(4) {
  height: 12px;
}

.contact-battery {
  box-sizing: border-box;
  width: 28px;
  height: 13px;
  padding: 2px;
  border: 1.5px solid #1a1a1a;
  border-radius: 4px;
}

.contact-battery-level {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 1px;
  background: #1a1a1a;
}

.contact-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 4px 8px;
}

.contact-profile-photo-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.contact-profile-pill {
  width: min(100%, 280px);
  padding: 12px 18px 10px;
  text-align: center;
  background: #efeff2;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.contact-profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
  color: #000000;
}

.contact-profile-chevron {
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: #c7c7cc;
}

.contact-profile-location {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: #8e8e93;
}

.contact-chat-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.contact-chat-thread {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.contact-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.contact-bubble-row-outgoing {
  justify-content: flex-end;
}

.contact-bubble-enter {
  opacity: 0;
  transform: translateY(16px);
  transition: transform 220ms ease, opacity 220ms ease;
}

.contact-bubble-enter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.contact-chat-name {
  margin: 0 0 4px;
  color: #8e8e93;
  font-size: 15px;
}

.contact-bubble {
  margin: 0;
  max-width: 620px;
  border-radius: 26px;
  padding: 10px 14px;
  line-height: 1.3;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.contact-bubble-incoming {
  background: #efeff1;
  color: #121212;
}

.contact-bubble-outgoing {
  background: #0a84ff;
  color: #ffffff;
}

.contact-form {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.contact-composer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 2px solid #e3e4e8;
  border-radius: 999px;
  background: #ffffff;
  min-height: 49px;
  padding: 4px;
}

.contact-composer-icons {
  display: flex;
  gap: 8px;
  padding-left: 4px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f1f4;
  color: #8f949c;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
}

.icon-link-flat:hover {
  background: #e7e9ed;
}

.contact-composer-row textarea {
  border: 0;
  resize: none;
  min-height: 28px;
  overflow-y: hidden;
  padding: 5px 8px;
  font: inherit;
  font-size: 20px;
  line-height: 1.0;
}

.contact-composer-row textarea:focus {
  outline: none;
}

.contact-generated-row .contact-avatar {
  width: 40px;
  height: 40px;
}

.contact-send-button {
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
  background: #b8bfca;
  cursor: pointer;
  margin-right: 3px;
}

.contact-send-button:hover {
  background: #0a84ff;
}

@media (prefers-reduced-motion: reduce) {
  .contact-bubble-enter {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.contact-form-message {
  margin: 2px 8px 0;
  font-size: 13px;
}

.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;
}

.is-error {
  color: #9e1f1f;
}

.is-success {
  color: #137f2f;
}

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

}

@media (max-width: 768px) {
  .william-layout {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 32px;
  }

  .about-row p {
    font-size: 16px;
  }

  .quote {
    font-size: 24px;
  }

  .adventure-title {
    font-size: 24px;
  }

  .contact-bubble {
    font-size: 18px;
  }

  .contact-composer-row textarea {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .square-grid,
  .adventure-grid {
    grid-template-columns: 1fr;
  }

}
