/* ── Variables ─────────────────────────────────── */
:root {
  --bg:       #f7f2ea;
  --bg2:      #ede8df;
  --text:     #1a1510;
  --muted:    #8a7d6e;
  --dim:      #b8aa98;
  --border:   #dfd7c8;
  --green:    #4a8c3f;
  --accent:   #b85c38;
  --tag-bg:   #ede8df;
  --tag-text: #7a6d5e;
  --font:     'Inter', system-ui, sans-serif;
  --mono:     'JetBrains Mono', monospace;
  --max:      700px;
  --glow-a:   rgba(184,92,56,.07);
  --glow-b:   rgba(201,173,122,.11);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  background:
    radial-gradient(900px 520px at 12% -8%, var(--glow-a), transparent 60%),
    radial-gradient(1100px 620px at 100% 4%, var(--glow-b), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: rgba(212,133,90,.25); }

/* ── Container ─────────────────────────────────── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 28px 72px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
  z-index: 1;
}

/* ── Utilities ─────────────────────────────────── */
.mono  { font-family: var(--mono); }
.dim   { color: var(--dim); }
.accent { color: var(--accent); }

.divider {
  height: 1px;
  background: var(--border);
}

/* ── Section label ─────────────────────────────── */
.label {
  display: block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── NAV ───────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
.nav-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: .8rem;
  color: var(--muted);
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }
.nav-resume {
  color: var(--text) !important;
  border: 1px solid var(--border);
  padding: 5px 12px;
  font-size: .75rem !important;
  transition: border-color .15s, background .15s !important;
}
.nav-resume:hover { background: var(--bg2); border-color: var(--muted) !important; }

/* ── HERO ──────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-top: 24px;
}
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.tagline {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 380px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .75rem;
}
.dot-sep { color: var(--dim); }
.available {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 500;
}
.pulse {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  animation: ripple 2.2s ease-out infinite;
}
@keyframes ripple {
  0%   { box-shadow: 0 0 0 0 rgba(125,186,111,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(125,186,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(125,186,111,0); }
}
.inline-icon {
  display: inline;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 2px;
  position: relative;
  top: -1px;
}

/* ── Hero quick-contact row ─────────────────────── */
.hero-contact {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .72rem;
}
.hero-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  transition: color .15s;
}
.hero-contact a:hover { color: var(--accent); }
.hero-contact .hcl-icon { color: var(--dim); font-style: normal; }
.email-obf { cursor: pointer; }

.email-link {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  transition: color .15s;
  align-self: flex-start;
}
.email-link:hover { color: var(--accent); }

.photo-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  padding: 6px;
  background: #f0e6d0;
  border: 1px solid #c9ad7a;
  border-radius: 2px;
  box-shadow: 0 0 0 3px #f7f2ea, 0 0 0 4px #c9ad7a66;
  transition: box-shadow .35s ease, border-color .35s ease;
  cursor: pointer;
}
.photo-wrap:hover {
  border-color: #c9ad7a;
  box-shadow: 0 0 0 3px #f7f2ea, 0 0 0 5px #c9ad7a, 0 0 18px 4px rgba(201,173,122,.45);
}
.photo-wrap::after {
  content: 'Accio Daily Prophet →';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: .6rem;
  color: #8b6914;
  letter-spacing: .06em;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.photo-wrap:hover::after { opacity: 1; }
.hp-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #8b6914;
  border-style: solid;
  z-index: 2;
  pointer-events: none;
}
.hp-corner.tl { top: -4px; left: -4px; border-width: 2px 0 0 2px; }
.hp-corner.tr { top: -4px; right: -4px; border-width: 2px 2px 0 0; }
.hp-corner.bl { bottom: -4px; left: -4px; border-width: 0 0 2px 2px; }
.hp-corner.br { bottom: -4px; right: -4px; border-width: 0 2px 2px 0; }
.me-label {
  position: absolute;
  bottom: -30px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  animation: float 3s ease-in-out infinite;
}
.me-label svg {
  transform: scaleX(-1);
}
.me-label span {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  color: #2979ff;
  white-space: nowrap;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

.hero-photo {
  width: 110px;
  height: 130px;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  filter: sepia(20%) grayscale(5%);
  border-radius: 4px;
}

/* ── NOW section ───────────────────────────────── */
.now-section { display: flex; flex-direction: column; }
.now-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.now-item {
  display: flex;
  gap: 20px;
  align-items: baseline;
}
.now-key {
  font-size: .7rem;
  color: var(--dim);
  letter-spacing: .04em;
  min-width: 72px;
  flex-shrink: 0;
}
.now-val {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── PROJECTS ──────────────────────────────────── */
section { display: flex; flex-direction: column; }
.project-list { display: flex; flex-direction: column; }

.project-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  border-radius: 0;
  margin: 0 -10px;
  padding: 15px 10px;
}
.project-row:first-child { border-top: 1px solid var(--border); }
a.project-row:hover,
.project-row.linkable:hover {
  background: var(--bg2);
  border-radius: 6px;
  border-color: transparent;
}
a.project-row:hover + .project-row,
a.project-row:hover + .project-wip,
.project-row.linkable:hover + .project-row,
.project-row.linkable:hover + .project-wip { border-top-color: transparent; }
.project-wip { opacity: .5; cursor: default; }

/* Row with a stretched primary link + a separate secondary link (e.g. repo) */
.project-row.linkable { position: relative; cursor: pointer; }
.stretch-link { color: inherit; }
.stretch-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.project-row.linkable .project-right { position: relative; z-index: 2; }
.repo-link {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--muted);
  transition: color .15s;
}
.repo-link:hover { color: var(--accent); }

.project-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.project-name {
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.award-badge {
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 500;
  background: linear-gradient(135deg, #888, #c8c8c8, #888);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .04em;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.wip {
  font-style: normal;
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 400;
  color: var(--dim);
  letter-spacing: .06em;
}
.project-desc {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
}
.project-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.tags span {
  font-family: var(--mono);
  font-size: .62rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.year {
  font-size: .68rem;
  color: var(--dim);
  letter-spacing: .04em;
}

/* ── STACK ─────────────────────────────────────── */
.stack-rows { display: flex; flex-direction: column; gap: 14px; }
.stack-row {
  display: flex;
  gap: 20px;
  align-items: baseline;
}
.stack-key {
  font-size: .7rem;
  color: var(--dim);
  letter-spacing: .04em;
  min-width: 86px;
  flex-shrink: 0;
}
.stack-val {
  font-size: .86rem;
  color: var(--muted);
}

/* ── CONTACT ───────────────────────────────────── */
.contact-desc {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .85rem;
  color: var(--muted);
  transition: color .15s;
}
.contact-item:hover { color: var(--text); }
.contact-icon {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--dim);
  width: 20px;
  flex-shrink: 0;
}

/* ── FOOTER ────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .7rem;
  padding-top: 4px;
}

/* ── Animations ────────────────────────────────── */
@keyframes up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
main > * {
  animation: up .5s cubic-bezier(.16,1,.3,1) both;
}
main > *:nth-child(1)  { animation-delay: .04s; }
main > *:nth-child(2)  { animation-delay: .09s; }
main > *:nth-child(3)  { animation-delay: .13s; }
main > *:nth-child(4)  { animation-delay: .17s; }
main > *:nth-child(5)  { animation-delay: .21s; }
main > *:nth-child(6)  { animation-delay: .25s; }
main > *:nth-child(7)  { animation-delay: .29s; }
main > *:nth-child(8)  { animation-delay: .33s; }
main > *:nth-child(9)  { animation-delay: .37s; }
main > *:nth-child(10) { animation-delay: .41s; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 520px) {
  main { padding: 28px 18px 56px; }
  .hero { flex-direction: column-reverse; gap: 24px; }
  .hero-photo { width: 72px; height: 85px; }
  h1 { font-size: 2rem; }
  .project-row { flex-direction: column; gap: 10px; }
  .project-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .now-item { flex-direction: column; gap: 2px; }
  .stack-row { flex-direction: column; gap: 2px; }
}

/* ── Lumos / Nox toggle ────────────────────────── */
.lumos-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--dim);
  padding: 0 2px;
  line-height: 1;
  transition: color .2s, transform .3s;
  display: flex;
  align-items: center;
}
.lumos-btn:hover { color: #c9ad7a; transform: rotate(20deg); }

body.nox {
  --bg:       #12100c;
  --bg2:      #1c1912;
  --text:     #e8dcc8;
  --muted:    #9a8d78;
  --dim:      #5a5040;
  --border:   #2e2820;
  --tag-bg:   #1c1912;
  --tag-text: #7a6d5e;
  --glow-a:   rgba(201,173,122,.06);
  --glow-b:   rgba(96,74,168,.09);
}
body.nox .photo-wrap {
  background: #2a2318;
  border-color: #6b5a30;
  box-shadow: 0 0 0 3px #12100c, 0 0 0 4px #6b5a3066;
}
body.nox .photo-wrap:hover {
  box-shadow: 0 0 0 3px #12100c, 0 0 0 5px #c9ad7a, 0 0 22px 6px rgba(201,173,122,.3);
}
body.nox .hp-corner { border-color: #6b5a30; }
body.nox .lumos-btn { color: #c9ad7a; }

/* ── Accessibility ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
}
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
