/* =========================================================
   WREN - a one page portfolio template
   Free to use. Everything you need to change is in :root.
   ========================================================= */

:root {
  /* ---- 1. Accent. Change this one value to rebrand. ---- */
  --accent: #146b4a;

  /* ---- 2. Light palette ---- */
  --bg:     #f7f7f5;
  --text:   #15181a;
  --muted:  #5e6562;
  --line:   #e1e3df;

  /* ---- 3. Type ---- */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  /* ---- 4. Rhythm ---- */
  --measure: 46rem;
  --gutter:  clamp(1.5rem, 6vw, 2.5rem);
  --gap:     clamp(4rem, 10vw, 7rem);

  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #4ea882;
    --bg:     #0e100f;
    --text:   #edefec;
    --muted:  #949a96;
    --line:   #242624;
  }
}
:root[data-theme="dark"] {
  --accent: #4ea882;
  --bg:     #0e100f;
  --text:   #edefec;
  --muted:  #949a96;
  --line:   #242624;
}

/* =========================================================
   BASE
   ========================================================= */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2 { margin: 0; font-weight: 500; letter-spacing: -.022em; }
p, dl, dd, dt { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: 8px;
}
.skip:focus { left: 1rem; top: 1rem; }

.page {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(3rem, 8vw, 5rem);
}

/* Small uppercase section label. Used twice on the page, on purpose. */
.label {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* =========================================================
   HEADER
   ========================================================= */

.head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(2rem, 5vw, 3rem);
}
.head__name  { font-weight: 500; }
.head__right { display: flex; align-items: center; gap: 1rem; }

.head__status {
  font-size: .88rem; color: var(--muted);
  display: flex; align-items: center; gap: .5rem;
}
/* This dot means something: it says the person is available. */
.head__status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.toggle {
  width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; cursor: pointer;
  transition: border-color .2s var(--ease);
}
.toggle:hover { border-color: var(--text); }
.toggle__dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--text);
  background: linear-gradient(to right, var(--text) 50%, transparent 50%);
}

/* =========================================================
   INTRO
   ========================================================= */

.intro { padding-bottom: var(--gap); }

.intro h1 {
  font-size: clamp(1.5rem, 3.3vw, 2.2rem);
  line-height: 1.3;
  text-wrap: pretty;
  max-width: 30ch;
}

.intro__body {
  margin-top: 1.75rem;
  color: var(--muted);
  max-width: 60ch;
}

.intro__links {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 2rem;
  font-size: .95rem;
}
.intro__links a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.intro__links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* =========================================================
   WORK
   ========================================================= */

.work { padding-bottom: var(--gap); }

.project { border-top: 1px solid var(--line); }
.project:last-child { border-bottom: 1px solid var(--line); }

.project a {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title thumb"
    "desc  thumb"
    "meta  thumb";
  column-gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
  padding: 1.6rem 0;
  text-decoration: none;
}

.project__title {
  grid-area: title;
  font-size: 1.15rem; font-weight: 500;
  transition: color .2s var(--ease);
}
.project__desc {
  grid-area: desc;
  color: var(--muted);
  font-size: .95rem;
  margin-top: .3rem;
  max-width: 46ch;
}
.project__meta {
  grid-area: meta;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  margin-top: .75rem;
}

.project__thumb {
  grid-area: thumb;
  width: 148px; height: 100px;
  object-fit: cover;
  border-radius: 6px;
  opacity: .82;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

@media (hover: hover) {
  .project a:hover .project__title { color: var(--accent); }
  .project a:hover .project__thumb { opacity: 1; transform: scale(1.02); }
}

@media (max-width: 620px) {
  .project a {
    grid-template-columns: 1fr;
    grid-template-areas: "thumb" "title" "desc" "meta";
    row-gap: .2rem;
  }
  .project__thumb { width: 100%; height: 160px; margin-bottom: 1rem; }
}

/* =========================================================
   WHERE I HAVE BEEN
   ========================================================= */

.where { padding-bottom: var(--gap); }

.role {
  display: flex; justify-content: space-between; gap: 1.5rem;
  padding: .85rem 0;
  font-size: .97rem;
}
.role + .role { border-top: 1px solid var(--line); }
.role dd { color: var(--muted); font-family: var(--mono); font-size: .82rem; white-space: nowrap; }

/* =========================================================
   CONTACT
   ========================================================= */

.contact h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}
.contact p {
  margin-top: 1.25rem;
  color: var(--muted);
  max-width: 52ch;
}

.contact__mail {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: opacity .2s var(--ease);
}
.contact__mail:hover { opacity: .7; }

/* =========================================================
   FOOTER
   ========================================================= */

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  margin-top: var(--gap);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.foot a:hover { color: var(--accent); }

/* =========================================================
   ENTRANCE
   Sections fade up once on load. Nothing loops, nothing
   animates on scroll, because the page is short enough to
   read in one go.
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {
  :root.js .page > * > section,
  :root.js .head,
  :root.js .foot {
    opacity: 0;
    transform: translateY(10px);
    animation: rise .7s var(--ease) forwards;
  }
  :root.js .head            { animation-delay: .05s; }
  :root.js .intro           { animation-delay: .12s; }
  :root.js .work            { animation-delay: .19s; }
  :root.js .where           { animation-delay: .26s; }
  :root.js .contact         { animation-delay: .33s; }
  :root.js .foot            { animation-delay: .40s; }
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}
