:root{
  --black:#000;
  --white:#fff;
  --gray:#555;
  --gray-light:#888;
  --line:#000;          /* strong section divider (dotted) */
  --divider:#b8b8b8;    /* soft item divider (dotted) */
  --maxw:860px;
  --nav-h:56px;
}

/* ============ BASE ============ */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--white);
  color:var(--black);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  font-size:15.5px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{line-height:1.2;letter-spacing:-.02em;margin:0;font-weight:700}
p{margin:0}
a{color:inherit;text-decoration:none;border-bottom:1px solid transparent}
a:hover{border-bottom-color:currentColor}
ul{margin:0;padding:0;list-style:none}
img{max-width:100%;display:block}
.wrap{width:100%;max-width:var(--maxw);margin:0 auto;padding:0 24px}
section[id]{scroll-margin-top:calc(var(--nav-h) + 20px)}

/* ============ TECH LOGO BACKGROUND ============ */
/* Decorative fixed layer of tech logos behind the content.
   Kept very light + masked in the center so the reading column stays clean. */
.tech-bg{
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  user-select:none;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(clamp(90px,13vw,150px),1fr));
  grid-auto-rows:1fr;
  place-items:center;
  gap:clamp(20px,3.5vw,52px);
  padding:clamp(24px,4vw,60px);
  opacity:.12;
  filter:grayscale(1);
  -webkit-mask-image:radial-gradient(ellipse 65% 65% at 50% 45%,transparent 0%,transparent 42%,#000 100%);
  mask-image:radial-gradient(ellipse 65% 65% at 50% 45%,transparent 0%,transparent 42%,#000 100%);
}
.tech-bg img{
  width:100%;
  max-width:clamp(34px,4.6vw,54px);
  height:auto;
}
@media (max-width:640px){
  .tech-bg{
    grid-template-columns:repeat(4,1fr);
    gap:18px;
    padding:18px;
    opacity:.09;
  }
}
@media print{
  .tech-bg{display:none}
}

/* ============ NAV ============ */
.nav{
  position:sticky;top:0;z-index:50;
  background:var(--white);
  border-bottom:1px solid var(--line);
}
.nav-inner{display:flex;align-items:center;justify-content:space-between;height:var(--nav-h);position:relative}
.brand{font-weight:700;font-size:.95rem;letter-spacing:-.01em;border-bottom:0}
.nav-links{display:flex;gap:0;align-items:center}
.nav-links a{font-size:.82rem;padding:8px 12px;border-bottom:0}
.nav-links a:hover{text-decoration:underline;text-underline-offset:4px}
.nav-links a.active{font-weight:600;text-decoration:underline;text-underline-offset:4px}
.nav-toggle{display:none;background:none;border:0;padding:8px;cursor:pointer;flex-direction:column;gap:5px}
.nav-toggle span{display:block;width:22px;height:1.5px;background:var(--black);transition:.2s}
.nav.open .nav-toggle span:nth-child(1){transform:translateY(6.5px) rotate(45deg)}
.nav.open .nav-toggle span:nth-child(2){opacity:0}
.nav.open .nav-toggle span:nth-child(3){transform:translateY(-6.5px) rotate(-45deg)}

@media (max-width:720px){
  .nav-toggle{display:flex}
  .nav-links{
    display:none;position:absolute;top:100%;left:0;right:0;
    flex-direction:column;align-items:stretch;gap:0;
    background:var(--white);border-bottom:1px solid var(--line);
    padding:4px 0 8px;
  }
  .nav.open .nav-links{display:flex}
  .nav-links a{padding:11px 24px;font-size:.9rem;border-bottom:0}
}

/* ============ HERO ============ */
.hero{padding:64px 0 40px;border-bottom:1px dotted var(--line)}
.badge{
  display:inline-block;
  font-size:.74rem;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;
  padding:5px 12px;
  border:1px solid var(--black);
  margin-bottom:18px;
}
.hero h1{font-size:clamp(1.9rem,4.5vw,2.6rem);font-weight:700;letter-spacing:-.03em}
.hero .role{margin-top:6px;font-size:1rem;color:var(--gray)}
.hero .meta{margin-top:18px;font-size:.87rem;color:var(--gray);line-height:1.9}
.hero .meta span{display:inline-block;margin-right:14px}
.hero .meta span + span::before{content:"·";margin-right:14px;color:var(--gray-light)}
.lede{max-width:620px;margin-top:22px;font-size:.98rem;line-height:1.7;text-align: justify;}
.cta{display:flex;flex-wrap:wrap;gap:10px;margin-top:26px}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 18px;font-size:.87rem;font-weight:600;
  border:1px solid var(--black);
  background:var(--white);color:var(--black);
  transition:background .15s, color .15s;
}
.btn:hover{background:var(--black);color:var(--white)}
.btn-primary{background:var(--black);color:var(--white)}
.btn-primary:hover{background:var(--white);color:var(--black)}

/* stats as bordered row */
.stats{
  display:grid;grid-template-columns:repeat(4,1fr);
  margin-top:44px;
  border-top:1px dotted var(--line);
  border-bottom:1px dotted var(--divider);
}
.stat{padding:16px 14px 16px 0;border-right:1px dotted var(--divider)}
.stat:last-child{border-right:0;padding-right:0}
.stat + .stat{padding-left:14px}
.stat b{display:block;font-size:1.35rem;font-weight:700;letter-spacing:-.02em}
.stat span{display:block;font-size:.74rem;color:var(--gray);margin-top:2px;line-height:1.35}
@media (max-width:640px){
  .stats{grid-template-columns:repeat(2,1fr)}
  .stat:nth-child(2){border-right:0}
  .stat:nth-child(3){border-top:1px dotted var(--divider);padding-left:0}
  .stat:nth-child(4){border-top:1px dotted var(--divider)}
}

/* ============ SECTIONS ============ */
.section{padding:52px 0;border-bottom:1px dotted var(--line)}
.section:last-of-type{border-bottom:0}
.section-head{margin-bottom:28px}
.section-head h2{
  font-size:1.15rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;
}
.section-head p{margin-top:8px;font-size:.9rem;color:var(--gray);max-width:640px}

/* ============ PROFILE ============ */
.about-grid{display:grid;grid-template-columns:1.6fr 1fr;gap:36px;align-items:start}
.prose p{font-size:.95rem;line-height:1.75;text-align: justify;}
.prose p + p{margin-top:14px}
.facts h3{
  font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;
  margin-bottom:10px;padding-bottom:8px;
  border-bottom:1px dotted var(--divider);
}
.facts li{
  display:flex;justify-content:space-between;gap:14px;
  padding:7px 0;font-size:.86rem;
  border-bottom:1px dotted var(--divider);
}
.facts li:last-child{border-bottom:0}
.facts li span{color:var(--gray)}
.facts li b{font-weight:600;text-align:right}
@media (max-width:760px){ .about-grid{grid-template-columns:1fr} }

/* ============ SKILLS ============ */
.skills{
  border-top:1px dotted var(--line);
  border-bottom:1px dotted var(--divider);
}
.skill-row{
  display:grid;grid-template-columns:190px 1fr;gap:24px;
  padding:14px 0;
}
.skill-row + .skill-row{border-top:1px dotted var(--divider)}
.skill-row h3{font-size:.83rem;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
.skill-row p{font-size:.92rem;line-height:1.65}
@media (max-width:600px){
  .skill-row{grid-template-columns:1fr;gap:4px;padding:12px 0}
}

/* ============ TIMELINE (shared: experience + education) ============ */
.timeline{
  border-top:1px dotted var(--line);
  border-bottom:1px dotted var(--divider);
}
.job{padding:22px 0}
.job + .job{border-top:1px dotted var(--divider)}
.job-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 14px;margin-bottom:10px}
.job-head.has-logo{align-items:center}
.job h3{font-size:1rem;font-weight:700}
.job .co{font-size:.9rem;color:var(--gray);font-weight:500}
.job .when{
  margin-left:auto;font-size:.78rem;color:var(--gray);
  white-space:nowrap;
}
.job ul{display:grid;gap:6px;margin-bottom:12px}
.job li{
  position:relative;padding-left:16px;
  font-size:.9rem;line-height:1.6;
}
.job li::before{
  content:"—";
  position:absolute;left:0;top:0;
  color:var(--gray-light);
}
.job li b{font-weight:600}
.award{
  display:inline-block;margin-bottom:12px;
  font-size:.8rem;font-weight:600;
  padding:4px 10px;
  border:1px solid var(--black);
}
.tech{font-size:.78rem;color:var(--gray);line-height:1.7}
.tech span{display:inline}
.tech span:not(:last-child)::after{content:" · ";color:var(--gray-light)}
@media (max-width:600px){
  .job .when{margin-left:0;flex-basis:100%;order:3;margin-top:2px}
}

/* Education timeline */
.edu-timeline .job-head{margin-bottom:0}

/* Optional school logo — hidden if file not found (onerror removes it) */
.school-logo{
  height:28px;width:auto;flex:none;
  border:1px solid var(--divider);
  padding:2px;
  background:var(--white);
}

/* ============ PROJECTS ============ */
.projects{
  border-top:1px dotted var(--line);
  border-bottom:1px dotted var(--divider);
}
.project{padding:24px 0}
.project + .project{border-top:1px dotted var(--divider)}
.project-head{
  display:flex;justify-content:space-between;align-items:baseline;gap:14px;
  margin-bottom:8px;
}
.project h3{font-size:1rem;font-weight:700}
.project-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;
  margin-bottom:10px;
  font-size:.78rem;color:var(--gray);
}
.project-period{white-space:nowrap}
.project-type{
  font-size:.68rem;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;
  padding:2px 8px;
  border:1px solid var(--black);
  color:var(--black);
  white-space:nowrap;
}
.project-desc{font-size:.9rem;line-height:1.65;color:var(--gray);margin-bottom:10px}
.project .tech{margin-bottom:0}

/* ============ ACCORDION (native details / summary) ============ */
summary{list-style:none}
summary::-webkit-details-marker{display:none}
summary::marker{content:""}
.acc > summary{cursor:pointer}
.acc > summary:focus-visible{outline:2px solid var(--black);outline-offset:4px}

/* + / − indicator */
.acc-icon{
  flex:none;
  position:relative;
  width:22px;height:22px;
  border:1px solid var(--divider);
  background:var(--white);
  transition:border-color .15s;
}
.acc-icon::before,
.acc-icon::after{
  content:"";
  position:absolute;
  left:50%;top:50%;
  background:var(--black);
  transform:translate(-50%,-50%);
}
.acc-icon::before{width:9px;height:1.5px}
.acc-icon::after{width:1.5px;height:9px;transition:transform .2s ease,opacity .2s ease}
details[open] > summary .acc-icon::after{transform:translate(-50%,-50%) rotate(90deg);opacity:0}
summary:hover .acc-icon{border-color:var(--black)}

/* experience — compact header when collapsed */
.acc > .job-head{margin-bottom:0}
.acc[open] > .job-head{margin-bottom:10px}
@media (max-width:600px){
  .acc-icon{margin-left:auto}
}

/* projects */
.acc-project{margin-top:14px;border-top:1px dotted var(--divider)}
.project-toggle{
  display:flex;align-items:center;gap:10px;
  padding:9px 0;
  font-size:.72rem;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;
  color:var(--gray);
  transition:color .15s;
}
.project-toggle:hover{color:var(--black)}
.acc-project[open] > .project-toggle{margin-bottom:2px}

/* task list — what was done on the project */
.project-tasks{display:grid;gap:6px;margin-bottom:12px;max-width:72ch}
.project-tasks li{
  position:relative;padding-left:16px;
  font-size:.9rem;line-height:1.6;
}
.project-tasks li::before{
  content:"—";
  position:absolute;left:0;top:0;
  color:var(--gray-light);
}
.project-tasks li b{font-weight:600}
.stores{font-size:.78rem;color:var(--black);font-weight:600;letter-spacing:.02em;white-space:nowrap}
.stores span{display:inline}
.stores span:not(:last-child)::after{content:" · ";color:var(--gray-light)}

/* image gallery — horizontal scroll, single row */
.project-gallery{
  display:flex;
  flex-wrap:nowrap;
  align-items:flex-start;
  gap:10px;
  margin-top:16px;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior-x:contain;
  padding-bottom:10px;
  scroll-snap-type:x proximity;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:var(--divider) transparent;
}
.project-gallery:focus-visible{outline:2px solid var(--black);outline-offset:4px}
.project-gallery::-webkit-scrollbar{height:6px}
.project-gallery::-webkit-scrollbar-thumb{
  background:var(--divider);
  border-radius:3px;
}
.project-gallery::-webkit-scrollbar-thumb:hover{background:var(--gray-light)}
.project-gallery::-webkit-scrollbar-track{background:transparent}
.project-gallery img{
  flex:0 0 auto;
  width:auto;
  max-width:none;
  height:200px;
  object-fit:contain;
  border:1px solid var(--divider);
  background:#f2f2f2;
  scroll-snap-align:start;
}
@media (max-width:720px){
  .project-gallery img{height:170px}
}
@media (max-width:520px){
  .project-head{flex-direction:column;align-items:flex-start;gap:2px}
  .project-gallery{gap:8px}
  .project-gallery img{height:150px}
}

/* ============ CONTACT ============ */
.contact{padding:56px 0;border-top:1px dotted var(--line);text-align:center}
.contact h2{font-size:1.35rem;font-weight:700;letter-spacing:-.02em}
.contact p{max-width:480px;margin:12px auto 0;font-size:.92rem;color:var(--gray)}
.contact-mail{
  display:inline-block;margin-top:22px;
  font-size:1.1rem;font-weight:600;
  border-bottom:1px solid var(--black);
  padding-bottom:2px;
}
.contact-links{
  display:flex;flex-wrap:wrap;justify-content:center;gap:0;
  margin-top:26px;
}
.contact-links a{font-size:.85rem;font-weight:600;padding:0 16px;border-bottom:0}
.contact-links a:not(:last-child){border-right:1px dotted var(--divider)}
.contact-links a:hover{text-decoration:underline;text-underline-offset:4px}

/* contact form */
.contact-form{
  max-width:520px;margin:32px auto 0;
  display:grid;gap:14px;
  text-align:left;
}
.field{display:grid;gap:6px}
.field label{
  font-size:.72rem;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;
  color:var(--gray);
}
.field input,.field select,.field textarea{
  width:100%;padding:10px 12px;
  font:inherit;font-size:.9rem;
  color:var(--black);
  background:var(--white);
  border:1px solid var(--divider);
  border-radius:0;
  transition:border-color .15s;
}
.field textarea{min-height:120px;resize:vertical;line-height:1.6}
.field input::placeholder,.field textarea::placeholder{color:var(--gray-light)}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none;
  border-color:var(--black);
  box-shadow:0 0 0 1px var(--black);
}
.field select{appearance:none;-webkit-appearance:none;cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,var(--black) 50%),linear-gradient(135deg,var(--black) 50%,transparent 50%);
  background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
  padding-right:34px;
}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.form-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.form-actions .btn{cursor:pointer;font:inherit;font-size:.87rem;font-weight:600}
.form-actions .btn[disabled]{opacity:.55;cursor:progress}
.contact .form-status{
  max-width:260px;margin:0;font-size:.82rem;line-height:1.4;color:var(--gray);
}
.contact .form-status[data-state="ok"]{color:var(--black);font-weight:600}
.contact .form-status[data-state="err"]{color:#a11414;font-weight:600}

/* ============ FOOTER ============ */
footer{
  border-top:1px dotted var(--line);
  padding:18px 0;
  font-size:.78rem;color:var(--gray);
}
.footer-inner{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}

/* ============ TO TOP ============ */
.to-top{
  position:fixed;right:20px;bottom:20px;z-index:40;
  width:40px;height:40px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--black);color:var(--white);border:0;cursor:pointer;
  opacity:0;pointer-events:none;transform:translateY(8px);
  transition:.22s;
}
.to-top.show{opacity:1;pointer-events:auto;transform:translateY(0)}

/* ============ REVEAL ============ */
.reveal{opacity:0;transform:translateY(10px);transition:opacity .5s ease, transform .5s ease}
.reveal.in{opacity:1;transform:none}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .reveal{opacity:1;transform:none;transition:none}
}

/* ============ PRINT ============ */
@media print{
  .nav,.to-top,.cta,.contact-links,.badge{display:none!important}
  body{font-size:10.5pt;line-height:1.45}
  .hero{padding:0 0 12px}
  .hero h1{font-size:20pt}
  .stats{margin-top:20px}
  .section{padding:16px 0;page-break-inside:avoid}
  .job{padding:14px 0;page-break-inside:avoid}
  .reveal{opacity:1;transform:none}
  a{color:#000;border:0}
  .contact{padding:20px 0}
  .btn, .to-top{display:none}
  .project-gallery{flex-wrap:wrap;overflow:visible;padding-bottom:0}
  .project-gallery img{height:60px}
}