:root{
  --bg:#f7f4ee;
  --surface:#fffdf8;
  --surface-strong:#ffffff;
  --ink:#1f2933;
  --muted:#667085;
  --line:#ded7cb;
  --accent:#176b63;
  --accent-strong:#0f4c45;
  --accent-soft:#dcefeb;
  --warm:#b77844;
  --shadow:0 24px 70px rgba(31,41,51,0.08);
  --radius:8px;
  --max:1180px;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:"Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(255,253,248,0.9), rgba(247,244,238,0.95)),
    var(--bg);
  color:var(--ink);
  line-height:1.6;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background-image:
    linear-gradient(rgba(31,41,51,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,41,51,0.045) 1px, transparent 1px);
  background-size:44px 44px;
  -webkit-mask-image:linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 72%);
  mask-image:linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 72%);
}

img{
  max-width:100%;
  display:block;
}

a{
  color:inherit;
  text-decoration:none;
}

button,
input,
textarea{
  font:inherit;
}

button{
  cursor:pointer;
}

ul{
  list-style:none;
  padding:0;
  margin:0;
}

[hidden]{
  display:none !important;
}

:focus-visible{
  outline:3px solid rgba(23,107,99,0.28);
  outline-offset:3px;
}

.skip-link{
  position:absolute;
  left:16px;
  top:-60px;
  z-index:100;
  background:var(--ink);
  color:#fff;
  padding:10px 14px;
  border-radius:var(--radius);
  font-weight:700;
}

.skip-link:focus{
  top:16px;
}

.container{
  width:min(calc(100% - 40px), var(--max));
  margin-inline:auto;
}

.header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(247,244,238,0.86);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(222,215,203,0.82);
}

.nav{
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.logo{
  display:inline-flex;
  align-items:center;
  gap:12px;
  font-weight:800;
  letter-spacing:0;
}

.logo-img{
  width:38px;
  height:38px;
  object-fit:contain;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  padding:4px;
}

.nav-links{
  display:flex;
  align-items:center;
  gap:4px;
}

.nav-links a{
  display:block;
  padding:9px 12px;
  border-radius:var(--radius);
  color:var(--muted);
  font-size:14px;
  font-weight:700;
}

.nav-links a:hover,
.nav-links a.active{
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.nav-toggle{
  display:none;
  width:42px;
  height:42px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
}

.nav-toggle span{
  width:18px;
  height:2px;
  background:var(--ink);
}

.hero{
  min-height:calc(78vh - 76px);
  display:grid;
  grid-template-columns:1fr 420px;
  align-items:center;
  gap:28px;
  padding:clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
}

.hero-copy{
  max-width:760px;
  min-width:0;
}

.hero-visual{
  width:100%;
  height:360px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(23,107,99,0.06), rgba(247,244,238,0.4));
  border:1px solid rgba(31,41,51,0.04);
}

.hero-visual canvas{
  width:100%;
  height:100%;
  display:block;
}

.eyebrow{
  margin:0 0 14px;
  color:var(--accent);
  font-size:12px;
  font-weight:800;
  letter-spacing:0.14em;
  text-transform:uppercase;
}

h1,
h2,
h3,
p{
  margin-top:0;
}

h1{
  max-width:900px;
  margin-bottom:24px;
  font-size:clamp(42px, 6.4vw, 74px);
  line-height:1.02;
  letter-spacing:0;
  font-weight:800;
  overflow-wrap:break-word;
}

h2{
  margin-bottom:16px;
  font-size:clamp(30px, 4.4vw, 48px);
  line-height:1.08;
  letter-spacing:0;
  font-weight:800;
}

h3{
  margin-bottom:10px;
  font-size:20px;
  line-height:1.25;
}

.hero-subtitle,
.section-head p,
.muted{
  color:var(--muted);
}

.hero-subtitle{
  max-width:650px;
  margin-bottom:30px;
  font-size:clamp(17px, 2vw, 20px);
  overflow-wrap:break-word;
}

.hero-actions,
.hero-links,
.project-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
}

.hero-links{
  margin-top:22px;
}

.hero-links a,
.contact-links a,
.footer a{
  color:var(--accent-strong);
  font-weight:800;
  border-bottom:1px solid rgba(15,76,69,0.25);
}

.hero-links a:hover,
.contact-links a:hover,
.footer a:hover{
  border-bottom-color:currentColor;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:12px 18px;
  border:1px solid var(--accent-strong);
  border-radius:var(--radius);
  background:var(--accent-strong);
  color:#fff;
  font-weight:800;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 34px rgba(15,76,69,0.18);
}

.btn-secondary{
  background:transparent;
  color:var(--accent-strong);
}

.btn-secondary:hover{
  background:var(--accent-soft);
}

.section{
  padding:clamp(72px, 10vw, 120px) 0;
  scroll-margin-top:96px;
}

.section + .section{
  border-top:1px solid rgba(222,215,203,0.72);
}

.section-head{
  max-width:760px;
  margin-bottom:clamp(34px, 5vw, 56px);
}

.section-head.split{
  max-width:none;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(280px, 420px);
  gap:32px;
  align-items:end;
}

.section-head > *,
.contact-layout > *,
.project > *{
  min-width:0;
}

.about-grid,
.project-grid,
.skills-grid{
  display:grid;
  gap:18px;
}

.about-grid{
  grid-template-columns:repeat(3, 1fr);
}

.card,
.skill-group,
.timeline-item{
  background:rgba(255,253,248,0.76);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px;
}

.card{
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover{
  transform:translateY(-3px);
  border-color:rgba(23,107,99,0.28);
  box-shadow:0 18px 46px rgba(31,41,51,0.08);
}

.card-kicker{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  margin-bottom:28px;
  padding:4px 9px;
  border:1px solid rgba(183,120,68,0.28);
  border-radius:var(--radius);
  background:#fbf5ed;
  color:var(--warm);
  font-family:"SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size:13px;
  font-weight:800;
}

.about-card{
  cursor:default;
}

.about-card.is-active{
  border-color:rgba(23,107,99,0.44);
  background:linear-gradient(180deg, rgba(220,239,235,0.52), rgba(255,253,248,0.86));
  box-shadow:0 18px 46px rgba(31,41,51,0.08);
  transform:translateY(-3px);
}

.about-card.is-active .card-kicker{
  border-color:rgba(23,107,99,0.32);
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.about-console{
  display:flex;
  align-items:center;
  gap:10px;
  width:max-content;
  max-width:100%;
  margin-top:18px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,253,248,0.78);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.about-console span{
  color:var(--warm);
}

.about-console code{
  color:var(--accent-strong);
  font-family:"SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size:13px;
  white-space:normal;
}

.project-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.filters{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.filter-btn{
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  color:var(--muted);
  padding:8px 13px;
  font-size:14px;
  font-weight:800;
}

.filter-btn:hover,
.filter-btn.active{
  border-color:var(--accent);
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.project-count{
  margin:0;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.project-insight{
  display:flex;
  align-items:center;
  gap:10px;
  width:max-content;
  max-width:100%;
  margin-bottom:22px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,253,248,0.78);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.project-insight span{
  color:var(--warm);
}

.project-insight code{
  color:var(--accent-strong);
  font-family:"SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size:13px;
  white-space:normal;
}

.project-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  align-items:stretch;
  gap:18px;
}

.project{
  min-height:380px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:20px;
  overflow:hidden;
  isolation:isolate;
  position:relative;
}

.project::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(135deg, rgba(220,239,235,0.7), rgba(255,253,248,0));
  opacity:0;
  transition:opacity .2s ease;
}

.project.is-active,
.project:focus-within{
  border-color:rgba(23,107,99,0.42);
  box-shadow:0 20px 54px rgba(31,41,51,0.1);
  transform:translateY(-4px);
}

.project.is-active::before,
.project:focus-within::before{
  opacity:1;
}

.project-labels{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:18px;
}

.project-code{
  color:var(--muted);
  font-family:"SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.project h3{
  font-size:clamp(21px, 2.2vw, 27px);
  margin-bottom:12px;
}

.project-desc{
  color:var(--muted);
  margin-bottom:0;
}

.project-points{
  display:grid;
  gap:9px;
  margin:0;
}

.project-points li{
  position:relative;
  padding-left:18px;
  color:var(--muted);
  font-size:14px;
  font-weight:650;
}

.project-points li::before{
  content:"";
  position:absolute;
  left:0;
  top:0.72em;
  width:6px;
  height:6px;
  border-radius:999px;
  background:var(--warm);
}

.pill{
  display:inline-flex;
  width:max-content;
  margin:0;
  padding:6px 10px;
  border:1px solid rgba(23,107,99,0.22);
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent-strong);
  font-size:12px;
  font-weight:800;
}

.muted-pill{
  background:#f2eee7;
  color:var(--muted);
  border-color:var(--line);
}

.project-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:2px;
}

.project-meta span{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.project-meta span::before{
  content:"#";
  color:var(--warm);
}

.project-actions{
  margin-top:auto;
  padding-top:16px;
  border-top:1px solid var(--line);
}

.text-btn{
  border:0;
  border-bottom:1px solid rgba(15,76,69,0.28);
  background:transparent;
  color:var(--accent-strong);
  padding:0 0 2px;
  font-weight:800;
}

.text-btn:hover{
  border-bottom-color:currentColor;
}

.skills-grid{
  grid-template-columns:repeat(3, 1fr);
}

.skill-group{
  background:transparent;
}

.skill-group h3{
  font-size:16px;
  margin-bottom:8px;
}

.skill-group p{
  margin:0;
  color:var(--muted);
  font-weight:600;
}

.timeline{
  display:grid;
  gap:14px;
  max-width:900px;
}

.timeline-item{
  display:grid;
  grid-template-columns:160px minmax(0, 1fr);
  gap:24px;
  align-items:start;
}

.timeline-date{
  margin:0;
  color:var(--warm);
  font-size:13px;
  font-weight:800;
}

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

.contact-section{
  background:var(--ink);
  color:#fff;
  padding:clamp(72px, 10vw, 120px) 0;
}

.contact-section .eyebrow{
  color:#9fd5cc;
}

.contact-section .muted{
  color:rgba(255,255,255,0.72);
}

.contact-layout{
  display:grid;
  grid-template-columns:minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap:clamp(32px, 7vw, 84px);
  align-items:start;
}

.contact-links{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:12px;
  margin-top:28px;
}

.contact-links a{
  color:#fff;
  border-bottom-color:rgba(255,255,255,0.3);
}

.form{
  display:grid;
  gap:14px;
  padding:24px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.16);
  border-radius:var(--radius);
}

.form label{
  display:grid;
  gap:7px;
  color:rgba(255,255,255,0.76);
  font-size:13px;
  font-weight:800;
}

.form input,
.form textarea{
  width:100%;
  border:1px solid rgba(255,255,255,0.2);
  border-radius:var(--radius);
  background:rgba(255,255,255,0.09);
  color:#fff;
  padding:12px 13px;
  resize:vertical;
}

.form input:focus,
.form textarea:focus{
  border-color:#9fd5cc;
  outline:0;
}

.form .btn{
  border-color:#fff;
  background:#fff;
  color:var(--ink);
}

.form-hint{
  min-height:20px;
  margin:0;
  color:rgba(255,255,255,0.72);
  font-size:13px;
}

.footer{
  padding:24px 0;
  background:var(--ink);
  color:rgba(255,255,255,0.68);
  border-top:1px solid rgba(255,255,255,0.12);
}

.footer-inner{
  display:flex;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.footer p{
  margin:0;
}

.footer a{
  color:#fff;
  border-bottom-color:rgba(255,255,255,0.3);
}

.reveal{
  opacity:0;
  transform:translateY(14px);
  transition:opacity .55s ease, transform .55s ease;
}

.reveal.show{
  opacity:1;
  transform:translateY(0);
}

@media (max-width: 920px){
  .container{
    width:min(calc(100% - 32px), var(--max));
  }

  .nav-toggle{
    display:flex;
  }

  .nav-links{
    position:absolute;
    top:76px;
    left:16px;
    right:16px;
    display:none;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    padding:12px;
    background:var(--surface-strong);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
  }

  .nav-links.show{
    display:flex;
  }

  .hero,
  .section-head.split,
  .contact-layout{
    grid-template-columns:1fr;
  }

  .hero{
    min-height:auto;
  }

  .about-grid,
  .skills-grid{
    grid-template-columns:1fr 1fr;
  }

  .project-grid{
    grid-template-columns:1fr;
  }

  .project{ min-height:auto; }
}

@media (max-width: 640px){
  .container{
    width:min(calc(100% - 32px), 358px);
    margin-left:16px;
    margin-right:auto;
  }

  h1{
    font-size:30px;
    line-height:1.12;
  }

  .hero-subtitle{
    font-size:16px;
  }

  .about-grid,
  .skills-grid,
  .timeline-item{
    grid-template-columns:1fr;
  }

  .hero-actions .btn{
    width:100%;
  }
}

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