/* ============ Tokens ============ */
:root {
  --bg: #fafaf9;
  --bg-alt: #f2f2ef;
  --surface: #ffffff;
  --text: #18181b;
  --text-muted: #57575f;
  --border: #e4e4e0;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #ccfbf1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --max-width: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #151820;
    --surface: #1a1d25;
    --text: #ececef;
    --text-muted: #a0a3ad;
    --border: #2a2e38;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text);
}

/* ============ Hero ============ */
.hero {
  padding: 96px 0 88px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  font-weight: 800;
}

.tagline {
  margin: 12px 0 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--text-muted);
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
}

.hero-roles li:not(:last-child)::after {
  content: "·";
  margin: 0 12px;
  color: var(--accent);
  font-weight: 700;
}

.hero-sub {
  max-width: 580px;
  margin: 24px 0 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  color: #fff;
  background: var(--accent);
}

.btn-primary:hover {
  color: #fff;
  background: var(--accent-hover);
}

@media (prefers-color-scheme: dark) {
  .btn-primary,
  .btn-primary:hover {
    color: #0f1115;
  }
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Not clickable until the App Store link exists */
.btn-soon {
  cursor: default;
}

.btn-soon:hover {
  border-color: var(--border);
}

/* ============ Sections ============ */
.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin-bottom: 36px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
}

/* ============ Projects ============ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

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

.project-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.project-card p {
  margin: 12px 0 0;
  font-size: 15.5px;
  color: var(--text-muted);
}

.project-card-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.project-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.project-link {
  font-size: 15px;
  font-weight: 600;
}

.project-link-secondary {
  color: var(--text-muted);
}

.project-link-secondary:hover {
  color: var(--text);
}

.project-card .project-date {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============ Hero layout + featured project ============ */
.intro {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 96px;
}

.avatar-figure {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 400px;
}

/* "Hi, I'm" as a hand-drawn speech bubble pointing at the photo */
.speech {
  position: relative;
  display: inline-block;
  margin: 0 0 18px;
  padding: 8px 18px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 2.5px solid var(--text);
  border-radius: 20px;
}

.speech::after {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 10px;
  width: 14px;
  height: 14px;
  background: var(--bg);
  border-left: 2.5px solid var(--text);
  border-bottom: 2.5px solid var(--text);
  transform: rotate(45deg);
}

.avatar {
  position: relative;
  z-index: 1;
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
  margin-left: 200px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent-soft);
}

.stick-body {
  width: 400px;
  height: auto;
  margin-top: -2px;
  overflow: visible;
}

.fig-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fig-hand {
  fill: var(--text);
}

.wave-arm {
  transform-box: view-box;
  transform-origin: 395px 10px;
}

/* Waves continuously */
.wave-arm {
  animation: wave 1s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(-22deg); }
  50% { transform: rotate(16deg); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 56px;
}

.hero-grid {
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.featured-intro {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.featured-name {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
}

.featured-meaning {
  margin: 6px 0 0;
  font-size: 15px;
  font-style: italic;
  color: var(--text-muted);
}

.featured-meaning strong {
  font-style: normal;
  color: var(--text);
}

.featured-desc {
  max-width: 480px;
  margin: 14px 0 0;
  color: var(--text-muted);
}

.featured-desc + .skill-list {
  margin-top: 22px;
}

.featured-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* iPhone-style frame around the live demo, colors sampled from a
   burgundy iPhone Pro. The display is laid out at real iPhone size
   (390x844 points) and scaled to 80% on normal-height screens. */
.phone {
  --frame: #5d383f;
  --frame-light: #8e656d;
  --frame-dark: #2b0b12;
  --frame-inner: #3e2228;
  --scale: 0.8;
  position: relative;
  padding: 5px;
  background: #050203;
  border-radius: 50px;
  box-shadow:
    0 0 0 1px var(--frame-inner),
    0 0 0 3px var(--frame-light),
    0 0 0 5px var(--frame),
    0 0 0 6px var(--frame-dark),
    var(--shadow-hover);
}

.phone-btn {
  position: absolute;
  width: 3px;
  background: linear-gradient(90deg, var(--frame-dark), var(--frame-light) 60%, var(--frame));
  border-radius: 2px;
}

.phone-btn-action,
.phone-btn-vol-up,
.phone-btn-vol-down {
  left: -9px;
}

.phone-btn-side {
  right: -9px;
  background: linear-gradient(270deg, var(--frame-dark), var(--frame-light) 60%, var(--frame));
}

.phone-btn-action   { top: calc(150px * var(--scale) / 0.8); height: calc(34px * var(--scale) / 0.8); }
.phone-btn-vol-up   { top: calc(208px * var(--scale) / 0.8); height: calc(44px * var(--scale) / 0.8); }
.phone-btn-vol-down { top: calc(270px * var(--scale) / 0.8); height: calc(44px * var(--scale) / 0.8); }
.phone-btn-side     { top: calc(225px * var(--scale) / 0.8); height: calc(70px * var(--scale) / 0.8); }

.phone-screen {
  width: calc(390px * var(--scale));
  height: calc(844px * var(--scale));
  overflow: hidden;
  background: #f4ecdb;
  border-radius: 45px;
}

.phone-display {
  display: flex;
  flex-direction: column;
  width: 390px;
  height: 844px;
  transform: scale(var(--scale));
  transform-origin: 0 0;
}

.phone-status {
  position: relative;
  flex-shrink: 0;
  height: 54px;
  background: #f4ecdb;
}

.phone-time {
  position: absolute;
  left: 44px;
  top: 17px;
  font-size: 17px;
  font-weight: 600;
  color: #111;
}

.phone-island {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 124px;
  height: 36px;
  background: #000;
  border-radius: 20px;
  transform: translateX(-50%);
}

.phone-viewport {
  position: relative;
  flex: 1;
}

.phone-viewport iframe {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.phone-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 17px;
  color: #57575f;
}

/* Tall screens: show the demo at true iPhone size */
@media (min-height: 1000px) {
  .phone {
    --scale: 1;
    border-radius: 58px;
  }

  .phone-screen {
    border-radius: 53px;
  }
}

@media (max-width: 899px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .avatar-figure {
    zoom: 0.72;
    margin-top: 40px;
  }

  .speech::after {
    left: 24px;
    bottom: auto;
    top: -9px;
    transform: rotate(135deg);
  }

  .phone {
    display: none;
  }
}

.more-work {
  margin: 28px 0 0;
  font-weight: 600;
}

/* ============ About ============ */
.about-text {
  max-width: 680px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.about-text p {
  margin: 0 0 1em;
}

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

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.skill-group h3 {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ============ Experience ============ */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.timeline-item:first-child {
  padding-top: 0;
  border-top: none;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text-muted);
}

.timeline-date {
  font-weight: 600;
  color: var(--text);
}

.timeline-body h3,
.education-list h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.timeline-org {
  margin: 4px 0 0;
  font-weight: 600;
  color: var(--accent);
}

.timeline-body ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.timeline-body li + li {
  margin-top: 8px;
}

.section-title-sub {
  margin-top: 72px;
}

.education-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.education-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.education-list li:first-child {
  padding-top: 0;
  border-top: none;
}

.education-date {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 600px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-meta {
    flex-direction: row;
    gap: 12px;
  }

  .education-list li {
    flex-direction: column;
    gap: 4px;
  }

  .education-date {
    order: -1;
  }
}

/* ============ Contact ============ */
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.contact-list a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-value {
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ============ Footer ============ */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

/* ============ Mobile ============ */
@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .site-nav {
    gap: 16px;
  }

  .site-nav a {
    font-size: 14px;
  }

  .hero {
    padding: 72px 0 64px;
  }

  .section {
    padding: 64px 0;
  }

  .project-card {
    padding: 22px;
  }
}

@media (max-width: 440px) {
  .header-inner {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  html {
    scroll-padding-top: 96px;
  }
}

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

  * {
    transition: none !important;
  }

  .wave-arm {
    animation: none;
  }
}
