/* Fonts */
@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("fonts/Inter-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* Design tokens and shared element styles */
:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #fff;
  color: #111;

  --ink: #111;
  --muted: #8b8b8b;
  --text-secondary: #666;
  --focus: #3155d9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-position: from-font;
}

a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

::selection {
  color: #fff;
  background: #3155d9;
}

/* Page frame and identity */
.page-shell {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding: 6rem 2rem;
}

.skip-link {
  position: absolute;
  z-index: 2;
  inset-block-start: .75rem;
  inset-inline-start: .75rem;
  padding: .625rem .875rem;
  transform: translateY(-160%);
  background: var(--ink);
  color: #fff;
}

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

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

.site-header {
  margin-block-end: 3rem;
}

.name {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.role {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

/* Work and About tab navigation */
main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1.5rem;
}

.section-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.section-tab {
  position: relative;
  min-height: 2.75rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.section-tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 500;
}

.tab-panel {
  min-width: 0;
}

/* Work list */
.project-list {
  display: flex;
  width: fit-content;
  max-width: calc(100% + 2rem);
  flex-direction: column;
  gap: .5rem;
  margin-block: 0;
  margin-inline: -1rem;
  padding: 0;
  list-style: none;
}

.project-row {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  transition:
    background-color 160ms ease-out,
    border-color 160ms ease-out,
    box-shadow 160ms ease-out;
}

.project-link {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.project-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.project-detail {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.5;
}

/* About copy and profile links */
.about-copy {
  max-width: 42rem;
}

.about-copy p {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1.25rem;
  margin-block-start: .5rem;
}

.text-link {
  position: relative;
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--text-secondary);
  font: inherit;
  text-decoration: none;
}

.text-link::after {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: .65rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  content: "";
}

.copy-email {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* Clipboard confirmation */
.copy-toast {
  position: fixed;
  z-index: 10;
  inset-inline: 1rem;
  inset-block-end: 1.5rem;
  display: flex;
  width: fit-content;
  max-width: calc(100vw - 2rem);
  align-items: center;
  gap: .625rem;
  margin-inline: auto;
  padding: .75rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: .875rem;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / .12);
  font-size: .875rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
}

.copy-toast.is-visible {
  opacity: 1;
}

/* Pointer states */
@media (hover: hover) {
  .project-row:hover {
    border-color: #f0f0f0;
    background: rgba(250, 250, 250, .85);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .025), inset 0 1px rgba(255, 255, 255, .8);
  }

  .text-link:hover::after {
    transform: scaleX(1);
  }
}

/* Motion and reduced-motion behavior */
@media (prefers-reduced-motion: no-preference) {
  .text-link::after {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 150ms ease-out;
  }

  .text-link:focus-visible::after {
    transform: scaleX(1);
  }

  .copy-toast {
    translate: 0 .5rem;
    transition-property: opacity, translate;
    transition-duration: 180ms;
    transition-timing-function: ease-out;
  }

  .copy-toast.is-visible {
    translate: 0 0;
  }

  /* animations.js reapplies this class when a tab panel becomes active. */
  .content-enter {
    animation: content-reveal 300ms ease-out both;
    animation-delay: var(--content-delay, 0ms);
  }

  /* Applied once at startup; tab changes only replay .content-enter. */
  .page-enter {
    animation: content-reveal 300ms ease-out both;
    animation-delay: var(--content-delay, 0ms);
  }

  @keyframes content-reveal {
    from {
      opacity: 0;
      filter: blur(4px);
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      filter: blur(0);
      transform: translateY(0);
    }
  }
}

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

  .text-link::after {
    transform: scaleX(1);
    opacity: 0;
    transition: opacity 150ms ease-out;
  }

  .text-link:hover::after,
  .text-link:focus-visible::after {
    opacity: 1;
  }

  .copy-toast {
    transition: opacity 150ms ease-out;
  }

  .content-enter {
    animation: content-fade 150ms ease-out both;
    animation-delay: var(--content-delay, 0ms);
  }

  .page-enter {
    animation: content-fade 150ms ease-out both;
    animation-delay: var(--content-delay, 0ms);
  }

  @keyframes content-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

[dir="rtl"] .text-link::after {
  transform-origin: right;
}

/* Small-screen spacing */
@media (max-width: 38rem) {
  .page-shell {
    padding: 3rem 1.5rem;
  }

  .site-header {
    margin-block-end: 3rem;
  }

  main {
    gap: 2.5rem;
  }

  .project-list {
    max-width: calc(100% + 1.5rem);
    margin-inline: -.75rem;
  }

  .project-row {
    padding-inline: .75rem;
  }
}

@media (forced-colors: active) {
  a:focus-visible {
    outline-color: Highlight;
  }
}
