/* ==========================================================================
   Personal Site Styles — Minimal, Editorial, Elevated
   Typography: EB Garamond + Figtree + DM Mono
   ========================================================================== */


/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */

:root {

  /* Colors */
  --canvas: #111214;
  --copy: #dedcd7;
  --copy-muted: #95948f;
  --link: #f3f1ec;
  --link-underline: rgba(243, 241, 236, 0.28);
  --link-hover: #ffffff;
  --accent-green: #4ade80;
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Fonts */
  --font-serif: "EB Garamond", Garamond, Georgia, Cambria, serif;
  --font-sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Easing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

}


/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--canvas);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--canvas);
  background-image: radial-gradient(circle at 50% 0%, #1a1c20 0%, #111214 75%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--copy);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}


/* --------------------------------------------------------------------------
   Links & Buttons
   -------------------------------------------------------------------------- */

a,
.email-copy,
.copy-prompt {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3.5px;
  transition:
    color 160ms var(--ease-smooth),
    text-decoration-color 160ms var(--ease-smooth),
    opacity 160ms var(--ease-smooth);
}

a:hover,
.email-copy:hover,
.copy-prompt:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 1.5px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Diagonal arrow on external links */
.link-arrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72em;
  line-height: 1;
  margin-left: 2px;
  opacity: 0.55;
  transform: translate(0, 0);
  transition:
    transform 200ms var(--ease-spring),
    opacity 160ms var(--ease-smooth);
  vertical-align: 0.08em;
}

a:hover .link-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}


/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.reference-page {
  min-height: 100vh;
  padding: 148px 24px 140px;
  display: flex;
  flex-direction: column;
}

.reference-column {
  width: min(100%, 740px);
  margin: 0 auto;
}


/* --------------------------------------------------------------------------
   Page Entrance Animations
   -------------------------------------------------------------------------- */

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

.identity  { animation: fadeUp 700ms var(--ease-spring)  50ms both; }
.bio       { animation: fadeUp 700ms var(--ease-spring) 130ms both; margin-top: 54px; }
.writeups  { animation: fadeUp 700ms var(--ease-spring) 210ms both; margin-top: 58px; }

.reference-footer {
  animation: fadeUp 700ms var(--ease-spring) 290ms both;
  margin-top: 58px;
}


/* --------------------------------------------------------------------------
   Identity Header
   -------------------------------------------------------------------------- */

.identity h1 {
  margin: 0;
  color: #f3f1ec;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.identity p {
  margin: 8px 0 0;
  color: var(--copy-muted);
  font-size: 17.5px;
  line-height: 1.45;
  letter-spacing: -0.005em;
}


/* --------------------------------------------------------------------------
   Bio Section
   -------------------------------------------------------------------------- */

.bio p {
  max-width: 700px;
  margin: 0 0 26px;
  color: var(--copy);
  font-size: 19px;
  line-height: 1.68;
}

.bio p:last-child {
  margin-bottom: 0;
}

.inline-link {
  color: var(--link);
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Projects Section
   -------------------------------------------------------------------------- */

.writeups h2 {
  margin: 0 0 14px;
  color: var(--copy-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.writeup-list {
  display: grid;
  gap: 12px;
}

.writeup {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: baseline;
  color: var(--copy);
  font-size: 18.5px;
  line-height: 1.6;
}

.writeup time {
  color: var(--copy-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.writeup p {
  margin: 0;
}

.project-link {
  display: inline-block;
  color: var(--link);
}

.project-desc {
  color: var(--copy);
  margin-left: 2px;
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.reference-footer {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--copy);
  font-size: 18.5px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
}

.email-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.email-copy,
.copy-prompt {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.copy-prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--copy-muted);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition:
    opacity 180ms var(--ease-smooth),
    transform 320ms var(--ease-spring),
    color 160ms var(--ease-smooth);
}

.email-copy:hover + .copy-prompt,
.copy-prompt:hover,
.email-copy:focus-visible + .copy-prompt,
.copy-prompt:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.copy-prompt.is-copied {
  color: var(--accent-green);
  text-decoration: none;
}


/* --------------------------------------------------------------------------
   Copy Toast
   -------------------------------------------------------------------------- */

.copy-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  color: #ebe9e4;
  background: rgba(26, 28, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 8px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 16px 36px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans);
  font-size: 13.5px;
  letter-spacing: -0.005em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition:
    opacity 220ms var(--ease-smooth),
    transform 340ms var(--ease-spring);
}

.copy-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.copy-toast-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 50%;
  color: var(--accent-green);
  font-size: 10.5px;
  line-height: 1;
  background: rgba(74, 222, 128, 0.08);
}


/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

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


/* --------------------------------------------------------------------------
   Responsive — Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {

  .reference-page   { padding: 80px 20px 72px; }

  .identity h1      { font-size: 25px; }
  .identity p       { font-size: 16px; }

  .bio              { margin-top: 44px; }
  .bio p            { font-size: 17.5px; line-height: 1.65; margin-bottom: 22px; }

  .writeups         { margin-top: 46px; }
  .writeup          { grid-template-columns: 64px 1fr; font-size: 17px; }

  .reference-footer { margin-top: 48px; gap: 20px; font-size: 17px; }

  .copy-prompt      { font-size: 12px; }
  .copy-toast       { right: 16px; bottom: 16px; font-size: 13px; }

}


/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
