/* mermoz.net — hand-written, zero dependencies. */

:root {
  --accent:      #1f9c8f;
  --accent-dark: #16776d;
  --ink:         #1b2524;
  --muted:       #5f6d6c;
  --bg:          #ffffff;
  --bg-alt:      #f4f7f6;
  --line:        #e4ebe9;
  --shadow:      0 1px 2px rgba(20,40,38,.06), 0 8px 24px rgba(20,40,38,.06);
  --radius:      14px;
  --wrap:        1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--accent-dark); }
.site-nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); font-size: .95rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: 999px;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-alt); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent-dark); background: var(--bg-alt); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  padding: clamp(4rem, 3rem + 9vw, 8rem) 20px;
  background: #0d1a1a center/cover no-repeat;
  background-image:
    linear-gradient(180deg, rgba(10,22,22,.42), rgba(10,22,22,.66)),
    url("../assets/img/hero.webp");
}
.hero h1 { font-size: clamp(2.2rem, 1.6rem + 3.4vw, 3.6rem); margin-bottom: .3em; color: #fff; }
.hero p { font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); color: rgba(255,255,255,.9); max-width: 34ch; margin-inline: auto; }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section > .wrap > h2 { text-align: center; }
.lede { text-align: center; color: var(--muted); max-width: 60ch; margin: -.3rem auto 2.5rem; font-size: 1.1rem; }

/* ---------- Portfolio grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 4px 10px rgba(20,40,38,.08), 0 18px 40px rgba(20,40,38,.12); }
.card a.card-link { color: inherit; display: flex; flex-direction: column; height: 100%; }
.card a.card-link:hover { text-decoration: none; }
.card-media { aspect-ratio: 16 / 10; background: var(--bg-alt); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card-body h3 { margin-bottom: .25rem; }
.card-body p { color: var(--muted); font-size: .95rem; margin: 0; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent-dark); background: rgba(31,156,143,.1);
  padding: .2rem .55rem; border-radius: 999px; margin-bottom: .6rem;
}

/* ---------- Project (detail) ---------- */
.project { padding: clamp(2rem, 1.5rem + 3vw, 3.5rem) 0; }
.backlink { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.project-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.project-head img.app-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.project-head h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); margin: 0; }
.project-head .subtitle { color: var(--muted); margin: .2rem 0 0; font-size: 1.05rem; }
.status {
  display: inline-block; font-size: .82rem; font-weight: 600; color: var(--accent-dark);
  background: rgba(31,156,143,.1); border: 1px solid rgba(31,156,143,.25);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1.6rem;
}
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h2:first-child { margin-top: 0; }

.features { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 68ch; }
.features li { position: relative; padding-left: 1.7rem; margin-bottom: .5rem; }
.features li::before { content: "★"; position: absolute; left: 0; color: var(--accent); }
.features.bullets li::before { content: "✓"; font-weight: 700; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.gallery.phones { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.shot { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.shot img { width: 100%; height: auto; }
.shot figcaption { padding: .6rem .8rem; font-size: .85rem; color: var(--muted); }

/* ---------- Inline figures (build log) ---------- */
.figure { margin: 1.5rem 0; max-width: 620px; }
.figure img { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-alt); }
.figure.wide { max-width: 1000px; }
.figure figcaption { color: var(--muted); font-size: .88rem; margin-top: .45rem; line-height: 1.5; }

/* ---------- Community comment ---------- */
.comment { border-left: 3px solid var(--accent); background: var(--bg-alt); border-radius: 0 10px 10px 0; padding: 1rem 1.3rem; margin: 1.2rem 0; max-width: 68ch; }
.comment p { margin: 0 0 .6rem; }
.comment p:last-of-type { margin-bottom: .8rem; }
.comment cite { color: var(--muted); font-style: normal; font-size: .88rem; }

/* ---------- Inline code ---------- */
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: var(--bg-alt); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--ink); color: #e9efee; padding: .9rem 1.1rem; border-radius: 10px; overflow-x: auto; font-size: .84rem; line-height: 1.55; margin: 1.1rem 0; max-width: 76ch; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; border-radius: 0; }

/* wire-colour chips (RJ45 diagram) */
.w { display: inline-block; width: 34px; height: 11px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); vertical-align: middle; background: var(--c, #999); }
.w-s { background: repeating-linear-gradient(90deg, #fff 0 6px, var(--c) 6px 12px); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 1.1rem 0; max-width: 68ch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: .5rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--ink); font-weight: 600; background: var(--bg-alt); }
.tbl td { color: var(--muted); }
.tbl tfoot td { color: var(--ink); font-weight: 700; border-top: 2px solid var(--line); }
.tbl th.r, .tbl td.r { text-align: right; }

/* ---------- Press / reviews ---------- */
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.review {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.review .stars { color: #f5a623; letter-spacing: .1em; font-size: .9rem; }
.review blockquote { margin: .4rem 0 .6rem; font-size: .95rem; }
.review cite { color: var(--muted); font-size: .82rem; font-style: normal; }
.press { columns: 2 260px; column-gap: 2rem; max-width: 68ch; margin-top: 1rem; }
.press li { break-inside: avoid; margin-bottom: .5rem; color: var(--muted); font-size: .92rem; }
.press li b { color: var(--ink); font-weight: 600; }

/* ---------- Project banner ---------- */
.project-banner { margin: 0 0 1.6rem; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.project-banner img { width: 100%; display: block; }

/* ---------- Full press / recognition list (every mention, with links) ---------- */
.press-list { list-style: none; padding: 0; margin: 1rem 0; max-width: 74ch; }
.press-list li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.press-list .outlet { font-weight: 600; color: var(--ink); }
.press-list .outlet a { color: var(--ink); }
.press-list .q { color: var(--muted); font-style: italic; }
.press-list .meta { color: var(--muted); font-size: .85rem; }
.press-list a.src { font-size: .84rem; white-space: nowrap; }
.badge-med { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #b23a48; background: rgba(178,58,72,.1); padding: .12rem .45rem; border-radius: 999px; margin-left: .4rem; vertical-align: .08em; }
.note { color: var(--muted); font-size: .95rem; max-width: 68ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 600;
  padding: .7rem 1.3rem; border-radius: 999px; border: 0; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent-dark); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: rgba(31,156,143,.08); }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 2.2rem 0; margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.footer-inner p { margin: 0; }
.foot-mid { text-align: center; flex: 1 1 auto; }
.foot-mid .foot-brand { font-weight: 600; color: var(--ink); }
.foot-copy, .foot-links { flex: 0 0 auto; }
.footer-inner nav a { color: var(--muted); }
.footer-inner nav a:hover { color: var(--ink); }
@media (max-width: 620px) {
  .footer-inner { flex-direction: column; text-align: center; gap: .5rem; }
  .foot-mid { order: -1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg); cursor: pointer; color: var(--ink);
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .5rem; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .7rem .8rem; border-radius: 8px; }
  .header-inner { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
