/* the warm portfolio color palette*/
:root {
  --bg: #faf6f0;
  --surface: #f3ebe0;
  --inner: #faf6f0;
  --text: #3b2a20;
  --muted: #7d6858;
  --line: #e4d8c8;
  --accent: #9a5b34;
  --accent-hover: #7a4423;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #211812;
  --surface: #2b2019;
  --inner: #211812;
  --text: #f0e4d6;
  --muted: #b09a86;
  --line: #3d2f25;
  --accent: #d9a273;
  --accent-hover: #f0c298;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  transition: background-color .3s ease, color .3s ease;
}
main { max-width: 920px; margin: 0 auto; padding: 5rem 1.5rem 8rem; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.25; margin: 0; }

/* Theme toggle */
#theme-toggle {
  position: fixed; top: 1rem; right: 1rem; z-index: 30;
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* hero: portrait left, introduction right */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}
.circle-photo {
  width: 310px; height: 310px; border-radius: 50%; object-fit: cover; display: block;
  border: 6px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.hero .greeting { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.2rem; margin: 0 0 .4rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 3.8rem); color: var(--accent); letter-spacing: -.015em; }
.lead { margin-bottom: 1rem; }
.lead-intro {margin-top: 0; margin-bottom: 0.35rem;}
.lead-list {margin-top: 0;}

.hero .lead { font-size: 1.2rem; margin: 1.1rem 0 1.75rem; max-width: 28rem; }
.links { display: flex; gap: .75rem; flex-wrap: wrap; }
.links a {
  width: 46px; height: 46px; display: grid; place-items: center;
  color: var(--text); border: 1px solid var(--line); background: var(--surface);
  border-radius: 50%;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.links a:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); text-decoration: none; transform: translateY(-2px); }

/* sections */
section { margin-top: 5rem; }
section { scroll-margin-top: 5rem; }
.hero + .jump + section { margin-top: 4rem; }
.section-title {
  font-size: 1.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  line-height: 1.15;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.typed-text {
  white-space: nowrap;
}

.typed-cursor {
  display: inline-block;
  margin-left: 0.06em;
  color: var(--accent);
  font-weight: 400;
  animation: cozy-blink 1.05s steps(1, end) infinite;
}

.typed-cursor.is-typing {
  animation: none;
  opacity: 0.9;
}

.typed-cursor.is-done {
  animation: cozy-blink 1.4s ease-in-out infinite;
  opacity: 0.45;
}

@keyframes cozy-blink {
  0%, 49% { opacity: 0.85; }
  50%, 100% { opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  .typed-cursor {
    animation: none;
    opacity: 0.6;
  }
}

/* One card system for every section */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.75rem; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }

/* projects */
.project { display: flex; flex-direction: column; }
.project-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag { font-family: var(--serif); font-style: italic; font-size: .95rem; color: var(--accent); }
.tech { display: flex; gap: .35rem; flex-wrap: wrap; }
.tech span { font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .65rem; }
.project-img { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: var(--inner); margin-bottom: 1.1rem; }
.project-img img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
.project h3 { font-size: 1.2rem; margin-bottom: .6rem; }
.project h3 .sub { font-family: var(--sans); font-size: .95rem; font-weight: 400; color: var(--muted); margin-left: .25rem; }
.project p { font-size: .95rem; color: var(--muted); margin: 0 0 1.25rem; flex: 1; }
.project p strong { color: var(--text); font-weight: 600; }
.project-links { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: auto; }
.project .repo, .project .live { font-size: .95rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; transition: opacity .2s ease, transform .2s ease; }
.project .live { color: var(--accent); }
.project .repo:hover, .project .live:hover { opacity: .8; }
.project .live svg { transition: transform .2s ease; }
.project .live:hover svg { transform: translate(2px, -2px); }

/* carousal */
.projects-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.carousel-controls { display: flex; align-items: center; gap: .65rem; }
.carousel-btn { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--inner); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .2s ease, border-color .2s ease, background-color .2s ease; }
.carousel-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.carousel-dots { display: flex; align-items: center; gap: .4rem; }
.carousel-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: width .25s ease, background-color .25s ease; }
.carousel-dot[aria-selected="true"] { width: 22px; background: var(--accent); }
.carousel-viewport { position: relative; min-height: 540px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 1.25rem 0 1.75rem; touch-action: pan-y; outline: none; }
.carousel-track { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.carousel-slide { position: absolute; width: min(560px, 86vw); opacity: 0; pointer-events: none; transform: translate3d(0, 0, 0) scale(.76); transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .45s ease; z-index: 0; user-select: none; }
.carousel-slide.is-active { position: relative; opacity: 1; pointer-events: auto; transform: translate3d(0, 0, 0) scale(1); z-index: 3; user-select: auto; }
.carousel-slide.is-prev { opacity: .28; pointer-events: auto; cursor: pointer; transform: translate3d(-24%, 6px, 0) scale(.82); z-index: 1; }
.carousel-slide.is-next { opacity: .28; pointer-events: auto; cursor: pointer; transform: translate3d(24%, 6px, 0) scale(.82); z-index: 1; }
.carousel-slide.is-active a { pointer-events: auto; position: relative; z-index: 4; }
.carousel-slide:not(.is-active) a { pointer-events: none; }
@media (max-width: 640px) { .carousel-viewport { min-height: 500px; } .carousel-slide.is-prev { transform: translate3d(-14%, 8px, 0) scale(.86); opacity: .22; } .carousel-slide.is-next { transform: translate3d(14%, 8px, 0) scale(.86); opacity: .22; } }
@media (prefers-reduced-motion: reduce) { .carousel-slide, .carousel-btn, .carousel-dot { transition: none !important; } }

/* experience & education - logo left + content column */
.entry { display: flex; flex-direction: column; gap: .75rem; }
.card.entry { padding: 1.15rem 1.5rem; }
.entry-top { display: flex; align-items: center; gap: 1.15rem; }
.entry-logo-wrap { width: 3rem; height: 3rem; flex: 0 0 3rem; min-width: 0; min-height: 0; border-radius: 12px; background: var(--inner); border: 1px solid var(--line); padding: 0; display: grid; place-items: center; overflow: hidden; }
.entry-logo-wrap.is-light { background: #f5f2ec; border-color: var(--line); padding: 5px; }
.entry-logo { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; display: block; }
.entry-logo-wrap.is-light .entry-logo { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.entry-logo-wrap.is-light .entry-logo.is-wide { transform: scale(1.15); }
.entry-logo-wrap.is-light .entry-logo.is-seal { transform: scale(1.18); filter: contrast(1.14); }
.entry-logo-wrap.is-light .entry-logo.is-wolf { transform: scale(1.08); }
.entry-head { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.entry-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; gap: .15rem; font-family: var(--serif); font-style: italic; font-size: .92rem; color: var(--muted); }
.entry-side .date { color: var(--accent); }
.entry h3 { font-size: 1.25rem; }
.entry h4 { font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--muted); margin-top: .15rem; }
.entry ul { margin: 0; padding-left: 1.2rem; font-size: .95rem; color: var(--muted); }
.entry li { margin-bottom: .75rem; line-height: 1.55; }
.entry li:last-child { margin-bottom: 0; }
.entry li::marker { color: var(--accent); }
.entry .details { font-size: .95rem; color: var(--muted); margin: 0; line-height: 1.65; }
.entry .details strong { color: var(--text); font-weight: 600; }

/* awards */
.award { display: flex; flex-direction: column; }
.award img, .award .video-wrap { order: -1; margin-bottom: 1.1rem; }
.award h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.award p, .award li { font-size: .92rem; color: var(--muted); }
.award p { margin: 0; }
.award ul { list-style: none; padding: 0; margin: 0; }
.award li { padding-left: 1.1rem; position: relative; margin-bottom: .4rem; }
.award li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }
.award img { 
    width: 100%; 
    aspect-ratio: 16 / 10; 
    object-fit: cover; 
    object-position: center center; 
    border-radius: 10px; 
    display: block; 
}

.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--inner); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.hero {
  align-items: flex-start;
  margin-bottom: 2.5rem; 
}

.hero-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: -0.25rem;
}

@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
} 

/* mobile rules */
@media (max-width: 760px) {
  main { padding-top: 4rem; }
  .hero { grid-template-columns: 1fr; text-align: center; gap: 2rem; justify-items: center; }
  .hero-media { order: -1; }
  .lead-list { text-align: left; display: inline-block; }
  .circle-photo { width: 220px; height: 220px; }
  .links { justify-content: center; }
}

/* floating dock appears aft hero, frosted glass, bottom-center */
.jump {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 20;
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 2rem);
  display: flex; gap: .2rem; overflow-x: auto; padding: .3rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 24px rgba(59, 42, 32, .12);
  transition: transform .35s ease, opacity .35s ease;
}
.jump.visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.jump a { color: var(--muted); font-size: .9rem; font-weight: 500; padding: .4rem 1rem; border-radius: 999px; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.jump a:hover { color: var(--text); text-decoration: none; }
.jump a.active { background: var(--surface); color: var(--accent); }
@media (max-width: 760px) { #theme-toggle { top: .6rem; right: .6rem; } .jump a { padding: .4rem .8rem; font-size: .85rem; } }