/*
COLOR PALETTE

Dark green    #3c8453
Sandy beige   #bcaa96
Dark gray     #222222
Light gray    #d3d4d6
Off-white     #f6f6f6
*/
/* CSS VARIABLES */
:root {
  --color-primary: oklch(0.624 0.142 148.7); /* dark green */
  --color-primary-light: oklch(0.737 0.142 148.7);
  --color-bg: oklch(0.979 0.004 264.2); /* off-white */
  --color-bg-footer: oklch(0.222 0.01 282.2);
  --color-footer-text: oklch(0.899 0.012 264.2);
  --color-card-bg: #fff;
  --color-border: oklch(0.899 0.012 264.2);
  --color-text: #222222;
  --font-serif: "Instrument Serif", serif;
  --font-sans: "Open Sans", sans-serif;
  --radius: 1rem;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 3rem;
  --navbar-height: 4rem;
}

/* GLOBAL STYLES 
------------------------------------*/

html {
  box-sizing: border-box;
  font-size: 1.2rem;
  line-height: 1.5rem;
}
*,
*:before,
*:after {
  box-sizing: inherit;
}
html,
body {
  height: 100%;
}
body {
  background: var(--color-bg);
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--color-text);
}
/* TYPOGRAPHY */
h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0;
  line-height: 1.2;
}
h1 {
  font-size: 3rem;
}
h2 {
  font-size: 2.6rem;
}
h3 {
  font-size: 2rem;
}

/*links*/

a {
  color: var(--color-primary);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--color-primary-light);
  text-decoration: none;
}

footer a {
  color: var(--color-footer-text);
}

footer a:hover {
  color: var(--color-primary);
}
/* BUTTON STYLE */
button {
  background: var(--color-primary);
  color: var(--color-bg);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 1rem;
  display: inline-block;
  padding: 7px;
  letter-spacing: 0.1em;
  line-height: 1;
  border-radius: 4px;
  font-family: var(--font-sans);
}

/* CONTENT WRAPPER */
.content-wrapper {
  margin-inline: auto;
  padding: var(--space-l);
  max-inline-size: 900px;
}
/* Pop over */
.popover {
 position: absolute;
z-index: 100;
 background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
 box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: var(--space-s);
  display: none;
}
.popover[open] {
  display: block;
}
.popover {
  /* make this element a query container so its own size drives layout */
  container-type: inline-size;
  position: relative; /* UA will anchor popovers, allow layering */
  z-index: 110;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) / 1.25);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  color: var(--color-text);
  padding: 1rem;
  display: none; /* default hidden; shown by :popover-open */
  max-inline-size: 100%;
}
/* page overlay/dim when any popover is open (no JS) */
body:has(.popover:popover-open)::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 100;
  pointer-events: auto;
}

/* show the popover when open via UA popover API */
.popover:popover-open {
  display: block;
}

.popover-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.popover-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex: 0 0 auto;
}
.popover-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.popover .contact-line a { color: var(--color-primary); }
.popover-actions { margin-top: 0.5rem; }
/* Small: stacked column — fill viewport horizontally */
.popover {
  inline-size: 100vw;
  max-inline-size: 100%;
  margin: 0;
  border-radius: 0;
  padding: 1rem;
}
.popover-inner { flex-direction: column; align-items: stretch; }
.popover-avatar { width: 100%; height: auto; border-radius: 0.5rem; }
.bio { display: none; } /* hidden on the smallest popover */

/* Medium: two columns, but hide the longer bio text */
@container (min-width: 360px) {
  .popover {
    inline-size: min(80vw, 480px);
    max-inline-size: 90vw;
    border-radius: var(--radius);
    padding: 1rem;
  }
  .popover-inner { flex-direction: row; align-items: flex-start; }
  .popover-avatar { width: 96px; height: 96px; flex: 0 0 96px; }
  .bio { display: none; } /* medium hides biography per spec */
}

@container (min-width: 620px) {
  .popover {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    inline-size: min(33vw, 440px);
    max-inline-size: 33vw;
    padding: 1rem;
  }
  .popover-inner { display: contents; } /* allow grid children to flow */
  .popover-avatar {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .popover-content { grid-column: 2; align-self: center; }
  .bio { display: block; color: var(--color-text); opacity: 0.9; }
}

/* ensure popover buttons match site style */
.popover button {
  font-family: var(--font-sans);
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.35rem;
}
.popover a { text-decoration: none; }
.popover a:hover { text-decoration: underline; }

/* HOME
------------------------------------*/
.home {
  background: url(../images/bg-office.jpg) no-repeat;
  background-size: cover;
  display: flex;
  flex-direction: column;
}
.home .content-wrapper {
  flex: 1 0 auto;
}
.content-bg {
  background: var(--color-bg);
  padding: var(--space-l);
}

@media screen and (max-width: 40.63rem) {
  .home .content-wrapper {
    padding: var(--space-s);
  }
  .content-bg {
    padding: var(--space-s);
  }
}

/* RESUME
------------------------------------*/

.resume header::before {
  background: url(../images/bg-office.jpg) center;
  background-size: cover;
  content: "";
  display: block;
  height: 375px;
}
.resume-section {
  margin-bottom: 50px;
}
.resume-section h2 {
  border-bottom: 2px dashed var(--color-border);
}
@media screen and (max-width: 31.25rem) {
  .resume header::before {
    height: 12.5rem;
  }
  h1 {
    font-size: 5rem;
  }
  h2 {
    font-size: 2.6rem;
  }
}
/*.download-link {
  position: fixed;
  top: 5px;
  left: 5px;
}*/
/* NAVIGATION
------------------------------------*/

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-block-size: var(--navbar-height);
  padding-inline: var(--space-m);
  background: var(--color-bg);
  border-block-end: 1px solid var(--color-border);
  font-family: var(--font-sans);
  gap: var(--space-s);
}
.navbar-logo {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.05em;
  margin-inline-end: var(--space-m);
  display: flex;
  align-items: center;
}
.navbar-logo:visited {
  color: var(--color-primary);
}
.navbar-menu {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar-menu li {
  display: flex;
  align-items: center;
}
.navbar-menu a {
  color: var(--color-text);
  text-decoration: none;
  padding-block: 0.25em;
  padding-inline: 0.75em;
  border-radius: 0.25em;
  transition: background 0.2s, color 0.2s;
}
.navbar-menu a:hover,
.navbar-menu a:focus {
  background: var(--color-primary-light);
  color: var(--color-bg);
}
.navbar-menu .btn {
  margin-inline-start: var(--space-s);
  padding-block: 0.5em;
  padding-inline: 1.2em;
}

/* Profile
------------------------------------*/

/* Projects
------------------------------------*/
.project-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--space-m);
  padding-block: var(--space-m);
  grid-auto-rows: 1fr;
}
.project-item {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  background: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  align-items: start;
  padding: var(--space-m) var(--space-s);
  transition: box-shadow 0.2s;
}
.project-item:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.project-item img {
  inline-size: 100px;
  block-size: 100px;
  object-fit: contain;
  margin-block-end: var(--space-s);
}
.project-item h3 {
  margin-block: 0.5rem 1rem;
  text-align: center;
}
.project-item p {
  text-align: center;
  margin-block-end: 1rem;
}

.project-item .btn {
  margin-block-start: auto;
  justify-self: center;
}
@media (min-width: 860px) {
  .project-item {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 4;
  }
  .project-item img {
    inline-size: 100%;
    float: left;
    margin-inline-end: 20px;
  }
}
@media (max-width: 500px) {
  .project-item img {
    inline-size: 100%;
    margin-block-end: 10px;
  }
}

@media screen and (min-width: 53.75rem) {
  .project-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }
  .project-item img {
    inline-size: 100%;
    margin-block-end: 10px;
  }
  .project-item .btn {
    place-items: center;
  }
}
@media screen and (max-width: 31.25rem) {
  .project-item img {
    width: 100%;
    margin-bottom: 10px;
  }
}
@media (min-width: 21.875rem) {
  main {
    --spacing: 1rem;
  }
}

@media (min-width: 31.25rem) {
  main {
    --spacing: 2rem;
  }
}
/* Work Experience
------------------------------------*/
.work-item {
  margin: 30px 0;
}

.work-details p {
  margin: 0;
}

@media screen and (min-width: 53.75rem) {
  .work-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    column-gap: 1.25rem;
  }
  .work-summary p:first-child {
    margin-top: 0;
  }
}
/* Education
------------------------------------*/
.education-item {
  margin: 30px 0;
}
.education-item p {
  margin: 0;
}

/* FOOTER
------------------------------------*/
footer {
  background: var(--color-bg-footer);
  color: var(--color-footer-text);
  display: flex;
  justify-content: space-between;
  padding-inline: var(--space-m);
  padding-block: var(--space-xs);
  font-size: 1rem;
}

.socials {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-xs);
}
.socials li {
  display: inline-block;
  margin-left: 10px;
}
.socials img {
  width: 32px;
}
.socials img:hover {
  opacity: 0.5;
}
@media screen and (min-width: 53.75rem) {
  footer {
    display: flex;
    justify-content: space-between;
    padding: 0 1.25rem;
  }
}
@media screen and (max-width: 53.68rem) {
  footer {
    text-align: center;
    padding: 0.62rem;
  }
}
/* Responsive Navbar */
@media (max-width: 700px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding-inline: var(--space-s);
    gap: var(--space-xs);
  }
  .navbar-menu {
    flex-direction: column;
    gap: var(--space-xs);
    align-items: stretch;
  }
  .navbar-logo {
    justify-content: center;
    margin-inline-end: 0;
    margin-block-end: var(--space-xs);
  }
}
