:root {
  --font-size: 19px;
  --container: 920px;

  --bg: #ffffff;
  --band: #eeeeee;
  --fg: #222222;
  --muted: #6a6a6a;
  --link: #1558b0;
  --line: #d4d4d4;
  --dot: #aaaaaa;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b;
    --band: #242424;
    --fg: #e8e8e8;
    --muted: #9a9a9a;
    --link: #7ab0ff;
    --line: #383838;
    --dot: #777777;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0b;
  --band: #242424;
  --fg: #e8e8e8;
  --muted: #9a9a9a;
  --link: #7ab0ff;
  --line: #383838;
  --dot: #777777;
}

html {
  color-scheme: light dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--font-size);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.row {
  display: flex;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

#dhead {
  padding-top: 64px;
  padding-bottom: 40px;
}

#dhead .row {
  align-items: center;
  gap: 44px;
}

.ppic {
  display: block;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
}

#ddesc h1 {
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 8px;
}

#ddesc h2 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 22px;
}

.iico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--band);
  color: var(--fg);
  margin-right: 10px;
}

.iico:hover {
  text-decoration: none;
  background: var(--line);
}

.iico svg {
  width: 22px;
  height: 22px;
}

#demail {
  margin-top: 14px;
  min-height: 1.6em;
}

#history {
  padding-top: 48px;
  padding-bottom: 12px;
}

.entry {
  position: relative;
  padding-bottom: 40px;
}

.timespan {
  flex: 0 0 140px;
  padding-right: 22px;
  padding-top: 3px;
  text-align: right;
  color: var(--muted);
  font-size: 0.95em;
  white-space: nowrap;
}

.ico {
  flex: 0 0 96px;
  position: relative;
  padding-left: 34px;
}

.ico img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 2px;
}

.ico::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: -26px;
  width: 2px;
  background: var(--line);
}

.entry:last-child .ico::before {
  display: none;
}

.entry-dot {
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dot);
  border: 3px solid var(--bg);
  box-sizing: content-box;
  margin: -3px;
}

.desc {
  flex: 1;
  min-width: 0;
}

.subpoints {
  margin: 6px 0 0;
  padding-left: 1.2em;
}

.subpoints li {
  margin: 0.25em 0;
}

.sub-entry {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 18px;
}

.sub-ico {
  flex: 0 0 44px;
  padding-top: 2px;
}

.ieee-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 2px;
}

.ieee-dark {
  display: none !important;
  background: #000000;
}

:root[data-theme="dark"] .ieee-light {
  display: none !important;
}

:root[data-theme="dark"] .ieee-dark {
  display: block !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ieee-light {
    display: none !important;
  }

  :root:not([data-theme="light"]) .ieee-dark {
    display: block !important;
  }
}

.ctitle {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin: 44px 0 22px;
}

.band {
  background: var(--band);
  padding-top: 1px;
  padding-bottom: 36px;
}

#bio {
  padding-bottom: 6px;
}

.cards {
  flex-wrap: wrap;
  gap: 32px 28px;
}

.card {
  width: calc((100% - 56px) / 3);
}

.ccimg {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: var(--line);
}

.ccimg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card a:hover .ccimg {
  opacity: 0.88;
}

.cdesc {
  margin-top: 10px;
  font-size: 0.92em;
  line-height: 1.4;
}

ul.nodot {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

ul.nodot li {
  margin: 0.7em 0;
}

.pdate {
  color: var(--muted);
  margin-right: 0.5em;
}

.psum {
  color: var(--muted);
  font-size: 0.92em;
  margin-top: 2px;
}

.project {
  display: flex;
  gap: 28px;
  margin: 0 0 34px;
}

.pico {
  flex: 0 0 170px;
}

.pico img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.pdesc {
  flex: 1;
  min-width: 0;
}

.proj {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.93em;
}

ul.misc {
  padding-left: 1.3em;
  margin: 0;
}

ul.misc li {
  margin: 0.7em 0;
}

.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.post .back {
  font-size: 0.95em;
}

.post h1 {
  font-size: 40px;
  line-height: 1.2;
  margin: 28px 0 6px;
}

.post .meta {
  color: var(--muted);
  margin-bottom: 36px;
}

.post p,
.post li {
  line-height: 1.7;
}

.post img {
  max-width: 100%;
  border-radius: 10px;
}

.post pre {
  background: var(--band);
  padding: 14px 16px;
  border-radius: 8px;
  overflow: auto;
  font-size: 0.85em;
}

.post code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .card {
    width: calc((100% - 28px) / 2);
  }
}

@media (max-width: 680px) {
  :root {
    --font-size: 18px;
  }

  #dhead {
    padding-top: 40px;
  }

  #dhead .row {
    flex-direction: column;
    text-align: center;
    gap: 22px;
  }

  #ddesc h1 {
    font-size: 38px;
  }

  #ddesc h2 {
    font-size: 21px;
  }

  .iico {
    margin: 0 5px;
  }

  .entry {
    flex-wrap: wrap;
  }

  .timespan {
    flex: 0 0 100%;
    text-align: left;
    padding: 0 0 6px 34px;
  }

  .ico {
    flex: 0 0 90px;
  }

  .ico::before {
    top: -18px;
  }

  .project {
    flex-direction: column;
    gap: 14px;
  }

  .pico {
    flex: none;
    max-width: 260px;
  }

  .card {
    width: 100%;
  }

  .ctitle {
    font-size: 28px;
  }
}

.tl {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tl-item {
  position: relative;
  display: block;
  padding: 6px 0 14px 30px;
  font-size: 0.85em;
  line-height: 1.6;
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--dot);
}

.tl-item:first-child::before {
  top: 19px;
}

.tl-item:last-child::before {
  bottom: auto;
  height: 19px;
}

.tl-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--muted);
}

.tl-item.done::after {
  background: var(--fg);
  border-color: var(--fg);
}

.tl-item.active::after {
  background: var(--link);
  border-color: var(--link);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--link);
}

.tl-name {
  font-weight: 700;
}

.tl-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tl-sum {
  color: var(--fg);
  margin: 2px 0 3px;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.5;
}

.tl-tags {
  color: var(--muted);
  display: block;
  width: 100%;
}

@media (max-width: 680px) {
  .entry {
    padding-bottom: 30px;
  }

  .ico {
    order: 1;
    flex: 0 0 90px;
  }

  .ico::before {
    display: none;
  }

  .timespan {
    order: 2;
    flex: 1;
    padding: 6px 0 0 0;
  }

  .desc {
    order: 3;
    flex: 0 0 100%;
    padding-left: 34px;
    margin-top: 8px;
  }
}

button.iico {
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.iico .i-sun {
  display: none;
}

.iico.is-dark .i-sun {
  display: block;
}

.iico.is-dark .i-moon {
  display: none;
}

.mp {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 24px;
}

.mp-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
}

.mp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}

.mp-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.mp-status {
  color: var(--muted);
  font-size: 0.8em;
}

.mp-tags {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  margin: 6px 0 12px;
}

.mp-sum {
  margin: 0;
}

.mp-links {
  margin-top: 14px;
  font-size: 0.92em;
}

.mp-links a {
  margin-right: 16px;
}