/* ============================================================
   Steve Macenski — cassidoo-style monospace layout
   Nav2 blue: #47c6ee
   ============================================================ */

/* --- Theme B: Nav2 Blue Primary --- */
[data-theme="b"] {
  --bg: #faf5f6;
  --text: #252525;
  --gray: #6b6b6b;
  --link: #47c6ee;
  --accent: #47c6ee;
  --border: #6b6b6b;
  --card-border: #47c6ee;
  --btn-bg: #47c6ee;
  --btn-text: #ffffff;
  --nav-bg: rgba(250,245,246,0.7);
}

:root {
  --bg: #faf5f6;
  --text: #252525;
  --gray: #6b6b6b;
  --link: #47c6ee;
  --accent: #47c6ee;
  --border: #6b6b6b;
  --card-border: #47c6ee;
  --btn-bg: #47c6ee;
  --btn-text: #ffffff;
  --nav-bg: rgba(250,245,246,0.7);
}

/* ============================================================
   Base — matches cassidoo.co structure
   ============================================================ */

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

::selection {
  background-color: #e5ffc3;
  color: var(--text);
}

html, body {
  background-color: var(--bg);
  color: var(--text);
  max-width: 1100px;
  margin: auto;
  padding: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  scroll-behavior: smooth;
}

html, body, button, code, input, textarea {
  font-family: 'iA Writer Mono', monospace;
}

/* ============================================================
   Typography
   ============================================================ */

h1 {
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.2;
  margin: 0 0 0.1em;
  color: var(--text);
}

h2 {
  font-weight: 400;
  color: var(--gray);
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0.5em 0;
}

h3 {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  margin: 1em 0 0.3em;
}

p {
  margin: 0.8em 0;
  line-height: 1.6;
}

a {
  color: var(--link);
  text-underline-offset: 0.3ex;
  text-decoration-thickness: 0.3ex;
}

a:hover {
  font-weight: bolder;
}

strong, b {
  color: var(--text);
}

hr {
  border: none;
  border-top: 1px solid var(--gray);
  width: 75%;
  margin: 1.5rem auto;
}

ul {
  padding-left: 1.5em;
  line-height: 1.6;
}

li {
  margin: 0.3em 0;
}

blockquote {
  background: rgba(37,37,37,0.04);
  border-left: 0.5ex solid var(--accent);
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  margin: 0 0 1em 0;
  padding: 20px;
  font-style: italic;
}

blockquote p {
  margin: 0;
}

blockquote > ul:last-child {
  text-align: right;
  margin: 0.5em 0 0;
  padding: 0;
  list-style: none;
  font-style: normal;
}

blockquote > ul:last-child > li::before {
  content: "- ";
}

/* ============================================================
   Header — cassidoo style (image + name side by side)
   ============================================================ */

header {
  position: relative;
}

.header-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.img-frame {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin: 10px 0;
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.header-frame {
  width: 350px;
  padding-left: 1rem;
}

.header-frame h2 {
  white-space: pre-wrap;
}

/* ============================================================
   Nav — sticky inline, like cassidoo
   ============================================================ */

nav {
  text-align: center;
  background: var(--nav-bg);
  backdrop-filter: blur(1px);
  position: sticky;
  top: 0;
  padding: 0;
  z-index: 100;
}

nav a {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin: 1.5rem 0;
}

nav a:not(:last-child) {
  padding-right: 0.75rem;
}

nav a:hover,
nav a.active {
  text-underline-offset: 0.3ex;
  font-weight: bolder;
  text-decoration: underline 0.3ex;
}

@media (max-width: 650px) {
  nav {
    padding: 1.5rem 0 0;
  }
  nav a {
    margin: 0 0 1.5rem;
  }
}

/* ============================================================
   Main content
   ============================================================ */

main, content {
  line-height: 1.6;
}

main.narrow {
  max-width: 70ch;
  margin: 0 auto;
  padding: 0 20px;
}

main.wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  text-align: center;
  padding: 25px;
  font-size: 0.8rem;
  color: var(--gray);
}

footer a {
  color: var(--gray);
  text-decoration: none;
}

footer a:hover {
  color: var(--link);
  font-weight: normal;
}

/* ============================================================
   Publications — 2-column with ASCII divider
   ============================================================ */

.pub-columns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
}

.pub-col {
  padding: 0 1rem;
}

.pub-col:first-child {
  padding-left: 0;
}

.pub-col:last-child {
  padding-right: 0;
}

.pub-col p {
  font-size: 0.85rem;
  margin: 0 0 1em;
  line-height: 1.5;
}

.pub-divider {
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--accent) 0,
    var(--accent) 0.7em,
    transparent 0.7em,
    transparent 1.2em
  );
  align-self: stretch;
  margin: 0 0.3rem;
}

.ascii-hr {
  color: var(--accent);
  text-align: center;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 650px) {
  .pub-columns {
    grid-template-columns: 1fr;
  }
  .pub-divider {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(
      to right,
      var(--accent) 0,
      var(--accent) 0.7em,
      transparent 0.7em,
      transparent 1.2em
    );
    margin: 0.5rem 0;
  }
  .pub-col {
    padding: 0;
  }
}

/* ============================================================
   Projects — ASCII Cards
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project-card {
  border: none;
  padding: 1rem 1.25rem;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(90deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch),
    repeating-linear-gradient(90deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch),
    repeating-linear-gradient(0deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch),
    repeating-linear-gradient(0deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch);
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%;
  background-position: top, bottom, left, right;
  background-repeat: no-repeat;
}

.project-card::before,
.project-card::after,
.project-card .corner-bl,
.project-card .corner-br {
  position: absolute;
  font-size: 0.85rem;
  color: var(--card-border);
  line-height: 1;
  background: var(--bg);
  padding: 0 2px;
}

.project-card::before {
  content: '+';
  top: -0.5em;
  left: -0.3em;
}

.project-card::after {
  content: '+';
  top: -0.5em;
  right: -0.3em;
}

.project-card .corner-bl {
  bottom: -0.5em;
  left: -0.3em;
}

.project-card .corner-br {
  bottom: -0.5em;
  right: -0.3em;
}

.card-img-placeholder {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  background: var(--bg);
  border: 1px dashed var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 0.75rem;
  color: var(--gray);
}

.card-img-placeholder::after {
  content: "[ image ]";
}

.card-img {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  object-fit: cover;
  object-position: center;
  margin-right: 1rem;
  border: none;
}

.card-img[alt="Opennav Semantic Navigation"] {
  object-position: left center;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.project-card .card-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.3em;
}

.project-card .card-desc {
  color: var(--gray);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.4em;
}

.project-card .card-link a {
  font-size: 0.8rem;
  color: var(--link);
}

@media (max-width: 650px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Robots — Photo Cards (reuses .project-card)
   ============================================================ */

a.robot-photo-card {
  text-decoration: none;
  color: inherit;
}

.robot-photo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  margin-bottom: 0.4em;
}

.robot-photo-card img[alt="Rover Pro"] {
  object-position: center 35%;
}

.robot-photo-card img[alt="Rover Mini"] {
  object-position: 70% center;
}

.robot-photo-card img[alt="TurtleBot2"] {
  object-position: 65% center;
}

.robot-photo-card img[alt="NASA Goddard Robots"] {
  object-position: center 15%;
}

.robot-photo-card img[alt="NASA Lunabotics"] {
  object-position: 100% center;
}

.robot-photo-card img[alt="Clearpath Jackal"] {
  object-position: 100% center;
}

.robot-photo-card img[alt="ABB IRB 120"] {
  object-fit: cover;
  object-position: center 30%;
}

.robot-photo-card img[alt="Cyton Gamma 300"] {
  object-position: 20% center;
}

.robot-photo-card img[alt="Pneumatic Flipper Battlebot"] {
  object-position: 60% center;
}

.robot-photo-card img[src*="clearpath-jackal2"] {
  object-position: 75% center;
}

.robot-photo-card img[alt="Robotnik Theron"] {
  object-position: 60% center;
}

/* ============================================================
   Robots Collage — masonry-style 2 columns
   ============================================================ */

.collage {
  display: flex;
  gap: 14px;
}

.collage-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.collage-col img {
  width: 100%;
  display: block;
}

.collage-card {
  position: relative;
  padding: 12px;
  display: block;
  text-decoration: none;
  background-image:
    repeating-linear-gradient(90deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch),
    repeating-linear-gradient(90deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch),
    repeating-linear-gradient(0deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch),
    repeating-linear-gradient(0deg, var(--card-border) 0, var(--card-border) 1ch, transparent 1ch, transparent 2ch);
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%;
  background-position: top, bottom, left, right;
  background-repeat: no-repeat;
}

.collage-card .corner-tl,
.collage-card .corner-tr,
.collage-card .corner-bl,
.collage-card .corner-br {
  position: absolute;
  font-size: 0.85rem;
  color: var(--card-border);
  line-height: 1;
  background: var(--bg);
  padding: 0 2px;
  z-index: 1;
}

.collage-card .corner-tl { top: -0.5em; left: -0.3em; }
.collage-card .corner-tr { top: -0.5em; right: -0.3em; }
.collage-card .corner-bl { bottom: -0.5em; left: -0.3em; }
.collage-card .corner-br { bottom: -0.5em; right: -0.3em; }

.collage-card img {
  width: 100%;
  display: block;
}

@media (max-width: 650px) {
  .collage {
    flex-direction: column;
  }
}

/* ============================================================
   About — Role descriptions (blue bar, no background)
   ============================================================ */

.role-desc {
  border-left: 0.5ex solid var(--accent);
  padding: 0 20px;
  margin: 0 0 1em 0;
  font-style: normal;
}

.role-desc p {
  margin: 0;
}

/* ============================================================
   About — Bio section
   ============================================================ */

.bio-section {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.bio-photo {
  flex-shrink: 0;
  width: 180px;
}

.bio-photo img {
  width: 180px;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.bio-text {
  flex: 1;
}

.bio-text p {
  margin: 0 0 0.8em;
}

@media (max-width: 650px) {
  .bio-section {
    flex-direction: column;
    align-items: center;
  }
  .bio-photo {
    width: 160px;
  }
  .bio-photo img {
    width: 160px;
    height: 200px;
  }
}

/* ============================================================
   About — woodworking gallery
   ============================================================ */

.woodworking-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.woodworking-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ============================================================
   Contact Form
   ============================================================ */

.contact-form {
  max-width: 100%;
  margin-top: 1rem;
}

.form-group {
  margin-bottom: 0.8rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--gray);
  border-radius: 4px;
  padding: 0.5em;
  font-size: 0.9rem;
  padding: 0.3em;
  font-family: 'iA Writer Mono', monospace;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
  border: 1px solid var(--gray);
  border-radius: 4px;
  padding: 0.5em;
}

/* Spam honeypot: positioned off-screen rather than display:none, since some
   bots skip fields hidden that way. Never shown to or focusable by humans. */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'iA Writer Mono', monospace;
  cursor: pointer;
  border-radius: 6px;
}

.form-submit:hover {
  opacity: 0.85;
}

.form-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* --- Looking for Help CTA --- */
.looking-for-help {
  padding: 0;
}

.cta-button {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'iA Writer Mono', monospace;
  text-decoration: none;
  border-radius: 6px;
  margin-top: 0.75rem;
}

.cta-button:hover {
  opacity: 0.85;
  color: var(--btn-text);
}

/* ============================================================
   Theme Switcher (review — remove for production)
   ============================================================ */

.theme-switcher {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 12px;
}

.theme-switcher p {
  font-weight: 700;
  margin: 0 0 0.3rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-switcher button {
  display: block;
  width: 100%;
  padding: 3px 6px;
  margin-bottom: 2px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-family: 'iA Writer Mono', monospace;
  text-align: left;
}

.theme-switcher button:hover {
  background: #f0f0f0;
}

.theme-switcher button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============================================================
   Awards — Year-Grouped Timeline
   ============================================================ */

.award-year-group {
  margin-bottom: 1.2em;
}

.award-year {
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.3em;
}

.award-entry {
  display: flex;
  align-items: baseline;
  gap: 0.5ch;
  margin-bottom: 0.4em;
  font-size: 0.9rem;
  padding-left: 1ch;
}

.award-pipe {
  color: var(--accent);
  user-select: none;
  flex-shrink: 0;
}

.award-detail {
  flex: 1;
}

.award-org {
  color: var(--gray);
  font-size: 0.8rem;
}

/* ============================================================
   Images
   ============================================================ */

img {
  max-width: 100%;
  height: auto;
}
