/* Charbel Keedy — personal site
   Palette: cedar green on pale sage, amber for data in motion */
:root {
  --bg: #EEF1EC;
  --surface: #F8FAF6;
  --ink: #1B2A2F;
  --muted: #56666A;
  --line: #C9D1CB;
  --cedar: #2F6B4F;
  --cedar-dark: #22513B;
  --amber: #C8962E;
  --radius: 6px;
  --max: 1120px;
  --font: "Archivo", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cedar); text-underline-offset: 3px; }
a:hover { color: var(--cedar-dark); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: 1rem; }
.brand { font-weight: 800; font-stretch: 112%; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-weight: 500; font-stretch: 100%; font-size: .95rem; margin-left: .5rem; }
.nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--line); }
.nav a[aria-current="page"] { border-color: var(--cedar); color: var(--cedar); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; padding: .4rem .8rem; color: var(--ink); cursor: pointer; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { position: absolute; inset: 100% 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: .5rem 1.25rem 1rem; }
  .nav a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .brand span { display: none; }
}

/* Type */
h1, h2, h3 { line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); font-weight: 800; font-stretch: 118%; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; font-stretch: 110%; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }

main section { padding: 4.5rem 0; }
main section + section { border-top: 1px solid var(--line); }
.page-head { padding: 4rem 0 2.5rem; }
.page-head p { font-size: 1.15rem; color: var(--muted); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn { display: inline-block; padding: .8rem 1.3rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; border: 2px solid var(--cedar); font-size: 1rem; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--cedar); color: #fff; }
.btn-primary:hover { background: var(--cedar-dark); border-color: var(--cedar-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--cedar); }
.btn-ghost:hover { background: var(--surface); }

/* Hero with pipeline diagram */
.hero { padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { max-width: 12ch; }
.pipeline { width: 100%; height: auto; }
.pipeline .node rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.pipeline .node text { font-family: var(--font); font-size: 13px; fill: var(--ink); font-weight: 600; }
.pipeline .node.core rect { fill: var(--cedar); stroke: var(--cedar); }
.pipeline .node.core text { fill: #fff; }
.pipeline .node.out rect { stroke: var(--cedar); stroke-width: 2; }
.pipeline .flow { fill: none; stroke: var(--line); stroke-width: 2; }
.pipeline .packet { fill: var(--amber); }
.pipeline .caption { font-family: var(--font); font-size: 12px; fill: var(--muted); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pipeline .packet { display: none; } }

/* Focus areas: ruled list, not cards */
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-top: 2rem; }
.area { border-top: 3px solid var(--cedar); padding-top: 1.1rem; }
.area p { color: var(--muted); font-size: 1rem; }
.area .tools { font-size: .92rem; color: var(--ink); font-weight: 500; }
@media (max-width: 860px) { .areas { grid-template-columns: 1fr; gap: 2rem; } }

/* Intro with photo */
.intro { display: grid; grid-template-columns: 180px 1fr; gap: 2.5rem; align-items: start; }
.intro img { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); }
@media (max-width: 640px) { .intro { grid-template-columns: 1fr; } .intro img { width: 140px; height: 140px; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.facts div { border-left: 3px solid var(--amber); padding-left: 1rem; }
.facts strong { display: block; font-size: 1.05rem; }
.facts span { color: var(--muted); font-size: .95rem; }

/* Timeline (experience is a true sequence) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9.5rem; top: .5rem; bottom: 0; width: 2px; background: var(--line); }
.role { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0 2.25rem; padding-bottom: 3rem; position: relative; }
.role::after { content: ""; position: absolute; left: calc(9.5rem - 6px); top: .45rem; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--cedar); }
.role.current::after { background: var(--cedar); }
.role .when { font-weight: 600; font-size: .95rem; color: var(--muted); padding-top: .2rem; padding-right: 1rem; }
.role .body { padding-left: .5rem; }
.role h3 { margin-bottom: .15rem; }
.role .org { color: var(--cedar); font-weight: 600; margin-bottom: .75rem; }
.role ul { margin: 0; padding-left: 1.1rem; max-width: 72ch; }
.role li { margin-bottom: .4rem; }
@media (max-width: 700px) {
  .timeline::before { left: 6px; }
  .role { grid-template-columns: 1fr; padding-left: 2rem; }
  .role::after { left: 0; }
  .role .body { padding-left: 0; }
}

/* Skills */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 3rem; }
.skill-groups h3 { border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem; font-size: .93rem; }
@media (max-width: 760px) { .skill-groups { grid-template-columns: 1fr; } }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 1.5rem; padding: .9rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plain-list li span:last-child { color: var(--muted); }

/* Portfolio */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filters button { font: inherit; font-size: .95rem; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.6rem 1.3rem; display: flex; flex-direction: column; }
.project.featured { grid-column: 1 / -1; border-left: 5px solid var(--cedar); }
.project .kind { font-size: .88rem; color: var(--cedar); font-weight: 600; margin-bottom: .4rem; }
.project h3 { font-size: 1.3rem; }
.project p { color: var(--muted); font-size: 1rem; }
.project .stack { font-size: .9rem; font-weight: 500; color: var(--ink); margin: 0; }
.project details:last-child { margin-top: auto; }
.project details { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.project summary { cursor: pointer; font-weight: 600; color: var(--cedar); }
.project details ul { margin: .7rem 0 0; padding-left: 1.1rem; font-size: .98rem; }
.project details li { margin-bottom: .35rem; }
.project .links { margin-top: .9rem; font-size: .95rem; }
.project[hidden] { display: none; }
@media (max-width: 760px) { .projects { grid-template-columns: 1fr; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3.5rem; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.contact-list strong { display: block; font-size: .92rem; color: var(--muted); font-weight: 500; }
.contact-list a, .contact-list span { font-size: 1.1rem; font-weight: 600; }
form label { display: block; font-weight: 600; margin: 0 0 .35rem; }
form input, form textarea { width: 100%; font: inherit; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); margin-bottom: 1.1rem; }
form textarea { min-height: 9rem; resize: vertical; }
.form-note { font-size: .92rem; color: var(--muted); }
.form-error { color: #A13D2D; font-weight: 600; min-height: 1.5em; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* CTA band */
.cta { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 3rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta h2 { margin: 0; color: #fff; max-width: 22ch; }
.cta .btn-primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.cta .btn-primary:hover { background: #DDA93B; border-color: #DDA93B; color: var(--ink); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .95rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.site-footer a { color: var(--muted); }

@media print {
  .site-header, .site-footer, .cta, .filters { display: none; }
  body { background: #fff; }
}

/* Live websites */
.sites-head { margin-top: 4rem; }
.sites-grid { grid-template-columns: repeat(3, 1fr); margin-top: 1.5rem; }
.project.site { padding: 1.3rem 1.4rem; }
.project.site h3 { font-size: 1.15rem; }
.project.site .links { margin-top: auto; padding-top: .3rem; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .sites-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sites-grid { grid-template-columns: 1fr; } }
.projects[hidden], .sites-head[hidden], .sites-head + p[hidden] { display: none; }
