@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

/*
 * The krabka.io look for the standard JDK doclet, loaded after the stock
 * stylesheet through --add-stylesheet. One dark palette, no light mode: a
 * navy page, a vermilion accent, Inter for text and JetBrains Mono for code.
 *
 * The :root block redefines the doclet's custom properties, which carries most
 * of the page. The rules below it cover what the doclet hard-codes: the page
 * backdrop, icons drawn for a light page, focus rings, the highlight.js
 * classes that --syntax-highlight emits, and narrow screens.
 *
 * Palette (contrast on #080d1a / #0c1322): body #e5e7eb, muted #9ca3af, links
 * #ff8466, hover #ffb39e; all above 4.5:1. Accent #ff4d2e marks focus and the
 * selected state only, never small text.
 */

:root {
  color-scheme: dark;

  --body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --block-font-family: var(--body-font-family);
  --code-font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, monospace;
  --body-font-size: 15px;
  --code-font-size: 13.5px;

  --body-text-color: #e5e7eb;
  --block-text-color: #e5e7eb;
  --body-background-color: #080d1a;
  --section-background-color: #0c1322;
  --detail-background-color: transparent;

  --navbar-background-color: #0c1322;
  --navbar-text-color: #e5e7eb;
  --subnav-background-color: #0c1322;

  --selected-background-color: rgba(255, 77, 46, 0.16);
  --selected-text-color: #f3f4f6;
  --selected-link-color: #ffb39e;

  --even-row-color: transparent;
  --odd-row-color: rgba(12, 19, 34, 0.7);

  --title-color: #f3f4f6;
  --link-color: #ff8466;
  --link-color-active: #ffb39e;

  --snippet-background-color: #0f172a;
  --snippet-text-color: #e5e7eb;
  --snippet-highlight-color: rgba(255, 77, 46, 0.22);

  --border-color: #1e293b;
  --table-border-color: #334155;

  --search-input-background-color: #0f172a;
  --search-input-text-color: #e5e7eb;
  --search-input-placeholder-color: #9ca3af;
  --search-tag-highlight-color: rgba(255, 77, 46, 0.22);

  --copy-icon-brightness: 100%;
  --copy-button-background-color-active: rgba(255, 255, 255, 0.12);

  --invalid-tag-background-color: rgba(255, 77, 46, 0.16);
  --invalid-tag-text-color: #ffd4c7;

  /* Table of contents, code and detail panels, buttons. */
  --toc-background-color: #0c1322;
  --toc-hover-color: #1e293b;
  --toc-highlight-color: rgba(255, 77, 46, 0.16);
  --code-background-color: #0f172a;
  --mark-background-color: #0c1322;
  --detail-block-color: #0c1322;
  --member-heading-background-color: #0c1322;
  --table-header-color: #0c1322;
  --subnav-link-color: #ff8466;
  --pre-background-color: #0f172a;
  --pre-text-color: #e5e7eb;
  --button-border-color: #334155;
  --button-active-filter: brightness(85%);
  --button-focus-filter: brightness(120%);
}

/* ---- page ------------------------------------------------------------ */

html {
  background-color: #080d1a;
}

body {
  background-color: #080d1a;
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 58, 138, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 30%, rgba(15, 23, 42, 0.4), transparent 60%);
  background-attachment: fixed;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* The doclet scrolls .flex-content inside a fixed box, so it needs the
 * backdrop too or the body gradient never shows. */
div.flex-box,
div.flex-content {
  background: transparent;
}

h1,
h2,
h3,
h4,
h5,
h6,
.title {
  color: #f3f4f6;
  font-family: var(--body-font-family);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1.title {
  font-size: 1.75em;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

body.class-declaration-page .summary h2,
body.class-declaration-page .details h2,
body.class-use-page h2,
body.module-declaration-page .block-list h2 {
  font-style: normal;
}

a:link,
a:visited {
  color: #ff8466;
}

a[href]:hover,
a[href]:focus {
  color: #ffb39e;
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #ff4d2e;
  outline-offset: 2px;
  border-radius: 3px;
}

::selection {
  background: rgba(255, 77, 46, 0.35);
  color: #fff;
}

/* The doclet marks external links with a small blue arrow. */
main a[href*="://"]::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="768" height="768"><path d="M584 664H104V184h216V80H0v688h688V448H584zM384 0l132 132-240 240 120 120 240-240 132 132V0z" fill="%23ff8466"/></svg>');
}

main a[href*="://"]:hover::after,
main a[href*="://"]:focus::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="768" height="768"><path d="M584 664H104V184h216V80H0v688h688V448H584zM384 0l132 132-240 240 120 120 240-240 132 132V0z" fill="%23ffb39e"/></svg>');
}

/* ---- navigation ------------------------------------------------------ */

.top-nav,
.sub-nav {
  border-bottom: 1px solid #1e293b;
}

.top-nav {
  background-color: #0c1322;
}

.top-nav a:link,
.top-nav a:active,
.top-nav a:visited {
  color: #e5e7eb;
}

.top-nav a:hover,
.top-nav a:focus {
  color: #ffb39e;
}

ul.nav-list li {
  border-radius: 4px;
}

.nav-bar-cell1-rev {
  background-color: rgba(255, 77, 46, 0.16);
  color: #f3f4f6;
  box-shadow: inset 0 -2px 0 #ff4d2e;
}

.sub-nav {
  background-color: #0c1322;
}

.sub-nav a:link,
.sub-nav a:visited {
  color: #ff8466;
}

.sub-nav a:hover,
.sub-nav a:focus {
  color: #ffb39e;
}

.sub-nav div {
  color: #9ca3af;
}

button#navbar-toggle-button {
  color: #e5e7eb;
}

.skip-nav:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: #0c1322;
  color: #ffb39e;
}

/* ---- content --------------------------------------------------------- */

.block,
section.class-description,
dl.notes > dd {
  font-family: var(--body-font-family);
  color: #e5e7eb;
}

dl.notes > dt {
  color: #9ca3af;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

code,
tt,
pre,
.member-signature,
.snippet-container pre {
  font-family: var(--code-font-family);
}

:not(pre) > code,
:not(pre) > tt {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 4px;
  color: #ffd4c7;
  padding: 0.05em 0.35em;
  margin-top: 0;
  padding-top: 0.05em;
}

a > code,
a > tt,
.member-signature a,
dt code,
.summary-table code,
.details-table code {
  color: inherit;
}

.summary-table code,
.details-table code,
dt code,
h1 code,
h2 code,
h3 code,
h4 code {
  background: transparent;
  border: 0;
  padding: 0;
}

.member-signature,
.block pre,
pre {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  color: #e5e7eb;
  line-height: 1.55;
  overflow-x: auto;
  padding: 0.75rem 1rem;
}

.member-signature {
  white-space: pre-wrap;
}

.member-signature .annotations,
.member-signature .type-parameters,
.member-signature .type-parameters-long {
  color: #ffb39e;
}

.member-signature .element-name,
.member-signature .type-name-label {
  color: #f3f4f6;
  font-weight: 600;
}

.member-signature .parameters {
  color: #e5e7eb;
}

pre code,
.snippet-container pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.snippet-container {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
}

.snippet-container pre {
  background: transparent;
  border: 0;
  padding: 0.25rem 1rem;
}

.snippet-container .highlighted,
.snippet-container .highlighted * {
  background-color: rgba(255, 77, 46, 0.22);
}

.snippet-container .italic {
  font-style: italic;
}

.snippet-container .bold {
  font-weight: 700;
}

blockquote {
  margin-left: 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid #ff4d2e;
  color: #9ca3af;
}

hr {
  border: 0;
  border-top: 1px solid #1e293b;
}

/* Deprecation, preview and see-also notes */
.deprecation-block,
.preview-block,
.restricted-block,
.system-property-block {
  border-left: 3px solid #ff4d2e;
  background: rgba(255, 77, 46, 0.08);
  border-radius: 0 6px 6px 0;
  padding: 0.5rem 0.9rem;
  margin: 0.75rem 0;
}

.deprecated-label,
.preview-label,
.restricted-label,
.emphasized-phrase {
  color: #ffb39e;
  font-weight: 600;
}

.deprecation-comment,
.preview-comment,
.restricted-comment {
  color: #e5e7eb;
}

.inherited-list h3,
.inherited-list h2 {
  color: #f3f4f6;
}

.inheritance,
.inherited-list code {
  color: #9ca3af;
}

.help-note,
.sub-title,
.legal-copy,
.about-language {
  color: #9ca3af;
}

body.class-declaration-page .summary h3,
body.class-declaration-page .details h3,
body.class-declaration-page .summary .inherited-list h2 {
  background-color: #0c1322;
  border-color: #1e293b;
  border-radius: 4px;
}

.summary section[class$="-summary"],
.details section[class$="-details"],
.class-uses .detail,
.serialized-class-details {
  border-color: #1e293b;
  border-radius: 6px;
  background-color: rgba(12, 19, 34, 0.6);
}

.inherited-list,
section[class$="-details"] .detail {
  background-color: transparent;
}

section[class$="-details"] .detail h3 {
  color: #f3f4f6;
}

/* ---- tables and tabs ------------------------------------------------- */

.summary-table,
.details-table {
  border: 1px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
}

.summary-table > div,
.details-table > div {
  border-bottom: 1px solid #1e293b;
}

.table-header {
  background: rgba(12, 19, 34, 0.9);
  color: #9ca3af;
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.even-row-color {
  background-color: transparent;
}

.odd-row-color {
  background-color: rgba(12, 19, 34, 0.7);
}

.col-first a:link,
.col-first a:visited,
.col-constructor-name a:link,
.col-constructor-name a:visited,
.col-summary-item-name a:link,
.col-summary-item-name a:visited {
  color: #ffb39e;
}

.col-first a:hover,
.col-constructor-name a:hover,
.col-summary-item-name a:hover {
  color: #ffd4c7;
}

.caption {
  color: #f3f4f6;
}

.caption span {
  background-color: rgba(255, 77, 46, 0.16);
  border-bottom: 2px solid #ff4d2e;
  border-radius: 4px 4px 0 0;
  color: #f3f4f6;
  height: auto;
}

.caption a:link,
.caption a:visited {
  color: #ffb39e;
}

.caption a:hover,
.caption a:active {
  color: #f3f4f6;
}

div.table-tabs > button {
  border-radius: 4px 4px 0 0;
  font-family: var(--body-font-family);
}

div.table-tabs > button.table-tab {
  background: #0c1322;
  color: #e5e7eb;
  border-bottom: 2px solid #1e293b;
}

div.table-tabs > button.table-tab:hover {
  background: #1e293b;
}

div.table-tabs > button.active-table-tab {
  background: rgba(255, 77, 46, 0.16);
  color: #f3f4f6;
  border-bottom: 2px solid #ff4d2e;
}

/* Sort arrows are drawn in black. */
.table-header[onclick]::after {
  filter: invert(1);
}

/* Tables authored in doc comments */
table.plain,
table.borderless {
  border-collapse: collapse;
}

table.plain th,
table.plain td {
  border: 1px solid #334155;
  padding: 0.35rem 0.6rem;
}

table.plain th {
  background: #0c1322;
  color: #f3f4f6;
}

/* ---- search ---------------------------------------------------------- */

#search-input,
#page-search-input {
  background-color: #0f172a;
  border: 1px solid #64748b;
  border-radius: 6px;
  color: #e5e7eb;
  font-family: var(--body-font-family);
  padding-top: 3px;
  padding-bottom: 3px;
}

#search-input:focus,
#page-search-input:focus {
  border-color: #ff4d2e;
}

/* The magnifier is a dark bitmap that vanishes on the dark input, so drop it. */
#search-input,
#page-search-input {
  background-image: none;
  padding-left: 8px;
}

/* The clear icon is a dark bitmap too. */
#reset-button {
  filter: invert(1);
}

::placeholder {
  color: #9ca3af;
}

ul.ui-autocomplete {
  background-color: #0c1322;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.ui-autocomplete-category {
  background-color: #0f172a;
  color: #9ca3af;
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ui-autocomplete .result-item,
.ui-autocomplete .search-tag-desc-result,
.ui-autocomplete .search-tag-holder-result {
  color: #e5e7eb;
}

.ui-autocomplete .search-tag-desc-result,
.ui-autocomplete .search-tag-holder-result {
  color: #9ca3af;
}

.ui-state-active,
.ui-autocomplete li.ui-state-active {
  background: rgba(255, 77, 46, 0.16);
  border: 1px solid #ff4d2e;
  color: #f3f4f6;
}

ul.ui-autocomplete li.ui-static-link {
  background: #0f172a;
}

.ui-autocomplete .result-highlight,
#result-container .result-highlight {
  color: #ffb39e;
}

.search-tag-result:target {
  background-color: rgba(255, 77, 46, 0.22);
}

.page-search-info,
.page-search-header,
button.page-search-header {
  background-color: #0c1322;
  color: #e5e7eb;
  border-radius: 4px;
}

button.page-search-header {
  font-family: var(--body-font-family);
}

div.page-search-info {
  border-color: #1e293b;
}

/* Copy and anchor icons are dark on a transparent background. */
button.copy img,
a.anchor-link > img {
  filter: invert(0.8);
}

button.copy span {
  color: #e5e7eb;
}

button.snippet-copy,
button.copy {
  border-radius: 4px;
}

/* ---- JDK 25 doclet rules that hard-code light colours ----------------- */

/* Inherited-member lists on class pages */
.inherited-list > code {
  background-color: var(--code-background-color);
  border: 0;
  border-radius: 0;
  color: #e5e7eb;
  padding: 8px;
}

.inherited-list > code a:link,
.inherited-list > code a:visited {
  color: #ff8466;
}

/* The serialized-form panel matches the stock rule's specificity. */
section.serialized-class-details {
  background-color: var(--detail-block-color);
  border-color: #1e293b;
  border-radius: 6px;
}

/* Search result descriptions, in the autocomplete list and on the search page */
.ui-autocomplete .search-result-desc,
#result-container div.result-table > a.search-result-link .search-result-desc {
  color: #9ca3af;
}

.ui-menu .ui-state-active .search-result-desc,
#result-container div.result-table > a.search-result-link.selected .search-result-desc,
#result-container div.result-table > a.search-result-link:focus-visible .search-result-desc {
  color: #e5e7eb;
}

#result-container div.result-table > a.search-result-link {
  color: #e5e7eb;
}

select#search-modules {
  background: #0f172a;
  border: 1px solid #64748b;
  border-radius: 6px;
  color: #e5e7eb;
}

/* Keyboard shortcut labels on the Help and Search pages */
kbd {
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 0 #334155;
  color: #f3f4f6;
  font-family: var(--code-font-family);
}

/* ---- footer ---------------------------------------------------------- */

footer {
  color: #9ca3af;
  font-size: 0.9em;
}

.legal-copy {
  margin: 1rem 20px 2rem;
}

.legal-copy a:link,
.legal-copy a:visited {
  color: #ff8466;
}

/* ---- syntax highlighting (javadoc --syntax-highlight, highlight.js) ---
 * The doclet links resource-files/highlight.css after this stylesheet, so
 * every rule here is prefixed with .hljs to out-rank it whatever the order. */

.hljs {
  background: transparent;
  color: #e5e7eb;
}

.hljs .hljs-keyword,
.hljs .hljs-literal,
.hljs .hljs-selector-tag,
.hljs .hljs-doctag,
.hljs .hljs-name {
  color: #ff8466;
  font-weight: 500;
}

.hljs .hljs-string,
.hljs .hljs-regexp,
.hljs .hljs-addition,
.hljs .hljs-template-variable {
  color: #86efac;
}

.hljs .hljs-comment,
.hljs .hljs-quote,
.hljs .hljs-deletion {
  color: #9ca3af;
  font-style: italic;
}

.hljs .hljs-type,
.hljs .hljs-title,
.hljs .hljs-title.class_,
.hljs .hljs-title.class_.inherited__,
.hljs .hljs-class .hljs-title,
.hljs .hljs-section,
.hljs .hljs-selector-id,
.hljs .hljs-selector-class {
  color: #ffb39e;
}

.hljs .hljs-title.function_,
.hljs .hljs-function .hljs-title {
  color: #e5e7eb;
}

.hljs .hljs-number,
.hljs .hljs-symbol,
.hljs .hljs-bullet,
.hljs .hljs-variable.constant_ {
  color: #fdba74;
}

.hljs .hljs-built_in,
.hljs .hljs-meta,
.hljs .hljs-meta .hljs-keyword,
.hljs .hljs-meta .hljs-string,
.hljs .hljs-attr,
.hljs .hljs-attribute,
.hljs .hljs-tag,
.hljs .hljs-link {
  color: #93c5fd;
}

.hljs .hljs-meta .hljs-string {
  color: #86efac;
}

.hljs .hljs-params,
.hljs .hljs-variable,
.hljs .hljs-property,
.hljs .hljs-punctuation,
.hljs .hljs-operator {
  color: #e5e7eb;
}

.hljs .hljs-emphasis {
  font-style: italic;
}

.hljs .hljs-strong {
  font-weight: 700;
}


/* ---- motion and small screens --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media screen and (max-width: 600px) {
  main {
    padding: 10px 16px;
  }

  /* A class name of up to about 29 characters has to fit the line as one
   * word, so the title grows with the screen from 1.2em at 320px; the section
   * headings step down so it still reads as the larger one. */
  h1.title {
    font-size: clamp(1.2em, 5.6vw, 1.5em);
  }

  h2 {
    font-size: 1.15em;
  }

  /* The inheritance line is a qualified name: fit it by size and indent, and
   * let the stock scroller take what is still too long, not a break inside a
   * word. */
  div.inheritance {
    font-size: 0.8em;
    overflow-wrap: normal;
  }

  /* Fade the scroller's right edge so a cut line reads as continuing. */
  main > div.inheritance {
    padding-right: 1.5em;
    mask-image: linear-gradient(to right, #000 calc(100% - 1.5em), transparent);
  }

  div.inheritance div.inheritance {
    font-size: 1em;
    margin-left: 1em;
  }

  /* Keep a type link and its external-link arrow on one line. */
  .summary-table a.external-link,
  .member-signature a.external-link,
  code a.external-link,
  a.external-link:has(> code) {
    white-space: nowrap;
  }

  .ui-autocomplete .search-result-label,
  .ui-autocomplete .search-result-desc {
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .member-signature,
  pre {
    font-size: 0.9em;
  }

  #page-search-input {
    width: 160px;
  }

  /* The box is too narrow for its placeholder, so mark the cut, and fade the
   * breadcrumb, which the stock script scrolls to its end, where it is cut
   * instead of starting mid-word. */
  #search-input {
    text-overflow: ellipsis;
  }

  .sub-nav ol.sub-nav-list {
    padding-left: 1.5em;
    mask-image: linear-gradient(to right, transparent, #000 1.5em);
  }
}

/* The class hierarchy nests up to seven lists at 40px each, which is wider
 * than a 320px screen. */
@media screen and (max-width: 400px) {
  section.hierarchy ul {
    padding-left: 1rem;
  }

  .type-name-link {
    overflow-wrap: anywhere;
  }
}
