/* =========================================================
   Dr. Renee Duncan | shared styles
   Colours and fonts are set here so you can tweak them once.
   ========================================================= */
:root {
  --purple: #7b4f9d;        /* DUNCAN */
  --purple-dark: #5b3474;   /* ABOUT / section headings */
  --rust: #a5493f;          /* heading underline */
  --ink: #111111;           /* script + text */
  --panel: #f4f3f1;         /* soft grey panel behind name */
  --btn: #000000;           /* buttons */
  --white: #ffffff;

  --script: "Corinthia", cursive;
  --display: "Josefin Sans", "Poppins", sans-serif;
  --heading: "Bebas Neue", "Oswald", sans-serif;
  --body: "Poppins", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--purple); }
img { max-width: 100%; }

/* ---------- Masthead (name logo) ---------- */
/* Everything inside is sized in "em" so the whole logo scales together.
   Text positions are divided by their own font size so they line up. */
.masthead-wrap {
  font-size: clamp(3.2px, 0.92vw, 10px);
  padding-top: 4em;
  overflow: hidden;
}
.masthead {
  position: relative;
  width: 109em;
  height: 18em;
  margin: 0 auto;
}
.masthead .panel {
  position: absolute;
  left: 14.25em; width: 67.75em;
  top: 4.85em;  height: 9.65em;
  background: var(--panel);
  border-radius: 0 2.4em 2.4em 0;
}
.masthead .rule {
  position: absolute;
  top: 9em;
  height: 0.12em; min-height: 1px;
  background: var(--ink);
}
.masthead .rule.left  { left: 14.25em; width: 19em; }
.masthead .rule.right { left: 68.2em;  width: 28.6em; }
.masthead .dr {
  position: absolute;
  left: calc(50.5em / 3.4); top: calc(0.2em / 3.4);
  font-family: var(--display);
  font-weight: 400;
  font-size: 3.4em;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #2a2a2a;
}
.masthead .script {
  position: absolute;
  left: calc(36em / 17); top: calc(-1.2em / 17);
  font-family: var(--script);
  font-weight: 400;
  font-size: 17em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  filter: url(#thin-script);
}
.masthead .duncan {
  position: absolute;
  left: calc(51.2em / 6); top: calc(11.2em / 6);
  font-family: var(--display);
  font-weight: 400;
  font-size: 6em;
  line-height: 1;
  letter-spacing: 0.07em;
  color: var(--purple);
}
.masthead a { text-decoration: none; }

/* ---------- Buttons ---------- */
.button-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
  max-width: 925px;
  margin: 70px auto 0;
  padding: 0 24px;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 61px;
  padding: 12px 18px;
  background: var(--btn);
  color: var(--white);
  border: 0;
  border-radius: 6px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover, .btn:focus-visible { background: var(--purple-dark); transform: translateY(-2px); }
.btn.small { min-height: 46px; font-size: 13px; padding: 10px 22px; display: inline-flex; }

/* ---------- Section headings (ABOUT Renee) ---------- */
main { max-width: 925px; margin: 0 auto; padding: 0 24px 80px; }
section { padding-top: 90px; scroll-margin-top: 10px; }

.section-heading {
  /* Built on one text line so the script sits on the same baseline as the
     capitals, whatever script font is used. */
  position: relative;
  display: block;
  width: min(470px, 100%);
  margin: 0 0 46px;
  font-family: var(--heading);
  font-weight: 400;
  font-size: 60px;
  line-height: 1;
  white-space: nowrap;
}
/* rust underline: just under the baseline, behind the script */
.section-heading::after {
  content: "";
  position: absolute;
  left: 0.4em; right: 0;
  top: 0.98em;
  height: 2px;
  background: var(--rust);
  z-index: 0;
}
.section-heading .caps {
  position: relative; z-index: 1;
  color: var(--purple-dark);
  letter-spacing: 0.01em;
  margin-right: 0.12em;
}
.section-heading .script {
  position: relative; z-index: 1;
  font-family: var(--script);
  font-size: 1.6em;            /* script size relative to the capitals */
  line-height: 0;              /* keeps the baseline lined up with the capitals */
  vertical-align: baseline;
  color: var(--ink);
}
.section-heading .script .ink { filter: url(#thin-script-sm); }
/* white copy of the word behind it cuts small gaps in the red line where strokes cross it */
.section-heading .script::before {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  color: #fff;
  -webkit-text-stroke: 4px #fff;
  z-index: -1;
}

/* ---------- Content ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: start;
}
.photo-placeholder {
  aspect-ratio: 4 / 5;
  background: var(--panel);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #888; font-size: 13px; text-align: center; padding: 16px;
}
.photo { width: 100%; border-radius: 6px; display: block; }
.creds { list-style: none; padding: 0; margin: 24px 0 0; }
.creds li { padding: 8px 0; border-bottom: 1px solid #e7e4e0; }
.creds strong { color: var(--purple-dark); font-weight: 600; }

.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li { padding: 18px 0; border-bottom: 1px solid #e7e4e0; }
.pub-list .year { font-family: var(--heading); font-size: 22px; color: var(--rust); margin-right: 10px; }
.pub-list .title { font-weight: 500; }

.contact-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }

footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 13px;
  color: #777;
  border-top: 1px solid #eee;
}

/* ---------- Portfolio page ---------- */
.gate {
  max-width: 420px;
  margin: 60px auto 0;
  padding: 40px 32px;
  background: var(--panel);
  border-radius: 10px;
  text-align: center;
}
.gate h2 { font-family: var(--heading); font-weight: 400; font-size: 40px; color: var(--purple-dark); margin: 0 0 8px; letter-spacing: 0.02em; }
.gate p { margin: 0 0 20px; font-size: 14px; color: #555; }
.gate input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 14px;
  background: #fff;
}
.gate input:focus { outline: 2px solid var(--purple); border-color: transparent; }
.gate .btn { width: 100%; }
.gate .error { color: var(--rust); font-size: 14px; min-height: 1.4em; margin: 10px 0 0; }

.intro { margin: 0 0 6px; font-size: 17px; max-width: 680px; }
.hint { margin: 0 0 10px; font-size: 14px; color: #666; }
.portfolio-section-title {
  font-family: var(--heading);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.03em;
  color: var(--purple-dark);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e7e4e0;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: start;
}
.card {
  display: flex; flex-direction: column;
  border: 1px solid #e7e4e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 8px 22px rgba(91, 52, 116, 0.12); }
.card .thumb {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 16 / 8;
  padding: 0; border: 0; cursor: pointer;
  background: var(--panel);
  font-family: var(--heading); font-size: 22px; letter-spacing: 0.04em; color: var(--purple);
  overflow: hidden;
}
.card .thumb:disabled { cursor: default; color: #aaa; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card .body { padding: 12px 16px 14px; display: flex; flex-direction: column; flex: 1; }
.card .type { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); font-weight: 600; }
.card h4 { margin: 2px 0 10px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.title-btn { all: unset; cursor: pointer; }
.title-btn:hover, .title-btn:focus-visible { color: var(--purple); text-decoration: underline; }
.card.pending h4 { color: #777; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.mini-btn {
  display: inline-block;
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 5px;
  border: 1px solid var(--purple-dark); background: #fff; color: var(--purple-dark);
  text-decoration: none; cursor: pointer; line-height: 1.4;
}
.mini-btn:hover { background: #f3eef7; }
.mini-btn.primary { background: var(--purple-dark); color: #fff; }
.mini-btn.primary:hover { background: var(--purple); }
.mini-btn.disabled { border-color: #ddd; color: #999; cursor: default; background: #fafafa; }

.about { margin-top: 10px; border-top: 1px solid #eee; padding-top: 8px; }
.about summary {
  cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--purple-dark);
  display: flex; align-items: center; justify-content: space-between;
}
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: "\25BE"; font-size: 14px; transition: transform 0.2s ease; }
.about[open] summary::after { transform: rotate(180deg); }
.about p { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: #444; }
.about p strong { color: var(--purple-dark); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: #f3eef7; color: var(--purple-dark); }

/* Viewer (opens Drive file on the page) */
.viewer {
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, 0.97);
  display: none;
  flex-direction: column;
  z-index: 100;
}
.viewer.open { display: flex; }
.viewer-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #e7e4e0;
  background: #fff;
}
.viewer-bar h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-frame-wrap { position: relative; flex: 1; }
.viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer .loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #777; font-size: 14px;
}
.link-btn { background: none; border: 1px solid #ccc; color: var(--ink); border-radius: 6px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.link-btn:hover { border-color: var(--purple); color: var(--purple); }

.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .button-row { grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 40px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .photo-col { max-width: 260px; }
  .section-heading { font-size: 46px; }
  section { padding-top: 64px; }
}
